/* FreeTCG - Mobile Menu Styles */

/* Amélioration du bouton hamburger */
.mobile-menu-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

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

.mobile-menu-toggle span {
    position: absolute;
    font-size: 1.25rem;
}

/* Animation smooth pour les icônes */
.hamburger-icon,
.close-icon {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hamburger-icon {
    transform: scale(1);
}

.close-icon {
    transform: scale(0.8);
    opacity: 0;
}

.nav-open + .header-content .close-icon {
    transform: scale(1);
    opacity: 1;
}

/* Menu mobile amélioré */
@media (max-width: 768px) {
    /* Fermer avec swipe */
    .nav {
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Style du menu ouvert */
    .nav.nav-open {
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.8);
    }
    
    /* Amélioration des liens du menu */
    .nav-link {
        position: relative;
        overflow: hidden;
    }
    
    .nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 3px;
        background: var(--primary-color);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .nav-link:hover::before,
    .nav-link:focus::before {
        transform: translateX(0);
    }
    
    /* Bouton de connexion amélioré en mobile */
    .btn-header {
        background: var(--gradient-primary);
        color: var(--dark-bg);
        font-weight: 700;
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    }
    
    .btn-header:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    }
    
    /* Animation d'entrée du menu */
    .nav.nav-open > * {
        animation: slideInFromLeft 0.4s ease forwards;
        opacity: 0;
    }
    
    .nav.nav-open > *:nth-child(1) { animation-delay: 0.1s; }
    .nav.nav-open > *:nth-child(2) { animation-delay: 0.15s; }
    .nav.nav-open > *:nth-child(3) { animation-delay: 0.2s; }
    .nav.nav-open > *:nth-child(4) { animation-delay: 0.25s; }
    .nav.nav-open > *:nth-child(5) { animation-delay: 0.3s; }
    .nav.nav-open > *:nth-child(6) { animation-delay: 0.35s; }
    .nav.nav-open > *:nth-child(7) { animation-delay: 0.4s; }
    
    @keyframes slideInFromLeft {
        from {
            transform: translateX(-30px);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }
    
    /* Header sticky amélioré */
    .header {
        backdrop-filter: blur(15px);
        background: rgba(10, 10, 10, 0.95);
    }
    
    /* Ajustement du dropdown utilisateur dans le menu mobile */
    .user-dropdown {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(255, 215, 0, 0.2);
        background: var(--dark-secondary);
    }
    
    /* Points display responsive */
    .points-display {
        backdrop-filter: blur(10px);
        background: rgba(255, 215, 0, 0.15);
        border: 1px solid rgba(255, 215, 0, 0.3);
    }
}

/* Petits écrans */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .nav {
        width: 85%;
        max-width: none;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.875rem;
    }
}

/* Gestion du scroll lock */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Accessibilité */
.mobile-menu-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Mode paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .nav {
        padding-top: 3rem;
        overflow-y: auto;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}