/* ==============================================
   STYLES CHAT WHATSAPP - BADIS AI
   ============================================== */

/* Container principal du chat */
.whatsapp-chat {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
}

/* Bouton principal WhatsApp */
.whatsapp-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    border: none;
    animation: whatsapp-pulse 2s infinite;
    position: relative;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-button i {
    color: white;
    font-size: 28px;
}

/* Animation de pulsation */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

/* Popup principal */
.whatsapp-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    overflow: hidden;
}

.whatsapp-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header du popup */
.whatsapp-header {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.whatsapp-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.whatsapp-info {
    flex: 1;
}

.whatsapp-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.whatsapp-status {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Bouton de fermeture */
.whatsapp-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.whatsapp-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Corps du popup */
.whatsapp-body {
    padding: 20px;
}

/* Message d'accueil */
.whatsapp-message {
    background: #f0f0f0;
    padding: 12px 15px;
    border-radius: 15px 15px 15px 5px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    color: #333;
}

.whatsapp-message::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-bottom-color: #f0f0f0;
    border-left: none;
}

/* Actions / Boutons */
.whatsapp-actions {
    display: flex;
    gap: 10px;
}

.whatsapp-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.whatsapp-btn.primary {
    background: #25d366;
    color: white;
}

.whatsapp-btn.primary:hover {
    background: #128c7e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.whatsapp-btn.secondary {
    background: #f8f9fa;
    color: #25d366;
    border: 1px solid #e9ecef;
}

.whatsapp-btn.secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

/* Badge de notification */
.whatsapp-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: badge-bounce 1s infinite;
}

@keyframes badge-bounce {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.2); 
    }
}

/* Animation d'entrée */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-chat.animate-in {
    animation: slideInUp 0.6s ease-out;
}

/* États interactifs */
.whatsapp-button:active {
    transform: scale(0.95);
}

.whatsapp-popup::before {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top-color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .whatsapp-popup {
        width: 280px;
        right: -10px;
    }
    
    .whatsapp-chat {
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-button {
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-button i {
        font-size: 24px;
    }
    
    .whatsapp-header {
        padding: 15px;
    }
    
    .whatsapp-body {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .whatsapp-popup {
        width: 260px;
        right: -20px;
    }
    
    .whatsapp-actions {
        flex-direction: column;
    }
    
    .whatsapp-btn {
        width: 100%;
    }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-button,
    .whatsapp-popup,
    .whatsapp-btn,
    .whatsapp-close {
        animation: none;
        transition: none;
    }
    
    @keyframes whatsapp-pulse {
        0%, 100% {
            box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
        }
    }
    
    @keyframes badge-bounce {
        0%, 100% { 
            transform: scale(1); 
        }
    }
}

/* Focus pour l'accessibilité */
.whatsapp-button:focus,
.whatsapp-btn:focus,
.whatsapp-close:focus {
    outline: 2px solid #25d366;
    outline-offset: 2px;
}

/* Thème sombre */
@media (prefers-color-scheme: dark) {
    .whatsapp-popup {
        background: #2d3748;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    }
    
    .whatsapp-message {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .whatsapp-message::before {
        border-bottom-color: #4a5568;
    }
    
    .whatsapp-btn.secondary {
        background: #4a5568;
        color: #25d366;
        border-color: #718096;
    }
    
    .whatsapp-btn.secondary:hover {
        background: #2d3748;
    }
}