/* Améliorations de la navigation mobile */

/* Menu hamburger pour très petits écrans */
@media all and (max-width: 600px) {
    .mobile-nav-toggle {
        display: block;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 1001;
        background: var(--couleurGit);
        border: none;
        border-radius: 4px;
        padding: 10px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }
    
    .mobile-nav-toggle:hover {
        background: #d32f0f;
    }
    
    .mobile-nav-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: white;
        margin: 5px 0;
        transition: 0.3s;
        transform-origin: center;
    }
    
    /* Animation du hamburger vers X */
    .mobile-nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Navigation mobile overlay */
    nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        backdrop-filter: blur(10px);
        z-index: 1000;
        transition: left 0.3s ease;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 0;
    }
    
    nav.active {
        left: 0;
    }
    
    nav .menu-item {
        display: block;
        padding: 20px 0;
        font-size: 24px;
        font-weight: 300;
        color: var(--texte-menu);
        text-decoration: none;
        border: none;
        transition: all 0.3s ease;
        opacity: 0;
        transform: translateY(20px);
    }
    
    nav.active .menu-item {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Animation décalée pour chaque élément */
    nav.active .menu-item:nth-child(1) { transition-delay: 0.1s; }
    nav.active .menu-item:nth-child(2) { transition-delay: 0.2s; }
    nav.active .menu-item:nth-child(3) { transition-delay: 0.3s; }
    nav.active .menu-item:nth-child(4) { transition-delay: 0.4s; }
    nav.active .menu-item:nth-child(5) { transition-delay: 0.5s; }
    
    nav .menu-item:hover,
    nav .menu-item.current {
        color: white;
        background-color: rgba(239, 57, 26, 0.2);
        border-radius: var(--radius-md);
        transform: scale(1.05);
    }
    
}

/* Masquer le bouton hamburger sur les écrans plus larges */
@media all and (min-width: 601px) {
    .mobile-nav-toggle {
        display: none;
    }
    
    /* S'assurer que la navigation est visible sur les écrans plus larges */
    nav {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        z-index: auto !important;
        transition: none !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: center !important;
        text-align: left !important;
        padding: 0 !important;
        left: 0 !important;
        transform: none !important;
        animation: none !important;
    }
    
    nav .menu-item {
        display: inline-block !important;
        padding: 10px 15px !important;
        font-size: inherit !important;
        font-weight: inherit !important;
        opacity: 1 !important;
        transform: none !important;
        transition: all 0.3s ease;
        animation: none !important;
    }
}

/* Améliorations pour tablettes */
@media all and (min-width: 601px) and (max-width: 1024px) {
    nav .menu-item {
        transition: all 0.3s ease;
        border-radius: 4px;
        margin: 0 5px;
    }
    
    nav .menu-item:hover {
        background: rgba(239, 57, 26, 0.1);
        transform: translateY(-2px);
    }
}

/* Améliorations générales pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .mobile-nav-toggle span,
    nav,
    nav .menu-item {
        transition: none;
    }
}

/* Focus visible pour l'accessibilité */
.mobile-nav-toggle:focus {
    outline: 2px solid var(--couleurGit);
    outline-offset: 2px;
}

nav .menu-item:focus {
    outline: 2px solid var(--couleurGit);
    outline-offset: 2px;
    background: rgba(239, 57, 26, 0.1);
}

/* Amélioration des zones de clic */
@media all and (max-width: 768px) {
    nav .menu-item {
        min-height: 44px; /* Taille minimale recommandée pour le touch */
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Animation de chargement pour le menu */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Application des animations */
nav.active {
    animation: slideInFromLeft 0.3s ease;
}

nav.active .menu-item {
    animation: fadeInUp 0.4s ease forwards;
}
