/**
 * ==============================================================================
 * RÉSIDENCE TOUVALEM - COMPOSANT CHATBOX WHATSAPP (whatsapp-chatbox.css)
 * ==============================================================================
 * Styles du widget flottant interactif de conciergerie WhatsApp :
 * - Bouton flottant animé avec impulsion lumineuse et badge de notification.
 * - Fenêtre de discussion moderne aux couleurs Touvalem (#244C4A & #EFA836).
 * - En-tête avec avatar, statut en ligne et bouton de fermeture.
 * - Corps de conversation avec bulle d'accueil et boutons de messages rapides.
 * - Barre de saisie inférieure avec champ texte et bouton d'envoi.
 * ==============================================================================
 */

/* Conteneur principal fixe */
.chatbox-widget-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Bouton déclencheur flottant */
.chatbox-toggle-button {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
}

.chatbox-toggle-button:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.55);
}

/* Effet d'impulsion continue */
.chatbox-pulse-effect {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid #25D366;
    animation: chatboxPulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

@keyframes chatboxPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.35);
        opacity: 0;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

/* Badge de notification */
.chatbox-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #EFA836;
    color: #1a3331;
    font-size: 0.7rem;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

/* Fenêtre de discussion */
.chatbox-popup-window {
    position: absolute;
    bottom: 78px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbox-popup-window.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* En-tête de la fenêtre */
.chatbox-popup-header {
    background: linear-gradient(135deg, #244C4A 0%, #16302f 100%);
    color: #ffffff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbox-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbox-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
}

.chatbox-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #EFA836;
}

.chatbox-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #25D366;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.chatbox-header-titles h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.chatbox-header-titles p {
    margin: 2px 0 0 0;
    font-size: 0.75rem;
    color: #c0d8d6;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatbox-close-button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.2s;
}

.chatbox-close-button:hover {
    color: #ffffff;
}

/* Corps de discussion */
.chatbox-popup-body {
    padding: 18px;
    background: #f8faf9;
    max-height: 330px;
    overflow-y: auto;
}

.chatbox-bubble-received {
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 12px 12px 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #333333;
    border-left: 3px solid #244C4A;
}

.chatbox-bubble-received .chat-time {
    display: block;
    font-size: 0.7rem;
    color: #888888;
    margin-top: 5px;
    text-align: right;
}

/* Boutons de raccourcis rapides */
.chatbox-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.chatbox-quick-btn {
    background: #ffffff;
    border: 1px solid #dbe5e4;
    padding: 9px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #244C4A;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.chatbox-quick-btn:hover {
    background: #244C4A;
    color: #ffffff;
    border-color: #244C4A;
    transform: translateX(4px);
}

.chatbox-quick-btn i {
    color: #EFA836;
}

.chatbox-quick-btn:hover i {
    color: #ffffff;
}

/* Pied de la fenêtre & zone de saisie */
.chatbox-popup-footer {
    padding: 12px 15px;
    background: #ffffff;
    border-top: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbox-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 9px 15px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.chatbox-input:focus {
    border-color: #244C4A;
}

.chatbox-send-button {
    background: #25D366;
    color: #ffffff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: transform 0.2s, background-color 0.2s;
}

.chatbox-send-button:hover {
    background: #128C7E;
    transform: scale(1.08);
}
