/* Created by TopStyle Trial - www.topstyle4.com */
/* --- MENU.CSS - Navigation Globale --- */

/* Reset de base pour la nav */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000; /* Très haut pour être au-dessus de tout */
    padding: 12px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

/* Conteneur principal : C'est lui qui garantit l'alignement */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px; /* Largeur fixe identique partout */
    margin: 0 auto;    /* Centrage automatique */
    padding: 0 20px;   /* Marge intérieure identique partout */
    width: 100%;
    box-sizing: border-box;
}

/* Gestion de l'image Logo */
.logo img {
    height: 80px; /* Ajustez cette valeur selon la taille désirée de votre logo */
    width: auto;
    display: block;
}

/* Liste de navigation */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Éléments de liste : Espacement régulier */
.nav-links li {
    display: flex;
    align-items: center;
    /*margin-left: 35px; /* Espacement fixe entre chaque élément */
    padding: 8px 16px;
}

/* Liens texte standards */
.nav-links a:not(.btn-nav):not(.btn-nav2) {
    color: var(--text-main, #E0E0E0);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease, border-color 0.3s ease; /* Transition fluide uniquement sur la couleur */
    white-space: nowrap;
    
    /* CORRECTION : Bordure transparente par défaut pour réserver l'espace */
    border: 1px solid transparent;
    /* Réduction du padding pour compenser la bordure (8px + 1px de bordure = 9px visuel, donc on met 7px ou 8px selon le rendu voulu) */
    padding: 7px 15px; 
    border-radius: 2px;
}

.nav-links a:not(.btn-nav):not(.btn-nav2):hover {
    color: var(--gold-primary, #D4AF37);
    border-color: var(--gold-primary, #D4AF37); /* La bordure apparaît sans changer la taille */
    /* On ne touche pas au padding ici pour éviter le saut */
}

/* Style Bouton 1 (Ex: Expertise, Méthode - Style "Secondaire" ou Actif) */
.btn-nav {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-primary, #D4AF37) !important;
    /* Padding réduit pour alléger */
    padding: 6px 14px; 
    border-radius: 2px;
    /* Police plus fine */
    font-weight: 500; 
    /* Bordure fixe pour éviter le saut */
    border: 1px solid rgba(212, 175, 55, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-nav:hover {
    background: var(--gold-primary, #D4AF37);
    color: var(--bg-color, #1A1A1A) !important;
    border-color: var(--gold-primary, #D4AF37); /* Juste un changement de couleur de bordure */
}

/* Style Bouton 2 (Ex: Démarrer un audit - Style "Primary") */
.btn-nav2 {
    display: inline-block;
    background: var(--gold-primary, #D4AF37);
    color: var(--bg-color, #1A1A1A) !important;
    /* Padding réduit pour alléger */
    padding: 6px 14px; 
    border-radius: 2px;
    /* Police plus fine (était 700) */
    font-weight: 500; 
    border: 1px solid var(--gold-primary, #D4AF37);
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(212, 175, 55, 0.15); /* Ombre plus subtile */
}

.btn-nav2:hover {
    background: transparent;
    color: var(--gold-primary, #D4AF37) !important;
    /* Petit effet de levier sans trop bouger */
    transform: translateY(-1px); 
}

/* Burger Menu (Caché sur Desktop) */
.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--gold-primary, #D4AF37);
    margin: 5px;
    transition: all 0.3s ease;
}

/* --- Responsive Mobile Corrigé --- */
@media screen and (max-width: 768px) {
    
    /* 1. La Barre de Navigation (Navbar) */
    .navbar {
        padding: 8px 0; /* Réduit pour gagner de la hauteur */
    }

    .logo img {
        height: 50px; /* Logo plus petit sur mobile */
    }

    /* 2. Le Conteneur du Menu (Le panneau latéral) */
    .nav-links {
        position: absolute;
        right: 0px;
        top: 0px;
        height: 100vh;
        background-color: #1A1A1A;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
        padding-top: 5px;
        border-left: 1px solid rgba(212, 175, 55, 0.2);
    }

    .nav-links.nav-active {
        transform: translateX(0%);
    }

    /* 3. Les Éléments de la liste (LI) */
    .nav-links li {
        margin: 12px 0; /* ESPACEMENT RÉDUIT (était 20px) */
        opacity: 0;
    }

    /* Animation des liens */
    @keyframes navLinkFade {
        from { opacity: 0; transform: translateX(50px); }
        to { opacity: 1; transform: translateX(0); }
    }

    /* 4. Liens texte standards (non-boutons) */
    .nav-links a:not(.btn-nav):not(.btn-nav2) {
        font-size: 1.2rem;
        color: #E0E0E0;
    }

    /* 5. RESET DES BOUTONS (Style par défaut en mobile) */
    /* S'applique à .btn-nav et .btn-nav2 SAUF si ils sont .active */
    .nav-links .btn-nav, 
    .nav-links .btn-nav2 {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #E0E0E0 !important;
        font-weight: 500;
        font-size: 1.2rem;
        padding: 10px 20px; /* Padding de base harmonisé */
        width: auto;
        text-align: center;
    }

    /* 6. EXCEPTION : Le bouton "Primaire" (ex: Démarrer un audit) 
       On lui garde un style distinct même s'il n'est pas actif */
    .nav-links .btn-nav2:not(.active) {
        color: var(--gold-primary, #D4AF37) !important;
        border: 1px solid var(--gold-primary, #D4AF37) !important;
        background: rgba(212, 175, 55, 0.05) !important;
        font-weight: 600;
    }

    /* 7. STYLE DU BOUTON ACTIF (La correction demandée) */
    /* S'applique quand la classe .active est présente */
    .nav-links a.btn-nav.active,
    .nav-links a.btn-nav2.active,
    .nav-links li.active a.btn-nav,
    .nav-links li.active a.btn-nav2 {
        background: rgba(212, 175, 55, 0.15) !important; /* Fond doré léger */
        color: var(--gold-primary, #D4AF37) !important; /* Texte doré */
        border: 1px solid var(--gold-primary, #D4AF37) !important; /* Bordure dorée */
        font-weight: 600 !important;
        padding: 10px 20px !important; /* PADDING CORRIGÉ pour ne pas coller au texte */
        border-radius: 4px;
        box-shadow: none !important;
    }

    /* 8. Le Burger Menu */
    .burger {
        display: block;
        position: relative;
        z-index: 3000;
    }
    
    .toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
    .toggle .line2 { opacity: 0; }
    .toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); }
}