/* ============================================================
   Shared sidebar navigation (nav.js builds the markup)
   Self-contained: does not rely on screener.css being loaded.
   ============================================================ */

:root {
    --sb-w: 250px;
}

/* Retire the old per-page navs — the sidebar replaces them everywhere */
.top-nav,
.header-nav {
    display: none !important;
}

/* ---- Hamburger toggle (injected at the start of the page header) ---- */
.nav-toggle {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    min-width: 40px;
    margin-right: 12px;
    padding: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s, border-color 0.2s;
}
.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}
.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #c7cbda;
    transition: transform 0.25s, opacity 0.2s;
}
body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}
body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---- Sidebar panel ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sb-w);
    z-index: 220;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0c0f1d 0%, #0a0b14 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 18px 0 50px -30px rgba(0, 0, 0, 0.9);
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
body.nav-open .sidebar {
    transform: none;
}
body.nav-noanim .sidebar {
    transition: none;
}

.sb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sb-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: #e8eaf2;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
}
.sb-mark {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
}
.sb-title b {
    color: #8b5cf6;
}
/* Sidebar clickables never underline on hover/focus, and the brand keeps a
   steady colour — hovering ScalperSense must not recolour "Scalper". */
.sidebar a:hover,
.sidebar a:focus {
    text-decoration: none;
}
.sb-brand:hover,
.sb-brand:focus {
    color: #e8eaf2;
}
.sb-brand:hover .sb-title b,
.sb-brand:focus .sb-title b {
    color: #8b5cf6;
}
.sb-close {
    background: transparent;
    border: 0;
    color: #8a8fa3;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    transition: 0.2s;
}
.sb-close:hover {
    color: #e8eaf2;
    background: rgba(255, 255, 255, 0.06);
}

.sb-nav {
    flex: 1;
    padding: 12px 12px 6px;
}

/* ---- Featured flagship entry: Scalper Pro ---- */
.sb-featured {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 12px;
    margin: 2px 2px 16px;
    border-radius: 14px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(120% 180% at 0% 0%, rgba(249, 115, 22, 0.28), transparent 60%),
        linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(139, 92, 246, 0.16));
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.16);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.sb-featured::after {
    /* animated sheen sweep */
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: skewX(-18deg);
    animation: sbSheen 5.5s ease-in-out infinite;
}
@keyframes sbSheen {
    0%, 65% { left: -60%; }
    100% { left: 130%; }
}
.sb-featured:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 10px 26px rgba(249, 115, 22, 0.28);
}
.sb-featured.active {
    border-color: rgba(245, 158, 11, 0.8);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.sb-feat-ico {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--amber, #f5b651), #f97316);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}
.sb-feat-txt {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    flex: 1 1 auto;
    min-width: 0;
}
.sb-feat-txt b {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
}
.sb-feat-txt small {
    font-size: 11px;
    color: #d9c3a6;
    font-weight: 600;
}
.sb-feat-badge {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #1a1205;
    padding: 3px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--amber, #f5b651), #f97316);
}
.sb-group {
    margin-bottom: 14px;
}
.sb-glabel {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5a5f72;
    font-weight: 700;
    padding: 6px 10px 4px;
}
.sb-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 11px;
    color: #b6bacb;
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    position: relative;
    transition: background 0.15s, color 0.15s;
}
.sb-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e8eaf2;
}
.sb-ico {
    width: 22px;
    text-align: center;
    font-size: 15px;
    flex: 0 0 auto;
}
.sb-link.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.05));
    color: #fff;
}
.sb-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
}
.sb-foot {
    padding: 12px 18px 18px;
    font-size: 11.5px;
    color: #5a5f72;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sb-foot-clock {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sb-clock-day {
    font-size: 11px;
    color: #7c8296;
    letter-spacing: 0.02em;
}

.sb-clock-time {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 700;
    color: #c9ccd8;
    font-variant-numeric: tabular-nums;
}

/* ---- Backdrop (overlay mode on narrow screens) ---- */
.nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 210;
    background: rgba(6, 7, 14, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.26s, visibility 0.26s;
}

/* ---- Desktop: push page content to the right when open ---- */
@media (min-width: 1100px) {
    body {
        transition: padding-left 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body.nav-open {
        padding-left: var(--sb-w);
    }
    body.nav-noanim {
        transition: none;
    }
    /* Locked-open pages (e.g. News): no close affordances on desktop. */
    body[data-nav-lock] .sb-close,
    body[data-nav-lock] .nav-toggle {
        display: none;
    }
}

/* ---- Narrow: overlay above content with a backdrop ---- */
@media (max-width: 1099px) {
    .sidebar {
        width: min(284px, 84vw);
    }
    body.nav-open .nav-backdrop {
        opacity: 1;
        visibility: visible;
    }
}

/* ---------------------------------------------------------------------------
   Visually hidden, still announced.
   The option chain's own heading is the chrome — brand, index picker, live
   price — none of which is a page title a screen reader or a crawler can use.
   This gives the document the <h1> it needs without adding a redundant line of
   text above an already dense trading grid.
   Clip-based rather than display:none or visibility:hidden, both of which take
   the element out of the accessibility tree entirely, which would defeat it.
--------------------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
