/* ═══════════════════════════════════════
   OPTIONS RESEARCH — LAYOUT & GRIDS
═══════════════════════════════════════ */

/* ── Base Tab Container ── */
#feed-options-profile {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    gap: 24px;
    box-sizing: border-box;

    /* Chart height tokens — used by .option-research-chart-card at each breakpoint */
    --chart-h-lg: 360px;
    --chart-h-md: 260px;
    --chart-h-sm: 210px;
}

#feed-options-profile.active {
    display: flex;
}

/* ── Main Content Shell ── */
#opt-content-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-height: 0;
}

.research-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    padding-bottom: 24px;
}

/* ── TOP HEADER ROW ── */
.opt-header-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    padding: 24px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

.opt-hero-area {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 160px;
    padding-right: 24px;
    border-right: 1px solid var(--border-light);
}

.opt-top-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    flex: 1;
}

/* ── BODY SPLIT (Charts Left, Details Right) ── */
/* Forces both columns to be equal height */
.opt-body-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: stretch;
}

/* Turns the left pane into a full-height flex column */
.opt-chart-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 24px;
    height: 74vh;
}

.opt-details-pane {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    height: 74vh;
    overflow: hidden;
}

/* Forces each card to expand equally to fill the height */
.opt-chart-pane .option-research-chart-card {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Chart Div Fill (flex child of .option-research-chart-card) ── */
#gex-strike-chart,
#dex-strike-chart,
#oi-strike-chart {
    flex: 1;
    min-height: 0;
    width: 100%;
    position: relative;
}

/* ── Empty & Loading States ── */
.opt-empty-state, .opt-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    text-align: center;
    gap: 16px;
}


/* ══════════════ RESPONSIVE ══════════════ */

/* ── 1440px: Laptops ── */
@media (max-width: 1440px) {
    .opt-header-row { gap: 24px; padding: 14px 20px; }
}

/* ── 1280px: Standard Laptops / Small Tablets ── */
@media (max-width: 1280px) {
    .opt-body-split {
        grid-template-columns: 1.5fr 1fr;
    }
}

/* ── 1100px: Tablets ── */
@media (max-width: 1100px) {
    .opt-body-split {
        display: flex;
        flex-direction: column;
        gap: 24px;
        align-items: stretch;
    }

    .opt-chart-pane {
        height: auto;
        min-height: 500px;
    }

    .opt-details-pane {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .opt-chart-pane .option-research-chart-card {
        flex: none;
        height: var(--chart-h-lg);
    }

    .opt-hero-area {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding-right: 0;
        padding-bottom: 16px;
        width: 100%;
    }
}

/* ── 768px: Mobile ── */
@media (max-width: 768px) {
    .opt-header-row {
        padding: 16px;
        gap: 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    .opt-hero-area {
        border-right: none;
        padding-right: 0;
        width: 100%;
    }
    .opt-top-metrics {
        gap: 12px;
        width: 100%;
    }
    /* Override inline min-width so tear-sheet fills full width */
    .opt-header-row .research-tear-sheet {
        min-width: 0 !important;
        width: 100%;
    }
    .opt-chart-pane .option-research-chart-card {
        height: var(--chart-h-md);
    }
    .research-content {
        padding-bottom: 80px;
    }
}

/* ── 480px: Small Mobile ── */
@media (max-width: 480px) {
    .opt-header-row { padding: 12px; gap: 12px; margin-bottom: 16px; }
    .opt-chart-pane { gap: 16px; }
    .opt-chart-pane .option-research-chart-card { height: var(--chart-h-sm); }
    #feed-options-profile { padding-bottom: 80px; }
}
