/* ================================================================
   TOS-Style Options Chain — Dedicated Stylesheet
   ================================================================
   Loaded automatically by Dash from the assets/ folder.
   All classes prefixed with "oc-" to avoid collisions.
   ================================================================ */

/* ── Controls row (centered single line) ─────────────────────── */

.oc-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

/* ── Column selector row ─────────────────────────────────────── */

.oc-col-selector-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.oc-col-selector-row > .filter-label {
    flex-shrink: 0;
    white-space: nowrap;
}

.oc-col-dropdown {
    flex: 1;
    min-width: 300px;
    max-width: 800px;
    font-size: 0.78rem;
}

/* Dark theme overrides for the multi-select dropdown */
.oc-col-dropdown .Select-control {
    background: rgba(10, 15, 28, 0.85) !important;
    border-color: rgba(0, 229, 160, 0.18) !important;
}

.oc-col-dropdown .Select-value {
    background: rgba(0, 229, 160, 0.12) !important;
    border-color: rgba(0, 229, 160, 0.25) !important;
    color: #c0d0e0 !important;
    font-size: 0.72rem;
}

.oc-col-dropdown .Select-value-icon:hover {
    color: #ff6b6b !important;
}

/* ── Page-level wrapper ──────────────────────────────────────── */

.oc-wrapper {
    width: 100%;
}

/* ── Quote bar ───────────────────────────────────────────────── */

.oc-quote-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.55rem 1rem;
    background: rgba(10, 15, 28, 0.85);
    border: 1px solid rgba(0, 229, 160, 0.12);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-family: Inter, sans-serif;
    font-size: 0.8rem;
    color: #c0cfe0;
}

.oc-qb-symbol {
    font-family: Orbitron, monospace;
    font-weight: 700;
    font-size: 0.92rem;
    color: #00e5a0;
    letter-spacing: 0.04em;
}

.oc-qb-desc {
    color: #7a8ba8;
    font-size: 0.75rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.oc-qb-last {
    font-weight: 700;
    font-size: 0.92rem;
    color: #e8ecf4;
    font-family: "JetBrains Mono", "Fira Code", monospace;
}

.oc-qb-change {
    font-weight: 600;
    font-size: 0.8rem;
    font-family: "JetBrains Mono", "Fira Code", monospace;
}

.oc-qb-up { color: #00e5a0; }
.oc-qb-down { color: #ff4d4d; }

.oc-qb-field {
    color: #8899aa;
    font-size: 0.74rem;
    font-family: "JetBrains Mono", "Fira Code", monospace;
}

/* ── Table scroll container ──────────────────────────────────── */

.oc-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(0, 229, 160, 0.10);
    border-radius: 6px;
}

/* ── Main table ──────────────────────────────────────────────── */

.oc-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
    font-size: 0.72rem;
    color: #d0dae8;
    table-layout: auto;
}

/* ── Side labels (CALLS / PUTS) ──────────────────────────────── */

.oc-side-labels-row {
    background: rgba(5, 10, 20, 0.95);
}

.oc-side-label {
    text-align: center;
    font-family: Orbitron, monospace;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 4px;
    border-bottom: 2px solid rgba(0, 229, 160, 0.15);
}

.oc-calls-label { color: #00e5a0; }
.oc-puts-label  { color: #ff6b6b; }

/* ── Column headers ──────────────────────────────────────────── */

.oc-col-hdr th {
    background: rgba(8, 12, 24, 0.95);
    color: #7a8ba8;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 6px;
    text-align: right;
    white-space: nowrap;
    border-bottom: 1px solid rgba(0, 229, 160, 0.10);
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.12s ease;
}

.oc-col-hdr th:hover {
    color: #c0d0e0;
}

.oc-strike-hdr {
    text-align: center !important;
    color: #e0c060 !important;
    font-weight: 700;
    background: rgba(15, 20, 35, 0.98) !important;
    padding: 5px 10px;
    border-left: 2px solid rgba(224, 192, 96, 0.25);
    border-right: 2px solid rgba(224, 192, 96, 0.25);
    cursor: default !important;
}

/* ── Sort indicators ─────────────────────────────────────────── */

.oc-col-hdr th.oc-sort-asc::after  { content: " \u25B2"; font-size: 0.55rem; color: #00e5a0; }
.oc-col-hdr th.oc-sort-desc::after { content: " \u25BC"; font-size: 0.55rem; color: #00e5a0; }

/* ── Expiration header rows ──────────────────────────────────── */

.oc-exp-header {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.oc-exp-header td {
    background: rgba(18, 25, 42, 0.95);
    color: #b0c4de;
    font-family: Orbitron, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 7px 12px;
    border-top: 1px solid rgba(0, 229, 160, 0.08);
    border-bottom: 1px solid rgba(0, 229, 160, 0.08);
    transition: background 0.15s ease;
}

.oc-exp-header:hover td {
    background: rgba(25, 35, 60, 0.95);
}

.oc-chevron {
    display: inline-block;
    width: 1.2em;
    font-size: 0.7rem;
    color: #00e5a0;
    transition: transform 0.2s ease;
}

/* ── Data rows ───────────────────────────────────────────────── */

.oc-exp-group .oc-data-row {
    display: none;
}

.oc-exp-group.oc-expanded .oc-data-row {
    display: table-row;
}

/* ── Data cells ──────────────────────────────────────────────── */

.oc-call-cell,
.oc-put-cell {
    text-align: right;
    padding: 3px 6px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.1s ease;
    background: rgba(10, 14, 26, 0.7);
}

.oc-strike-cell {
    text-align: center;
    font-weight: 700;
    color: #e0c060;
    background: rgba(15, 20, 35, 0.9);
    padding: 3px 10px;
    white-space: nowrap;
    border-left: 2px solid rgba(224, 192, 96, 0.20);
    border-right: 2px solid rgba(224, 192, 96, 0.20);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* ── ITM shading ─────────────────────────────────────────────── */

.oc-call-itm .oc-call-cell {
    background: rgba(75, 60, 140, 0.22);
}

.oc-put-itm .oc-put-cell {
    background: rgba(75, 60, 140, 0.22);
}

/* ── ATM row highlight ───────────────────────────────────────── */

.oc-atm-row .oc-strike-cell {
    background: rgba(224, 192, 96, 0.18);
    color: #ffd740;
    font-size: 0.78rem;
}

.oc-atm-row .oc-call-cell,
.oc-atm-row .oc-put-cell {
    border-top: 1px solid rgba(224, 192, 96, 0.25);
    border-bottom: 1px solid rgba(224, 192, 96, 0.25);
}

/* ── Hover highlight ─────────────────────────────────────────── */

.oc-data-row:hover .oc-call-cell,
.oc-data-row:hover .oc-put-cell,
.oc-data-row:hover .oc-strike-cell {
    filter: brightness(1.25);
}

/* ── Alternating row stripes ─────────────────────────────────── */

.oc-data-row:nth-child(even) .oc-call-cell:not(.oc-call-itm .oc-call-cell) {
    background: rgba(14, 18, 32, 0.7);
}

.oc-data-row:nth-child(even) .oc-put-cell:not(.oc-put-itm .oc-put-cell) {
    background: rgba(14, 18, 32, 0.7);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .oc-table {
        font-size: 0.65rem;
    }

    .oc-call-cell,
    .oc-put-cell {
        padding: 2px 3px;
    }

    .oc-strike-cell {
        padding: 2px 5px;
    }

    .oc-exp-header td {
        font-size: 0.65rem;
        padding: 6px 8px;
    }

    .oc-quote-bar {
        font-size: 0.72rem;
        gap: 0.4rem 0.8rem;
    }

    .oc-controls-row {
        justify-content: flex-start;
    }
}
