/**
 * PYERCE - Navigation Menu CSS
 * Menu unifié responsive avec gestion des états (actif, désactivé, dropdown)
 */

/* ========== VARIABLES CSS ========== */
:root {
    --nav-bg: rgba(0, 0, 0, 0.95);
    --nav-bg-transparent: rgba(0, 0, 0, 0.7);
    --nav-height: 70px;
    --nav-text: #ffffff;
    --nav-text-hover: #2ecc71;
    --nav-text-active: #2ecc71;
    --nav-text-disabled: #666666;
    --nav-border: rgba(255, 255, 255, 0.1);
    --nav-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --nav-transition: all 0.3s ease;
    --dropdown-bg: rgba(0, 0, 0, 0.95);
    --dropdown-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --mobile-breakpoint: 768px;
}

/* ========== RESET & BASE ========== */
* {
    box-sizing: border-box;
}

/* ========== NAVIGATION PRINCIPALE ========== */
.main-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--nav-shadow);
    animation: slideInFromTop 0.5s ease-out;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

/* ========== BRAND/LOGO ========== */
.nav-brand {
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--nav-text);
    font-size: 1.5rem;
    font-weight: bold;
    transition: var(--nav-transition);
}

.brand-link:hover {
    color: var(--nav-text-hover);
    transform: scale(1.05);
}

.brand-link i {
    margin-right: 8px;
    font-size: 1.8rem;
    color: var(--nav-text-active);
}

/* État actif du logo */
/*
.brand-link.active {
    color: var(--nav-text-active);
    transform: scale(1.05);
}

.brand-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: var(--nav-text-active);
    border-radius: 2px;
}
*/

/* ========== MENU DESKTOP ========== */
.nav-menu {
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

/* ========== ITEMS DE NAVIGATION ========== */
.nav-item {
    position: relative;
    height: var(--nav-height);
    display: flex;
    align-items: center;
}

.nav-link, .disabled-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    color: var(--nav-text);
    text-decoration: none;
    transition: var(--nav-transition);
    font-weight: 500;
    border-radius: 4px;
    position: relative;
}

.nav-link:hover {
    color: var(--nav-text-hover);
    background: rgba(46, 204, 113, 0.1);
    transform: translateY(-2px);
}

.nav-link i {
    margin-right: 8px;
    font-size: 1.1rem;
}

.nav-link span {
    white-space: nowrap;
}

/* ========== ÉTAT ACTIF ========== */
.nav-item.active .nav-link {
    color: var(--nav-text-active);
    background: rgba(46, 204, 113, 0.2);
    font-weight: 600;
}

.nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: var(--nav-text-active);
    border-radius: 2px;
}

/* ========== ÉTAT DÉSACTIVÉ ========== */
.nav-item.disabled .disabled-link {
    color: var(--nav-text-disabled);
    cursor: not-allowed;
    opacity: 0.6;
}

.nav-item.disabled .disabled-link:hover {
    color: var(--nav-text-disabled);
    background: none;
    transform: none;
}

/* ========== BOUTON LOGOUT ========== */
.nav-item.logout-btn .nav-link {
    background: rgba(231, 76, 60, 0.9);
    margin-left: 15px;
}

.nav-item.logout-btn .nav-link:hover {
    background: rgba(231, 76, 60, 1);
    color: white;
}

/* ========== ITEM SÉPARÉ (Administration) ========== */
.nav-item.nav-separated {
    margin-left: 48px;
}

/* ========== DROPDOWN MENU ========== */
.nav-item.has-dropdown .dropdown-icon {
    margin-left: 5px;
    font-size: 0.8rem;
    transition: var(--nav-transition);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: var(--dropdown-bg);
    border-radius: 8px;
    box-shadow: var(--dropdown-shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--nav-transition);
    list-style: none;
    margin: 0;
    padding: 10px 0;
    z-index: 1001;
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-item.has-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-item {
    margin: 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--nav-text);
    text-decoration: none;
    transition: var(--nav-transition);
    font-size: 0.9rem;
}

.dropdown-link:hover {
    background: rgba(46, 204, 113, 0.2);
    color: var(--nav-text-hover);
}

.dropdown-link i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

/* ========== DROPDOWN ITEM ACTIF ========== */
.dropdown-item.active .dropdown-link {
    background: rgba(46, 204, 113, 0.3);
    color: var(--nav-text-active);
    font-weight: 600;
}

.dropdown-item.active .dropdown-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--nav-text-active);
    border-radius: 0 2px 2px 0;
}

/* ========== SÉPARATEUR DROPDOWN ========== */
.dropdown-divider {
    height: 1px;
    background: var(--nav-border);
    margin: 8px 15px;
    list-style: none;
}

/* ========== MENU HAMBURGER MOBILE ========== */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: var(--nav-text);
    margin: 3px 0;
    transition: var(--nav-transition);
    border-radius: 2px;
}

/* Animation hamburger */
.nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========== SPACER POUR MENU FIXE ========== */
.nav-spacer {
    height: var(--nav-height);
    width: 100%;
}

/* ========== RESPONSIVE MOBILE ========== */
@media screen and (max-width: 768px) {
    
    /* Afficher le hamburger */
    .nav-toggle {
        display: flex;
    }
    
    /* Cacher le menu desktop */
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--nav-bg);
        transform: translateX(-100%);
        transition: var(--nav-transition);
        overflow-y: auto;
        justify-content: flex-start;
        padding-top: 20px;
    }
    
    /* Menu mobile ouvert */
    .nav-menu.active {
        transform: translateX(0);
    }
    
    /* Liste mobile */
    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0 20px;
    }
    
    /* Items mobile */
    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--nav-border);
    }
    
    .nav-link, .disabled-link {
        width: 100%;
        padding: 20px;
        justify-content: flex-start;
        font-size: 1.1rem;
    }
    
    .nav-link i {
        margin-right: 15px;
        font-size: 1.2rem;
        width: 20px;
    }
    
    /* État actif mobile */
    .nav-item.active .nav-link::after {
        display: none;
    }
    
    .nav-item.active .nav-link {
        background: rgba(46, 204, 113, 0.3);
        border-left: 4px solid var(--nav-text-active);
    }
    
    /* Dropdown mobile */
    .dropdown-menu {
        position: static;
        background: rgba(255, 255, 255, 0.05);
        box-shadow: none;
        border: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-item.has-dropdown.dropdown-open .dropdown-menu {
        max-height: 300px;
    }
    
    .dropdown-link {
        padding: 15px 40px;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Dropdown item actif mobile */
    .dropdown-item.active .dropdown-link {
        background: rgba(46, 204, 113, 0.4);
        border-left: 4px solid var(--nav-text-active);
    }
    
    /* Séparateur mobile */
    .dropdown-divider {
        margin: 5px 20px;
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* Brand mobile */
    .brand-link {
        font-size: 1.3rem;
    }
    
    /* Bouton logout mobile */
    .nav-item.logout-btn .nav-link {
        margin-left: 0;
        background: rgba(231, 76, 60, 0.9);
        margin-top: 20px;
        border-radius: 8px;
    }

    /* Item séparé (Administration) mobile */
    .nav-item.nav-separated {
        margin-left: 0;
        margin-top: 15px;
        border-top: 1px solid var(--nav-border);
    }
}

/* ========== RESPONSIVE TABLET ========== */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-link {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .nav-link i {
        margin-right: 6px;
    }
}

/* ========== ANIMATIONS & TRANSITIONS ========== */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========== ACCESSIBILITÉ ========== */
.main-navigation {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.nav-link:focus,
.dropdown-link:focus,
.brand-link:focus {
    outline: 2px solid var(--nav-text-active);
    outline-offset: 2px;
}

.disabled-link {
    pointer-events: none;
}

/* ========== THÈME CLAIR (OPTIONNEL) ========== */
@media (prefers-color-scheme: light) {
    :root {
        --nav-bg: rgba(255, 255, 255, 0.95);
        --nav-text: #2c3e50;
        --nav-text-hover: #27ae60;
        --nav-text-active: #27ae60;
        --nav-text-disabled: #bdc3c7;
        --dropdown-bg: rgba(255, 255, 255, 0.95);
    }
    
    .hamburger-line {
        background: var(--nav-text);
    }
} 