/**
 * ═══════════════════════════════════════════════════════════════════════
 * [AXION GEX] — OPTIONS FLOW COMMAND CENTER STYLES
 * ═══════════════════════════════════════════════════════════════════════
 *
 * Vectors: 121-140 (Derivatives Analytics)
 * Design: Dark institutional glassmorphism with container queries
 */

/* ─── ROOT CONTAINER ─── */
.gex-root {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    container-type: inline-size;
    container-name: gex;
    font-family: var(--mono, 'JetBrains Mono', monospace);
}

/* ─── KPI BAR ─── */
.gex-kpi-bar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.gex-kpi {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.gex-kpi:hover {
    border-color: rgba(198, 227, 16, 0.15);
    box-shadow: 0 0 20px rgba(198, 227, 16, 0.03);
}

.gex-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(198, 227, 16, 0.15), transparent);
}

.gex-kpi-label {
    font-size: 8px;
    letter-spacing: 1.5px;
    color: var(--t3, #555);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.gex-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--t1, #e0e0e0);
    line-height: 1;
    transition: color 0.3s ease;
}

.gex-kpi-sub {
    font-size: 8px;
    color: var(--t3, #555);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── CHARTS ROW ─── */
.gex-charts-row {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 8px;
}

/* ─── PANELS ─── */
.gex-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.gex-panel-wide { min-height: 360px; }
.gex-panel-narrow { min-height: 360px; display: flex; flex-direction: column; }

.gex-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.01);
}

.gex-panel-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--t2, #aaa);
    text-transform: uppercase;
}

.gex-panel-badge {
    font-size: 8px;
    font-weight: 700;
    padding: 2px 8px;
    background: rgba(198, 227, 16, 0.15);
    color: var(--lime, #c6e310);
    letter-spacing: 1px;
    border: 1px solid rgba(198, 227, 16, 0.2);
    transition: all 0.3s ease;
}

.gex-panel-sub {
    font-size: 9px;
    color: var(--t3, #555);
}

/* ─── CHART CONTAINER ─── */
.gex-chart-container {
    width: 100%;
    height: calc(100% - 42px);
    min-height: 300px;
}

/* ─── OFI GAUGE ─── */
.gex-ofi-gauge {
    padding: 20px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.gex-ofi-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.gex-ofi-bar-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.23, 1, 0.32, 1), background 0.3s ease;
    will-change: width;
}

.gex-ofi-labels {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: var(--t3, #555);
    letter-spacing: 1px;
}

.gex-ofi-bear { color: var(--coral, #ff2a55); }
.gex-ofi-bull { color: var(--lime, #c6e310); }
.gex-ofi-neutral { color: var(--t3, #555); }

.gex-ofi-value {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--t1, #e0e0e0);
    transition: color 0.3s ease;
}

/* ─── MINI SECTION (PCR) ─── */
.gex-mini-section {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.gex-mini-label {
    font-size: 8px;
    letter-spacing: 1.5px;
    color: var(--t3, #555);
    margin-bottom: 10px;
}

.gex-pcr-track {
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--lime, #c6e310), var(--amber, #ffb703), var(--coral, #ff2a55));
    border-radius: 0;
    position: relative;
}

.gex-pcr-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 14px;
    background: var(--t1, #e0e0e0);
    transform: translateX(-50%);
    transition: left 0.6s cubic-bezier(0.23, 1, 0.32, 1), background 0.3s ease;
    will-change: left;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.gex-pcr-labels {
    display: flex;
    justify-content: space-between;
    font-size: 7px;
    color: var(--t3, #555);
    margin-top: 4px;
}

/* ─── DARK POOL GRID ─── */
.gex-dp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
    padding: 10px 14px;
}

.gex-dp-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.gex-dp-card:hover {
    transform: translateY(-1px);
}

.gex-dp-buy {
    border-left: 2px solid var(--lime, #c6e310);
}

.gex-dp-buy:hover {
    border-color: rgba(198, 227, 16, 0.3);
}

.gex-dp-sell {
    border-left: 2px solid var(--coral, #ff2a55);
}

.gex-dp-sell:hover {
    border-color: rgba(255, 42, 85, 0.3);
}

.gex-dp-sym {
    font-size: 11px;
    font-weight: 700;
    color: var(--t1, #e0e0e0);
    margin-bottom: 4px;
}

.gex-dp-val {
    font-size: 14px;
    font-weight: 600;
}

.gex-dp-buy .gex-dp-val { color: var(--lime, #c6e310); }
.gex-dp-sell .gex-dp-val { color: var(--coral, #ff2a55); }

.gex-dp-meta {
    font-size: 8px;
    color: var(--t3, #555);
    margin-top: 4px;
}

.gex-dp-side {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 1px 6px;
}

.gex-dp-buy .gex-dp-side {
    background: rgba(198, 227, 16, 0.12);
    color: var(--lime, #c6e310);
}

.gex-dp-sell .gex-dp-side {
    background: rgba(255, 42, 85, 0.12);
    color: var(--coral, #ff2a55);
}

/* ─── FOOTER ─── */
.gex-footer {
    display: flex;
    justify-content: space-between;
    padding: 6px 14px;
    font-size: 8px;
    color: var(--t3, #555);
    letter-spacing: 1px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.gex-footer-mode {
    color: var(--amber, #ffb703);
}

/* ─── RESPONSIVE: CONTAINER QUERIES ─── */
@container gex (max-width: 1100px) {
    .gex-kpi-bar {
        grid-template-columns: repeat(4, 1fr);
    }
    .gex-charts-row {
        grid-template-columns: 1fr;
    }
}

@container gex (max-width: 768px) {
    .gex-kpi-bar {
        grid-template-columns: repeat(3, 1fr);
    }
    .gex-dp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gex-kpi-value {
        font-size: 16px;
    }
}

@container gex (max-width: 480px) {
    .gex-kpi-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .gex-dp-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── 8K SUPPORT ─── */
@media (min-width: 7680px) {
    .gex-kpi-value { font-size: 32px; }
    .gex-kpi-label { font-size: 12px; }
    .gex-panel-title { font-size: 14px; }
    .gex-dp-sym { font-size: 16px; }
    .gex-dp-val { font-size: 20px; }
}

/* ─── ANIMATIONS ─── */
@keyframes gex-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.gex-dp-card {
    animation: gex-pulse 3s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 150ms);
}

.gex-dp-card:nth-child(1) { --i: 0; }
.gex-dp-card:nth-child(2) { --i: 1; }
.gex-dp-card:nth-child(3) { --i: 2; }
.gex-dp-card:nth-child(4) { --i: 3; }
.gex-dp-card:nth-child(5) { --i: 4; }
.gex-dp-card:nth-child(6) { --i: 5; }
.gex-dp-card:nth-child(7) { --i: 6; }
.gex-dp-card:nth-child(8) { --i: 7; }

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
    .gex-dp-card { animation: none; }
    .gex-ofi-bar-fill,
    .gex-pcr-marker { transition-duration: 0s; }
}
