/* =========================================================
   1kpips site.css (cleaned + normalized)
   - Keep _Layout clean: all styles live here
   - Dark theme tokens + glass UI
   - Navbar/offcanvas + hero + tables + EA cards
   - Normalized dark forms + code color + chart tokens
   ========================================================= */


/* =========================================================
   0) Theme tokens
   ========================================================= */
:root {
    /* Background / foreground */
    --bg0: #0b1020;
    --bg1: #0f1731;
    --fg0: #e9eefc;
    --fg1: #b8c3e6;
    /* Surfaces / borders */
    --line: rgba(255,255,255,.10);
    --glass: rgba(255,255,255,.06);
    /* Accents */
    --accent: #6ea8fe;
    --accent2: #7ee0c0;
    --focus: rgba(110,168,254,.45);
    /* Radius */
    --radius: 14px;
    --radius-sm: 12px;
    /* Code */
    --code: rgba(255,74,162,.95);
    /* Charts (for Chart.js grid/ticks) */
    --chart-grid: rgba(255,255,255,.14);
    --chart-tick: rgba(233,238,252,.70);
    --chart-border: rgba(255,255,255,.16);
}


/* =========================================================
   1) Base
   ========================================================= */
body {
    background: radial-gradient(1200px 700px at 15% 10%, rgba(110,168,254,.20), transparent 55%), radial-gradient(900px 600px at 85% 15%, rgba(126,224,192,.16), transparent 50%), linear-gradient(180deg, var(--bg0), var(--bg1));
    color: var(--fg0);
    font-variant-numeric: tabular-nums;
}

/* Fixed navbar offset (used by _Layout main) */
.app-main {
    padding-top: 60px;
}

.muted {
    color: var(--fg1);
}

.text-muted {
    color: var(--fg1) !important;
}

/* Links */
a {
    color: var(--fg1);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255,255,255,.25);
}

    a:hover {
        color: #fff;
        text-decoration-color: rgba(255,255,255,.55);
    }

/* Links in small-link blocks */
.small-link a {
    color: var(--fg1);
    text-decoration: none;
}

    .small-link a:hover {
        color: #fff;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

/* Focus visibility */
:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Inline code */
code {
    color: var(--code);
}


/* =========================================================
   2) Navbar (modern)
   Requires classes:
   - .app-navbar on <nav>
   - .app-offcanvas on offcanvas
   - .nav-modern on <ul>
   - .nav-ico + .nav-auth in items
   ========================================================= */
.app-navbar {
    background: rgba(11,16,32,.72);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.brand-chip {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
}

    .brand-chip img {
        height: 22px;
        display: block;
    }

.brand-pill {
    margin-left: .5rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    color: rgba(233,238,252,.78);
    background: rgba(110,168,254,.10);
    border: 1px solid rgba(110,168,254,.18);
    white-space: nowrap;
}

/* Desktop nav alignment */
.nav-modern {
    gap: .35rem;
}

    .nav-modern .nav-link {
        height: 40px;
        padding: .45rem .70rem;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        gap: .55rem;
        line-height: 1;
        color: rgba(233,238,252,.82);
        text-decoration: none;
        transition: background .14s ease, color .14s ease;
    }

        .nav-modern .nav-link:hover {
            background: rgba(255,255,255,.06);
            color: #fff;
        }
        /* Optional active state (set aria-current="page") */
        .nav-modern .nav-link[aria-current="page"] {
            background: rgba(110,168,254,.14);
            border: 1px solid rgba(110,168,254,.22);
            color: #fff;
        }

/* Icon chip */
.nav-ico {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.10);
    color: var(--accent);
    flex: 0 0 auto;
}

    .nav-ico i {
        font-size: 1.0rem;
        line-height: 1;
    }

/* Separator (desktop only) */
.nav-sep {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: var(--line);
}

/* Button pills in navbar */
.btn-pill {
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    padding: 0 .95rem;
}


/* =========================================================
   3) Offcanvas (mobile)
   - full height
   - consistent padding X
   - nav items have equal width
   ========================================================= */
.app-offcanvas {
    background: linear-gradient(180deg, var(--bg0), var(--bg1)) !important;
    border-left: 1px solid var(--line);
}

@media (max-width: 991.98px) {
    .app-offcanvas.offcanvas {
        width: 320px;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .app-offcanvas .offcanvas-header {
        padding: 1rem 1rem;
        border-bottom: 1px solid var(--line);
    }

    .app-offcanvas .offcanvas-body {
        padding: 1rem 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    .nav-modern {
        width: 100%;
        gap: .50rem;
    }

        .nav-modern .nav-link {
            width: 100%;
            height: 52px;
            padding: .80rem .90rem;
            border-radius: 16px;
            justify-content: flex-start;
        }

    .nav-ico {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    /* Auth section: keep same width + spacing */
    .nav-auth {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--line);
    }

        .nav-auth form {
            width: 100%;
        }

        .nav-auth .btn,
        .nav-auth .nav-link {
            width: 100%;
            height: 52px;
            padding: .80rem .90rem;
            border-radius: 16px;
            justify-content: flex-start;
            text-align: left;
        }

        .nav-auth .btn-outline-light {
            background: rgba(255,255,255,.03);
            border-color: rgba(255,255,255,.18);
        }

    .nav-sep {
        display: none;
    }

    .brand-pill {
        display: none;
    }
}


/* =========================================================
   4) Hero
   ========================================================= */
.hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

    .hero::before {
        content: "";
        position: absolute;
        inset: -1px;
        background: radial-gradient(800px 400px at 20% 10%, rgba(110,168,254,.18), transparent 60%), radial-gradient(700px 350px at 80% 25%, rgba(126,224,192,.14), transparent 55%);
        pointer-events: none;
    }

.hero-inner {
    position: relative;
    padding: 52px 10px 52px;
}

.lead {
    color: var(--fg1);
}

/* Accent badge */
.badge-soft {
    background: rgba(110,168,254,.18);
    border: 1px solid rgba(110,168,254,.30);
    color: #d8e6ff;
    font-weight: 700;
}


/* =========================================================
   5) Components
   ========================================================= */
.card-glass {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.placeholder-box {
    border: 1px dashed rgba(255,255,255,.18);
    background: rgba(255,255,255,.03);
    border-radius: .75rem;
    padding: 14px;
    color: rgba(233,238,252,.78);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem .55rem;
    border-radius: 999px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--line);
    color: var(--fg0);
    font-size: .85rem;
    white-space: nowrap;
}

    .pill.up {
        border-color: rgba(126,224,192,.35);
        background: rgba(126,224,192,.08);
    }

    .pill.down {
        border-color: rgba(255,99,132,.35);
        background: rgba(255,99,132,.08);
    }

    .pill.flat {
        border-color: rgba(110,168,254,.30);
        background: rgba(110,168,254,.08);
    }

.btn-accent {
    background: linear-gradient(90deg, rgba(110,168,254,.95), rgba(126,224,192,.85));
    border: 0;
    color: #0b1020;
    font-weight: 800;
}

.btn-outline-light {
    border-color: rgba(255,255,255,.22);
}

    .btn-outline-light:hover {
        background: rgba(255,255,255,.08);
        border-color: rgba(255,255,255,.28);
    }

.font-lg {
    font-size: 1.2em;
}


/* =========================================================
   6) Forms (dark, site-wide)
   ========================================================= */
.form-label {
    color: rgba(255,255,255,.85);
}

.form-control,
.form-select,
.form-control:disabled,
.form-select:disabled {
    background: rgba(0,0,0,.30);
    color: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.18);
}

    .form-control::placeholder {
        color: rgba(255,255,255,.45);
    }

    .form-control:focus,
    .form-select:focus {
        background: rgba(0,0,0,.40);
        color: rgba(255,255,255,.96);
        border-color: rgba(255,255,255,.30);
        box-shadow: 0 0 0 .2rem rgba(255,255,255,.08);
    }

/* Autofill (Chrome) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: rgba(255,255,255,.92);
    -webkit-box-shadow: 0 0 0px 1000px rgba(0,0,0,.35) inset;
    transition: background-color 9999s ease-out 0s;
}


/* =========================================================
   7) KPI bar
   ========================================================= */
.mini-kpi {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.03);
}

.kpi {
    padding: 18px 0;
}

    .kpi .label {
        color: var(--fg1);
        font-size: .9rem;
    }

    .kpi .value {
        font-size: 1.15rem;
        font-weight: 800;
    }

.section-title {
    font-weight: 800;
    letter-spacing: .2px;
}


/* =========================================================
   8) Tables
   ========================================================= */
.table thead th {
    color: rgba(233,238,252,.88);
    font-weight: 700;
    font-size: .85rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.table tbody td,
.table tbody th {
    color: rgba(233,238,252,.92);
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    border-top: 0 !important;
    border-bottom: 0 !important;
}

/* Dark glass table wrapper */
.table-darkglass {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: var(--radius);
    overflow: hidden;
}

    .table-darkglass .table {
        margin-bottom: 0;
        background: transparent !important;
        border-collapse: separate;
        border-spacing: 0;
    }

        .table-darkglass .table > :not(caption) > * > * {
            background: transparent !important;
        }

    .table-darkglass thead th {
        background: rgba(255,255,255,.06) !important;
        border-bottom: 1px solid rgba(255,255,255,.12) !important;
    }

    .table-darkglass tbody tr {
        background: rgba(255,255,255,.02);
        transition: background .12s ease;
    }

        .table-darkglass tbody tr:nth-child(even) {
            background: rgba(255,255,255,.035);
        }

        .table-darkglass tbody tr:hover {
            background: rgba(110,168,254,.10);
        }

    .table-darkglass a {
        color: rgba(216,230,255,.92);
        text-decoration: none;
    }

        .table-darkglass a:hover {
            color: #fff;
            text-decoration: underline;
            text-underline-offset: 3px;
        }

    .table-darkglass .pill {
        background: rgba(255,255,255,.06);
        border: 1px solid rgba(255,255,255,.12);
    }

    .table-darkglass .table-responsive {
        margin: 0;
    }


/* =========================================================
   9) Footer
   ========================================================= */
footer {
    border-top: 1px solid var(--line);
    background: rgba(11,16,32,.55);
}

.disclaimer {
    color: rgba(233,238,252,.72);
    font-size: .9rem;
    line-height: 1.6;
}


/* =========================================================
   10) EA cards
   ========================================================= */
.ea-card {
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius);
    color: #e5e7eb;
}

    .ea-card .ea-title a {
        color: #d8e6ff;
        text-decoration: none;
        font-weight: 700;
    }

        .ea-card .ea-title a:hover {
            color: #fff;
            text-decoration: underline;
            text-underline-offset: 3px;
        }

    .ea-card .ea-meta {
        color: rgba(233,238,252,.70);
        font-size: .85rem;
    }

    .ea-card .ea-kpi {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: .25rem .75rem;
        align-items: center;
        margin-top: .5rem;
        font-size: .92rem;
    }

        .ea-card .ea-kpi .label {
            color: rgba(233,238,252,.72);
        }

        .ea-card .ea-kpi .value {
            color: var(--fg0);
            text-align: right;
            font-variant-numeric: tabular-nums;
        }

    .ea-card .ea-footer {
        color: rgba(233,238,252,.65);
        border-top: 1px solid rgba(255,255,255,.10);
        background: rgba(255,255,255,.03);
    }

    .ea-card .text-muted {
        color: rgba(233,238,252,.65) !important;
    }


/* =========================================================
   11) Backtest badges (reusable, not page-scoped)
   - Use these in your Razor instead of Bootstrap text-bg-*
   ========================================================= */
.badge-neutral {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.88);
    font-weight: 700;
}

.badge-pf-good {
    background: rgba(25,135,84,.25);
    border: 1px solid rgba(25,135,84,.35);
}

.badge-pf-mid {
    background: rgba(13,110,253,.25);
    border: 1px solid rgba(13,110,253,.35);
}

.badge-pf-warn {
    background: rgba(255,193,7,.20);
    border: 1px solid rgba(255,193,7,.35);
    color: rgba(255,255,255,.92);
}

.badge-pf-bad {
    background: rgba(108,117,125,.25);
    border: 1px solid rgba(108,117,125,.35);
}

.badge-dd-good {
    background: rgba(25,135,84,.25);
    border: 1px solid rgba(25,135,84,.35);
}

.badge-dd-mid {
    background: rgba(13,110,253,.25);
    border: 1px solid rgba(13,110,253,.35);
}

.badge-dd-warn {
    background: rgba(255,193,7,.20);
    border: 1px solid rgba(255,193,7,.35);
    color: rgba(255,255,255,.92);
}

.badge-dd-bad {
    background: rgba(108,117,125,.25);
    border: 1px solid rgba(108,117,125,.35);
}


/* =========================================================
   12) Optional quality-of-life
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
