/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   🚀 BOUTON RETOUR EN HAUT (SCROLL TO TOP)
   Position : Bas à droite (évite le widget cookies à gauche)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.scroll-to-top:active {
    transform: translateY(-2px) scale(1.05);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Animation de l'icône au hover */
.scroll-to-top:hover svg {
    animation: bounce-up 0.6s ease-in-out infinite;
}

@keyframes bounce-up {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Responsive : ajuster position sur mobile */
@media (max-width: 768px) {
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
    
    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* Sur très petit écran, remonter un peu pour éviter les contrôles du navigateur */
@media (max-width: 480px) {
    .scroll-to-top {
        bottom: 25px;
        right: 15px;
    }
}

/* Theme clair */
[data-theme='light'] .scroll-to-top {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

[data-theme='light'] .scroll-to-top:hover {
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
}

/* Animation d'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-to-top.visible {
    animation: fadeInUp 0.3s ease-out;
}

/* Effet de pulsation subtile pour attirer l'attention */
.scroll-to-top.pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6);
    }
}
