/* ============================================
   🧭 NAVIGATION GLOBALE & SIDEBAR
   Système de navigation contextuelle selon rôle
   ============================================ */

/* === TOPBAR GLOBALE === */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--glass-medium);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: 1000;
    box-shadow: var(--shadow-card);
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.topbar__logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-pure);
    text-decoration: none;
    transition: transform var(--duration-fast) var(--ease-premium);
}

.topbar__logo:hover {
    transform: scale(1.05);
}

.topbar__logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--cyan-electric), var(--bordeaux-deep));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* === SÉLECTEUR DE RÔLE === */
.role-selector {
    display: flex;
    gap: var(--space-sm);
    background: var(--glass-ultra);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    padding: var(--space-xs);
}

.role-selector__btn {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    background: transparent;
    color: var(--text-soft);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-smooth) var(--ease-premium);
    position: relative;
}

.role-selector__btn:hover {
    color: var(--text-pure);
}

.role-selector__btn.active {
    background: linear-gradient(135deg, var(--cyan-electric), #0088CC);
    color: var(--bg-absolute);
    box-shadow: var(--shadow-cyan);
}

.role-selector__btn.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--cyan-electric);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--cyan-glow);
}

/* === TOPBAR RIGHT (User Menu) === */
.topbar__right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.topbar__notifications {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--glass-light);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--duration-smooth) var(--ease-premium);
}

.topbar__notifications:hover {
    border-color: var(--cyan-electric);
    background: var(--glass-medium);
}

.topbar__notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--bordeaux-deep);
    border: 2px solid var(--bg-deep);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-pure);
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--glass-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-smooth) var(--ease-premium);
}

.topbar__user:hover {
    border-color: var(--cyan-electric);
    background: var(--glass-medium);
}

.topbar__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan-electric), var(--bordeaux-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.topbar__user-name {
    font-weight: 600;
    color: var(--text-pure);
}

/* === SIDEBAR CONTEXTUELLE === */
.sidebar {
    position: fixed;
    top: 72px;
    left: 0;
    width: 280px;
    height: calc(100vh - 72px);
    background: var(--glass-light);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    padding: var(--space-xl);
    overflow-y: auto;
    z-index: 900;
    transition: transform var(--duration-smooth) var(--ease-premium);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar__section {
    margin-bottom: var(--space-2xl);
}

.sidebar__title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-soft);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--duration-smooth) var(--ease-premium);
    position: relative;
}

.sidebar__link:hover {
    background: var(--glass-medium);
    color: var(--text-pure);
}

.sidebar__link.active {
    background: var(--cyan-light);
    color: var(--cyan-electric);
    font-weight: 600;
}

.sidebar__link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--cyan-electric);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px var(--cyan-glow);
}

.sidebar__link-icon {
    font-size: 1.25rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar__link-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--bordeaux-light);
    color: var(--bordeaux-deep);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

/* === MAIN CONTENT AREA === */
.main-content {
    margin-left: 280px;
    margin-top: 72px;
    padding: var(--space-2xl);
    min-height: calc(100vh - 72px);
    transition: margin-left var(--duration-smooth) var(--ease-premium);
}

.main-content.sidebar-collapsed {
    margin-left: 0;
}

/* === BREADCRUMBS === */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    font-size: 0.875rem;
}

.breadcrumbs__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-dim);
}

.breadcrumbs__item:last-child {
    color: var(--text-pure);
    font-weight: 600;
}

.breadcrumbs__separator {
    color: var(--text-dim);
}

/* === PAGE HEADER === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2xl);
}

.page-header__title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cyan-electric), var(--text-pure));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header__subtitle {
    font-size: 1.125rem;
    color: var(--text-soft);
    margin-top: var(--space-sm);
}

.page-header__actions {
    display: flex;
    gap: var(--space-md);
}

/* === HAMBURGER MENU (Mobile) === */
.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    background: var(--glass-light);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--duration-smooth) var(--ease-premium);
}

.hamburger__line {
    width: 20px;
    height: 2px;
    background: var(--text-pure);
    border-radius: 2px;
    transition: all var(--duration-smooth) var(--ease-premium);
}

.hamburger.active .hamburger__line:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.hamburger.active .hamburger__line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger__line:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .role-selector {
        display: none;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 var(--space-md);
    }
    
    .topbar__logo {
        font-size: 1rem;
    }
    
    .topbar__user-name {
        display: none;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .main-content {
        padding: var(--space-lg);
    }
    
    .page-header__title {
        font-size: 1.75rem;
    }
}

/* === ANIMATIONS === */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar__link {
    animation: slideIn var(--duration-smooth) var(--ease-premium) backwards;
}

.sidebar__link:nth-child(1) { animation-delay: 0.05s; }
.sidebar__link:nth-child(2) { animation-delay: 0.1s; }
.sidebar__link:nth-child(3) { animation-delay: 0.15s; }
.sidebar__link:nth-child(4) { animation-delay: 0.2s; }
.sidebar__link:nth-child(5) { animation-delay: 0.25s; }
.sidebar__link:nth-child(6) { animation-delay: 0.3s; }
.sidebar__link:nth-child(7) { animation-delay: 0.35s; }
.sidebar__link:nth-child(8) { animation-delay: 0.4s; }
