/* 🌊 Animation épique pour le logo "Capté!" */

/* Styles pour le lien du logo */
a:has(.capte-logo-container),
a .capte-logo-container {
    text-decoration: none !important;
    color: inherit !important;
}

a:has(.capte-logo-container):hover,
a .capte-logo-container:hover {
    text-decoration: none !important;
}

.capte-logo-container {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    overflow: visible;
    text-decoration: none;
    color: inherit;
}

.capte-letter {
    display: inline-block;
    position: relative;
    background: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center bottom;
}

/* Animation de vague au hover */
.capte-logo-container:hover .capte-letter {
    animation: colorWave 2s ease-in-out infinite, letterWave 1.5s ease-in-out infinite;
}

/* Délais en cascade pour l'effet vague */
.capte-logo-container:hover .capte-letter:nth-child(1) { animation-delay: 0s, 0s; }
.capte-logo-container:hover .capte-letter:nth-child(2) { animation-delay: 0.1s, 0.1s; }
.capte-logo-container:hover .capte-letter:nth-child(3) { animation-delay: 0.2s, 0.2s; }
.capte-logo-container:hover .capte-letter:nth-child(4) { animation-delay: 0.3s, 0.3s; }
.capte-logo-container:hover .capte-letter:nth-child(5) { animation-delay: 0.4s, 0.4s; }
.capte-logo-container:hover .capte-letter:nth-child(6) { animation-delay: 0.5s, 0.5s; }

/* Animation de vague de couleurs */
@keyframes colorWave {
    0% {
        background: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    16.66% {
        background: linear-gradient(135deg, #8b5cf6 0%, #f59e0b 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    33.33% {
        background: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    50% {
        background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    66.66% {
        background: linear-gradient(135deg, #10b981 0%, #f59e0b 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    83.33% {
        background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
    100% {
        background: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }
}

/* Animation de vague physique (lettres qui montent/descendent) - VERSION ADOUCIE */
@keyframes letterWave {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    25% {
        transform: translateY(-4px) scale(1.05);
    }
    50% {
        transform: translateY(-6px) scale(1.08);
    }
    75% {
        transform: translateY(-4px) scale(1.05);
    }
}

/* Animation bonus : effet de pulsation subtile */
.capte-logo-container:hover {
    animation: containerPulse 2s ease-in-out infinite;
}

@keyframes containerPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.5));
    }
}

/* Responsive : désactiver sur mobile pour les performances */
@media (max-width: 768px) {
    .capte-logo-container:hover .capte-letter {
        animation: none;
    }
    .capte-logo-container:hover {
        animation: none;
    }
}

/* Mode sombre : ajustement des couleurs */
.dark .capte-logo-container:hover {
    filter: drop-shadow(0 0 12px rgba(14, 165, 233, 0.4));
}

/* 🎯 Navigation active - soulignement fluide */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -8px;
    left: 50%;
    background: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
    transform: translateX(-50%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1px;
}

.nav-link.active {
    font-weight: 600;
    color: #0ea5e9 !important;
}

.dark .nav-link.active {
    color: #22c55e !important;
}

.nav-link.active::after {
    width: 100%;
}

/* Soulignement au hover pour les liens non actifs */
.nav-link:not(.active):hover::after {
    width: 80%;
    opacity: 0.6;
}

/* Mobile navigation active state */
.nav-link-mobile {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link-mobile.active {
    font-weight: 600;
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9 !important;
}

.dark .nav-link-mobile.active {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e !important;
}

/* 🌊 Transitions fade entre les pages */
.page-transition {
    transition: opacity 0.3s ease-in-out;
}

.page-fade-out {
    opacity: 0;
}

.page-fade-in {
    opacity: 1;
}

/* Animation de chargement pour les transitions */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.dark .page-loading {
    background: rgba(17, 24, 39, 0.9);
}

.page-loading.active {
    opacity: 1;
    visibility: visible;
}

.page-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(14, 165, 233, 0.2);
    border-top: 3px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Effet de transition smooth à l'entrée/sortie du hover */
.capte-letter {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Effet de retour doux quand on arrête le hover */
.capte-logo-container:not(:hover) .capte-letter {
    animation: gentleBounceBack 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes gentleBounceBack {
    0% { transform: translateY(-6px) scale(1.08); }
    30% { transform: translateY(-2px) scale(1.02); }
    60% { transform: translateY(1px) scale(0.995); }
    80% { transform: translateY(-0.5px) scale(1.002); }
    100% { transform: translateY(0px) scale(1); }
}