/* ===== Bouton WhatsApp - Dorevia-Vault v1.1 ===== */

:root {
    --whatsapp-green: #25D366;
    --whatsapp-green-hover: #20BA5A;
    --whatsapp-shadow: rgba(37, 211, 102, 0.4);
}

.whatsapp-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--whatsapp-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--whatsapp-shadow);
    z-index: 1000;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease-out;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.3s ease-out 1s forwards;
}

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

.whatsapp-button:active {
    transform: scale(0.95);
}

.whatsapp-button:focus {
    outline: 3px solid rgba(37, 211, 102, 0.5);
    outline-offset: 2px;
}

.whatsapp-button-icon {
    width: 32px;
    height: 32px;
    fill: #FFFFFF;
    display: block;
}

/* Badge disponibilité */
.whatsapp-availability {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    background-color: #10B981; /* Vert "en ligne" */
    animation: pulse 2s ease-in-out infinite;
}

.whatsapp-availability.offline {
    background-color: #6B7280; /* Gris "hors ligne" */
    animation: none;
}

/* Animation pulse (après 5s d'inactivité) */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse léger après 5s d'inactivité */
.whatsapp-button.idle {
    animation: fadeInUp 0.3s ease-out 1s forwards,
               pulseButton 2s ease-in-out 6s infinite;
}

@keyframes pulseButton {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    .whatsapp-button {
        bottom: 80px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .whatsapp-button-icon {
        width: 28px;
        height: 28px;
    }
    
    .whatsapp-availability {
        width: 14px;
        height: 14px;
        top: -6px;
        right: -6px;
    }
}

/* Responsive - Tablette */
@media (min-width: 768px) and (max-width: 991px) {
    .whatsapp-button {
        bottom: 24px;
        right: 24px;
    }
}

/* Accessibilité - Réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    .whatsapp-button {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .whatsapp-button.idle {
        animation: none;
    }
    
    .whatsapp-availability {
        animation: none;
    }
    
    .whatsapp-button:hover {
        transform: none;
    }
}

/* Performance */
.whatsapp-button {
    will-change: transform;
}
