/* src/assets/styles/nav.css */
/* Sidebar-specific tokens — main.css owns the shared :root block */
:root {
    --nav-width: 260px;
    --nav-accent: #f39c12;
    --nav-input-bg: rgba(0, 0, 0, 0.3);
    /* --nav-bg, --nav-text, --nav-active re-exported from main.css as
       --sidebar-bg, --sidebar-text, --sidebar-active for cross-file consistency */
}

/* SIDEBAR CONTAINER */
.sidebar {
    width: var(--nav-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header img {
    height: 32px;
    margin-right: 10px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

/* USER CONTEXT WIDGET
   Class is nav-context in HTML — matched here to fix the silent styling gap */
.nav-context {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.context-group {
    margin-bottom: 12px;
}

.context-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--sidebar-text);
    margin-bottom: 4px;
    font-weight: 600;
}

/* Dark Theme Dropdowns */
.nav-select {
    width: 100%;
    background-color: var(--nav-input-bg);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.nav-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-select:focus {
    border-color: var(--nav-accent);
}

.nav-select option {
    background-color: var(--sidebar-bg);
    color: white;
}

/* NAVIGATION LIST */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.nav-item {
    cursor: pointer;
    padding: 12px 20px;
    border-left: 4px solid transparent;
    transition: background 0.2s, border-left 0.2s;
    font-size: 0.95rem;
}

.nav-item:hover {
    background-color: var(--sidebar-active);
}

/* Active State (controlled by JS) */
.nav-item.active {
    background-color: var(--sidebar-active);
    border-left-color: var(--nav-accent);
    font-weight: 600;
    color: #fff;
}

/* Module group accordion headers */
.nav-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 10px 20px;
    font-size: 0.78em;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.90);
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    border-left: 3px solid transparent;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.15s, border-left-color 0.15s;
}

.nav-group-header:first-child {
    border-top: none;
}

.nav-group-header:hover {
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
}

.nav-group-header.nav-group-open {
    border-left-color: var(--nav-accent);
    color: #fff;
}

.nav-group-label {
    flex: 1;
}

.nav-group-arrow {
    font-size: 0.75em;
    opacity: 0.7;
    transition: transform 0.15s;
}

/* Accordion item list */
.nav-group-items {
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.12);
}

.nav-group-items .nav-item {
    padding-left: 32px;
    font-size: 0.95em;
    border-left: 3px solid transparent;
}

/* FOOTER */
.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    text-align: center;
    color: var(--sidebar-text);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-footer a {
    color: var(--nav-accent);
    text-decoration: none;
}