/* ===============================================
   Boutons flottants améliorés
   WhatsApp et Back to Top
   =============================================== */

/* WhatsApp Button - Version moderne */
.whatsapp-button {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9998;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    border: none;
    outline: none;
}

.whatsapp-button:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
    background: linear-gradient(135deg, #128c7e, #25d366);
    color: #ffffff;
    text-decoration: none;
}

.whatsapp-button:active {
    transform: translateY(-1px) scale(1.05);
}

.whatsapp-button i {
    font-size: 24px;
    animation: pulse-whatsapp 2s infinite;
}

/* Animation pulse pour WhatsApp */
@keyframes pulse-whatsapp {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Back to Top Button - Version moderne */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #6c3484, #de067c);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(108, 52, 132, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    border: none;
    outline: none;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, #de067c, #fbd40a);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(108, 52, 132, 0.6);
}

.back-to-top:active {
    transform: translateY(-1px) scale(1);
}

.back-to-top i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

/* Tooltip pour les boutons */
.whatsapp-button::before,
.back-to-top::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

.whatsapp-button::after,
.back-to-top::after {
    content: '';
    position: absolute;
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

.whatsapp-button:hover::before,
.whatsapp-button:hover::after,
.back-to-top:hover::before,
.back-to-top:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
    .whatsapp-button {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-button i {
        font-size: 20px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .back-to-top i {
        font-size: 18px;
    }
    
    /* Masquer les tooltips sur mobile */
    .whatsapp-button::before,
    .whatsapp-button::after,
    .back-to-top::before,
    .back-to-top::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .whatsapp-button {
        bottom: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
    }
    
    .whatsapp-button i {
        font-size: 18px;
    }
    
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .back-to-top i {
        font-size: 16px;
    }
}

/* Animation d'entrée pour les boutons */
.whatsapp-button,
.back-to-top {
    animation: slideIn 0.5s ease-out;
}

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

/* États de focus pour l'accessibilité */
.whatsapp-button:focus,
.back-to-top:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Animation de rotation pour le back-to-top */
.back-to-top.rotating i {
    animation: rotate360 0.25s ease-in-out;
}

.back-to-top.rotating-fast i {
    animation: rotate360 0.15s ease-in-out;
}

@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Éviter les conflits avec les anciens styles */
.whatsapp-button.old-style {
    display: none !important;
}

/* Animation de battement de cœur pour WhatsApp */
.whatsapp-button.heartbeat i {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}
