/* ============================================================
   Hub Navigation — Sidebar + Topbar (uses --lp-* CSS variables)
   ============================================================ */

/* ── Sidebar ── */
.hub-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: #111113;
    border-right: 1px solid #27272a;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
[data-theme="light"] .hub-sidebar {
    background: #fafbfc;
    border-right-color: #e8eaed;
}

/* Header / Brand */
.hub-sidebar-header {
    padding: 24px 20px 20px;
}
.hub-sidebar-brand {
    color: #f4f4f5;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}
.hub-sidebar-brand:hover { color: #fff; }
.hub-sidebar-brand i { color: var(--lp-accent, #3b82f6); font-size: 1.1rem; }
[data-theme="light"] .hub-sidebar-brand { color: #1a1a1a; }
[data-theme="light"] .hub-sidebar-brand:hover { color: #000; }

/* Nav list */
.hub-sidebar-nav {
    list-style: none;
    padding: 8px 10px;
    margin: 0;
    flex: 1;
}
.hub-sidebar-item {
    margin: 2px 0;
}
.hub-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #a1a1aa;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 400;
    border-radius: 8px;
}
.hub-sidebar-link:hover {
    background: #27272a;
    color: #f4f4f5;
}
.hub-sidebar-link.active {
    background: #27272a;
    color: #fff;
    font-weight: 500;
}
.hub-sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
}
.hub-sidebar-link.active i {
    opacity: 1;
    color: var(--lp-accent, #3b82f6);
}

[data-theme="light"] .hub-sidebar-link { color: #6b7280; }
[data-theme="light"] .hub-sidebar-link:hover { background: #f0f1f3; color: #1a1a1a; }
[data-theme="light"] .hub-sidebar-link.active { background: #f3f4f6; color: #1a1a1a; }
[data-theme="light"] .hub-sidebar-link.active i { color: #1a1a1a; }

/* Section divider */
.hub-sidebar-section {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #52525b;
    padding: 20px 14px 6px;
}
[data-theme="light"] .hub-sidebar-section { color: #9ca3af; }

/* Footer */
.hub-sidebar-footer {
    border-top: 1px solid #27272a;
    padding: 8px 10px;
}
[data-theme="light"] .hub-sidebar-footer { border-top-color: #e8eaed; }

.hub-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #a1a1aa;
    font-size: 0.8rem;
    font-weight: 400;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.hub-sidebar-user:hover { background: #27272a; color: #f4f4f5; }
[data-theme="light"] .hub-sidebar-user { color: #6b7280; }
[data-theme="light"] .hub-sidebar-user:hover { background: #f0f1f3; color: #1a1a1a; }

.hub-sidebar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.hub-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px 8px;
}
.hub-sidebar-actions button {
    flex: 1;
    background: none;
    border: 1px solid #27272a;
    color: #71717a;
    padding: 6px;
    border-radius: 8px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.hub-sidebar-actions button:hover {
    background: #27272a;
    color: #f4f4f5;
}
.hub-sidebar-actions .btn-logout:hover {
    background: rgba(239,68,68,0.15);
    color: #f87171;
    border-color: rgba(239,68,68,0.3);
}
[data-theme="light"] .hub-sidebar-actions button { border-color: #e8eaed; color: #9ca3af; }
[data-theme="light"] .hub-sidebar-actions button:hover { background: #f0f1f3; color: #1a1a1a; }
[data-theme="light"] .hub-sidebar-actions .btn-logout:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }

/* ── Topbar ── */
.hub-topbar {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    height: 52px;
    background: rgba(9,9,11,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #27272a;
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 999;
    transition: left 0.25s ease;
}
[data-theme="light"] .hub-topbar {
    background: rgba(255,255,255,0.85);
    border-bottom-color: #e8eaed;
}

.hub-topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--lp-text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 8px;
    margin-right: 12px;
    border-radius: 6px;
}
.hub-topbar-toggle:hover { background: rgba(255,255,255,0.05); }
[data-theme="light"] .hub-topbar-toggle:hover { background: #f3f4f6; }

.hub-topbar-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--lp-text-secondary);
}

/* ── Main Content ── */
.hub-main {
    margin-left: 240px;
    margin-top: 52px;
    padding: 32px;
    min-height: calc(100vh - 52px);
    transition: margin-left 0.25s ease;
}

/* ── Sidebar Overlay (mobile) ── */
.hub-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    backdrop-filter: blur(2px);
}
.hub-sidebar-overlay.active { display: block; }

/* ── Mobile ── */
@media (max-width: 992px) {
    .hub-sidebar {
        transform: translateX(-240px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }
    .hub-sidebar.mobile-open {
        transform: translateX(0);
    }
    .hub-topbar {
        left: 0;
    }
    .hub-topbar-toggle {
        display: block;
    }
    .hub-main {
        margin-left: 0;
    }
}
