/**
 * HAMBURGER MENU ANIMATIONS
 * Animations modernes pour le menu hamburger et le menu mobile
 */

/* ===================================
   HAMBURGER BUTTON STYLES
   ================================= */

.hamburger-menu {
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    padding: 0;
}

.hamburger-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hamburger-menu:hover::before {
    opacity: 1;
}

.hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 215, 0, 0.5);
    transform: scale(1.05);
}

.hamburger-menu:active {
    transform: scale(0.95);
}

/* Hamburger Lines */
.hamburger-line {
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, #ffd700 0%, #fbbf24 100%);
    border-radius: 3px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 3px rgba(255, 215, 0, 0.3);
}

.hamburger-line:nth-child(1) {
    transform-origin: top left;
}

.hamburger-line:nth-child(2) {
    transform-origin: center;
}

.hamburger-line:nth-child(3) {
    transform-origin: bottom left;
}

/* Animation quand le menu est ouvert */
.hamburger-menu.active {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.8);
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, -3px);
    width: 28px;
    background: linear-gradient(90deg, #ffd700 0%, #ff6b6b 100%);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, 3px);
    width: 28px;
    background: linear-gradient(90deg, #ffd700 0%, #ff6b6b 100%);
}

/* Effet de pulse lors du clic */
@keyframes hamburgerPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.hamburger-menu:active {
    animation: hamburgerPulse 0.6s ease-out;
}

/* ===================================
   MOBILE MENU ANIMATIONS
   ================================= */

#mobile-menu {
    transform-origin: top center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* États du menu */
#mobile-menu.hidden {
    opacity: 0;
    transform: translateY(-20px) scaleY(0.8);
    pointer-events: none;
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    pointer-events: auto;
    animation: menuSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes menuSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scaleY(0.7);
    }
    60% {
        transform: translateY(5px) scaleY(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

/* Animation de fermeture */
#mobile-menu.closing {
    animation: menuSlideOut 0.3s cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes menuSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scaleY(0.8);
    }
}

/* ===================================
   MENU ITEMS CASCADE ANIMATION
   ================================= */

.mobile-nav-link {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu:not(.hidden) .mobile-nav-link {
    animation: navLinkSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes navLinkSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Effet cascade - chaque élément arrive avec un délai */
#mobile-menu:not(.hidden) .mobile-nav-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu:not(.hidden) .mobile-nav-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu:not(.hidden) .mobile-nav-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu:not(.hidden) .mobile-nav-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu:not(.hidden) .mobile-nav-link:nth-child(5) { animation-delay: 0.25s; }
#mobile-menu:not(.hidden) .mobile-nav-link:nth-child(6) { animation-delay: 0.3s; }
#mobile-menu:not(.hidden) .mobile-nav-link:nth-child(7) { animation-delay: 0.35s; }
#mobile-menu:not(.hidden) .mobile-nav-link:nth-child(8) { animation-delay: 0.4s; }

/* Animation des sections du menu */
.mobile-menu-section {
    opacity: 0;
    transform: translateY(-10px);
}

#mobile-menu:not(.hidden) .mobile-menu-section {
    animation: sectionFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes sectionFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Délais en cascade pour les sections */
#mobile-menu:not(.hidden) .mobile-menu-section:nth-child(1) { animation-delay: 0.1s; }
#mobile-menu:not(.hidden) .mobile-menu-section:nth-child(2) { animation-delay: 0.2s; }
#mobile-menu:not(.hidden) .mobile-menu-section:nth-child(3) { animation-delay: 0.3s; }
#mobile-menu:not(.hidden) .mobile-menu-section:nth-child(4) { animation-delay: 0.4s; }
#mobile-menu:not(.hidden) .mobile-menu-section:nth-child(5) { animation-delay: 0.5s; }

/* ===================================
   HOVER EFFECTS ON MENU ITEMS
   ================================= */

.mobile-nav-link {
    position: relative;
    overflow: hidden;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, #ffd700 0%, #fbbf24 100%);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-link:hover::before {
    height: 80%;
}

.mobile-nav-link:hover {
    transform: translateX(8px);
    color: #ffd700 !important;
}

/* Animation des icônes au hover */
.mobile-nav-link:hover i {
    transform: scale(1.2) rotate(5deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   CIRCUIT CARDS ANIMATION
   ================================= */

.mobile-circuit-item {
    opacity: 0;
    transform: scale(0.9);
}

#mobile-menu:not(.hidden) .mobile-circuit-item {
    animation: circuitCardPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes circuitCardPop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#mobile-menu:not(.hidden) .mobile-circuit-item:nth-child(1) { animation-delay: 0.3s; }
#mobile-menu:not(.hidden) .mobile-circuit-item:nth-child(2) { animation-delay: 0.35s; }
#mobile-menu:not(.hidden) .mobile-circuit-item:nth-child(3) { animation-delay: 0.4s; }
#mobile-menu:not(.hidden) .mobile-circuit-item:nth-child(4) { animation-delay: 0.45s; }

/* Hover effect sur les circuit cards */
.mobile-circuit-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mobile-circuit-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.mobile-circuit-item:hover::after {
    opacity: 1;
}

.mobile-circuit-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.mobile-circuit-item:hover .mobile-circuit-icon {
    transform: scale(1.2) rotate(-5deg);
}

/* ===================================
   CTA BUTTONS ANIMATION
   ================================= */

.mobile-cta-button {
    opacity: 0;
    transform: translateY(10px);
}

#mobile-menu:not(.hidden) .mobile-cta-button {
    animation: ctaButtonSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ctaButtonSlide {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

#mobile-menu:not(.hidden) .mobile-cta-button:nth-child(1) { animation-delay: 0.4s; }
#mobile-menu:not(.hidden) .mobile-cta-button:nth-child(2) { animation-delay: 0.45s; }
#mobile-menu:not(.hidden) .mobile-cta-button:nth-child(3) { animation-delay: 0.5s; }
#mobile-menu:not(.hidden) .mobile-cta-button:nth-child(4) { animation-delay: 0.55s; }

/* Effet ripple sur les boutons CTA */
.mobile-cta-button {
    position: relative;
    overflow: hidden;
}

.mobile-cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.mobile-cta-button:hover::before {
    width: 300px;
    height: 300px;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   ================================= */

@media (max-width: 480px) {
    .hamburger-menu {
        width: 44px;
        height: 44px;
    }

    .hamburger-line {
        width: 22px;
        height: 2.5px;
    }

    .hamburger-menu.active .hamburger-line:nth-child(1),
    .hamburger-menu.active .hamburger-line:nth-child(3) {
        width: 26px;
    }
}

/* ===================================
   ACCESSIBILITY
   ================================= */

/* Focus visible pour l'accessibilité clavier */
.hamburger-menu:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

.mobile-nav-link:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Réduire les animations si l'utilisateur préfère */
@media (prefers-reduced-motion: reduce) {
    .hamburger-menu,
    .hamburger-line,
    #mobile-menu,
    .mobile-nav-link,
    .mobile-menu-section,
    .mobile-circuit-item,
    .mobile-cta-button {
        animation: none !important;
        transition: none !important;
    }
}
