/* =============================================================
   LONGLAST LABS — SHARED NAVBAR COMPONENT
   Used by: labs, use-cases, apex, intelligence, explore-intelligence,
   mrvl-documentation, quant-model.
   Self-sufficient: safe on pages that do not load style.css.
   On pages that do load style.css, link this file AFTER it.

   Variants (combine on the <nav> element):
     .labs-nav                 dark floating pill (default, 70px, fixed)
     .labs-nav.inverted        light-background styling
     .labs-nav--compact        smaller bar for doc/dashboard pages
     .labs-nav--static         in-flow instead of fixed (sits above page topbars)
   ============================================================= */

.labs-nav,
.labs-nav *,
.mobile-sidebar,
.mobile-sidebar * {
    box-sizing: border-box;
}

.labs-nav {
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 0.5rem 0 1.5rem;
    height: 70px;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 96%;
    max-width: 1600px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    z-index: 9999;
    margin: 0;
    transition: background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

/* Light mode (toggled by scroll inversion on labs, or set statically) */
.labs-nav.inverted {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Branding */
.labs-nav .logo-container {
    display: flex;
    align-items: center;
}

.labs-nav .logo-container a {
    background: transparent;
    border: none;
    padding: 0;
    transition: all 0.6s ease;
}

.labs-nav .nav-logo {
    /* Mark sits slightly smaller than the 1.05rem wordmark text */
    height: 15px;
    width: auto;
    border-radius: 0;
    transition: filter 0.6s ease;
}

.labs-nav.inverted .nav-logo {
    filter: invert(1) grayscale(100%) contrast(200%);
}

.labs-nav .logo-text {
    font-family: 'Satoshi', 'General Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.05em;
    line-height: 1;
    color: #ffffff;
    transition: color 0.6s ease;
}

.labs-nav.inverted .logo-text {
    color: #111111;
}

/* Links */
.labs-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.labs-nav .nav-links {
    display: flex;
    gap: 0.4rem;
}

.labs-nav .nav-links a {
    font-family: 'Satoshi', 'General Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.4s ease;
}

.labs-nav .nav-links a:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.labs-nav .nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.labs-nav.inverted .nav-links a {
    color: rgba(0, 0, 0, 0.6);
    border-color: rgba(0, 0, 0, 0.08);
    background: transparent;
}

.labs-nav.inverted .nav-links a:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.2);
    color: #111111;
}

.labs-nav.inverted .nav-links a.active {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.3);
    color: #111111;
}

/* Control pod (hamburger) */
.labs-nav .labs-control-pod {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    height: 40px;
    overflow: hidden;
    transition: all 0.6s ease;
}

.labs-nav.inverted .labs-control-pod {
    background: #ffffff;
    border-color: #d1d1d1;
}

.labs-nav .pod-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ffffff;
    transition: background 0.2s ease, color 0.6s ease;
    padding: 0;
}

.labs-nav.inverted .pod-icon {
    color: #111111;
}

.labs-nav .pod-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.labs-nav.inverted .pod-icon:hover {
    background: #f4f4f4;
}

.labs-nav .labs-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.labs-nav .labs-hamburger span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: currentColor;
    box-shadow: none;
}

/* --- COMPACT VARIANT (doc / dashboard pages) --- */
.labs-nav--compact {
    height: 54px;
    padding: 0 0.4rem 0 1.1rem;
    border-radius: 6px;
}

.labs-nav--compact .logo-text {
    font-size: 0.95rem;
}

.labs-nav--compact .nav-links a {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.labs-nav--compact .labs-control-pod {
    height: 34px;
}

.labs-nav--compact .pod-icon {
    width: 38px;
}

/* --- MOBILE --- */
@media (max-width: 900px) {
    .labs-nav .nav-links {
        display: none;
    }

    .labs-nav {
        padding: 0 0.5rem 0 1.2rem;
        height: 52px;
    }

    .labs-nav .nav-actions {
        gap: 0;
    }
}

/* =============================================================
   MOBILE SIDEBAR (shared with the navbar)
   ============================================================= */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    /* Above the fixed navbar so the open menu covers it */
    z-index: 10001;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 2rem;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.mobile-sidebar.active {
    right: 0;
}

.mobile-sidebar .logo-text {
    font-family: 'Satoshi', 'General Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-transform: none;
    color: #ffffff;
}

/* Scoped under .mobile-sidebar — several workspace pages define their own
   .sidebar-header / .sidebar-link classes for in-page sidebars */
.mobile-sidebar .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.mobile-sidebar .close-sidebar {
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    color: rgba(255, 255, 255, 0.6);
}

.mobile-sidebar .sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-sidebar .sidebar-links a {
    font-family: 'Satoshi', 'General Sans', sans-serif;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

/* =============================================================
   WORKSPACE TOPBAR HELPERS (breadcrumb links on doc/dashboard pages)
   ============================================================= */
.topbar .breadcrumb a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.topbar .breadcrumb a:hover {
    color: var(--text-main, #0f172a);
    text-decoration: underline;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    /* Dim everything including the navbar; sits just under the sidebar */
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}
