/* ======================================================================
   Market Overview - homepage at "/". Dark terminal aesthetic shared with
   whale-pages.css (same palette: #0f172a bg, #94a3b8 muted, var(--tt-up) up,
   var(--tt-down) down, #f59e0b amber, #22d3ee cyan accent).
   ====================================================================== */

.mo-wrap {
    max-width: 1400px; /* wide enough for all 15 Spot+Derivatives columns on desktop; table-wrap scrolls below this */
    margin: 0 auto;
    padding: 10px 16px 48px;
    margin-top: 50px;
}

/* ── Hero: one compact line ─────────────────────────────────────── */
.mo-hero {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 2px 12px;
}
.mo-hero h1 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0;
    letter-spacing: 0.2px;
}
.mo-hero .mo-sub {
    font-size: 0.68rem;
    color: #64748b;
    margin: 0;
}

/* ── Stat tiles ─────────────────────────────────────────────────── */
.mo-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 8px;
    margin: 0 0 14px;
}
.mo-stat {
    background: var(--tt-panel-grad);
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    padding: 9px 12px 8px;
    min-width: 0;
    box-shadow: var(--tt-shadow);
}
.mo-stat-label {
    font-size: 0.56rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.6px;
    margin-bottom: 3px;
    white-space: nowrap;
}
.mo-stat-value {
    font-size: 1rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    color: #f1f5f9;
    line-height: 1.15;
    white-space: nowrap;
}
.mo-stat-delta {
    font-size: 0.62rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    margin-top: 2px;
}
.mo-stat.mo-regime-on {
    background: linear-gradient(180deg, rgba(34,197,94,0.14), rgba(34,197,94,0.05));
    border-color: rgba(34,197,94,0.4);
}
.mo-stat.mo-regime-on .mo-stat-value { color: var(--tt-up); }
.mo-stat.mo-regime-off {
    background: linear-gradient(180deg, rgba(239,68,68,0.14), rgba(239,68,68,0.05));
    border-color: rgba(239,68,68,0.4);
}
.mo-stat.mo-regime-off .mo-stat-value { color: var(--tt-down); }

.mo-up { color: var(--tt-up) !important; }
.mo-down { color: var(--tt-down) !important; }

/* ── Warming-up fallback strip (no fake rows) ──────────────────────── */
.mo-warming {
    text-align: center;
    padding: 14px;
    font-size: 0.75rem;
    color: #64748b;
    background: rgba(31,41,55,0.4);
    border: 1px dashed rgba(42,46,57,0.5);
    border-radius: 8px;
    margin-top: 8px;
}

/* ── Controls: tabs + search ────────────────────────────────────── */
.mo-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 8px;
}
.mo-tabs {
    display: flex;
    gap: 3px;
    background: var(--tt-input-bg);
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    padding: 3px;
}
.mo-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 5px 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.mo-tab:hover { color: #e2e8f0; }
.mo-tab.active {
    background: rgba(34,211,238,0.14);
    color: #67e8f9;
}
.mo-search {
    background: var(--tt-input-bg);
    border: 1px solid var(--tt-border);
    color: #e2e8f0;
    font-size: 0.72rem;
    padding: 6px 12px;
    border-radius: 8px;
    width: 200px;
    max-width: 100%;
}
.mo-search:focus { outline: none; border-color: rgba(34,211,238,0.45); }
.mo-search::placeholder { color: #64748b; }

/* ── Table ──────────────────────────────────────────────────────── */
.mo-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--tt-border);
    border-radius: 10px;
    background: var(--tt-panel-grad);
    box-shadow: var(--tt-shadow);
}
.mo-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1180px; /* 15 columns (Spot + Derivatives bands) — scrolls on mobile */
}
/* Grouped header bands (Spot / Derivatives) */
.mo-table thead .mo-group th {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    color: #64748b;
    text-transform: uppercase;
    border-bottom: 1px solid var(--tt-border);
    text-align: center;
    padding-bottom: 3px;
}
.mo-group .mo-group-spot { color: #94a3b8; }
.mo-group .mo-group-deriv { color: var(--tt-accent, #22d3ee); }
/* Sticky coin column on horizontal scroll (Coinglass pattern) */
.mo-table .mo-coin-col {
    position: sticky;
    left: 0;
    background: var(--tt-panel-solid, #161b26);
    z-index: 2;
}
.mo-table thead .mo-coin-col { z-index: 3; }
/* Sparkline cell */
.mo-spark { width: 72px; text-align: center; color: #64748b; }
.mo-spark-svg { display: inline-block; width: 64px; height: 22px; }
.mo-spark-svg.up { color: var(--tt-up, #22c55e); }
.mo-spark-svg.down { color: var(--tt-down, #ef4444); }
.mo-spark-svg svg { width: 64px; height: 22px; }
.mo-table thead th {
    font-size: 0.56rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--tt-border);
    background: var(--tt-panel-solid);
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.mo-table th.mo-sortable { cursor: pointer; user-select: none; }
.mo-table th.mo-sortable:hover { color: #cbd5e1; }
.mo-table th.mo-sort-active { color: var(--tt-accent, #22d3ee); }
.mo-table th .mo-sort-arrow { font-size: 0.5rem; margin-left: 2px; }
.mo-table td.num, .mo-table th.num { text-align: right; }
.mo-table th.mo-rank { width: 34px; }
.mo-table tbody tr {
    border-bottom: 1px solid var(--tt-border-soft);
    transition: background 0.15s;
}
.mo-table tbody tr:last-child { border-bottom: none; }
.mo-table tbody tr:hover { background: rgba(34,211,238,0.04); }
.mo-table td {
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    padding: 7px 10px;
    vertical-align: middle;
    color: #e2e8f0;
    white-space: nowrap;
}
.mo-table td.mo-rank { color: #475569; font-size: 0.62rem; }
.mo-table td.mo-dim { color: #64748b; }

/* 24h% change pill */
.mo-chg {
    display: inline-block;
    min-width: 58px;
    text-align: right;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 700;
    color: #64748b;
}
.mo-chg.mo-up { background: var(--tt-up-soft); }
.mo-chg.mo-down { background: var(--tt-down-soft); }

/* Whale-net diverging mini-bar (our column, make it pop) */
.mo-whale-cell {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}
.mo-bar {
    width: 46px;
    height: 5px;
    border-radius: 3px;
    background: var(--tt-border);
    overflow: hidden;
    display: inline-flex;
    justify-content: flex-start;
    flex: none;
}
.mo-bar > i {
    display: block;
    height: 100%;
    border-radius: 3px;
}
.mo-bar > i.up { background: var(--tt-up); }
.mo-bar > i.down { background: var(--tt-down); }

.mo-coin {
    display: flex;
    align-items: baseline;
    gap: 7px;
    text-decoration: none;
    min-width: 0;
}
.mo-coin .mo-sym { font-weight: 800; color: #f1f5f9; font-size: 0.74rem; }
.mo-coin .mo-name {
    color: #64748b;
    font-size: 0.62rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mo-coin:hover .mo-sym { color: var(--tt-accent, #22d3ee); }
.mo-live-dot {
    flex: none;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--tt-up);
    box-shadow: 0 0 4px rgba(34,197,94,0.7);
    align-self: center;
}

/* ── Row-refresh flash (30s poll) ──────────────────────────────────── */
@keyframes moFlash {
    0% { background: rgba(34,211,238,0.12); }
    100% { background: transparent; }
}
.mo-table tbody tr.mo-flash { animation: moFlash 1.2s ease-out; }

/* ── Footer / pagination ───────────────────────────────────────────── */
.mo-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    font-size: 0.62rem;
    color: #64748b;
}
.mo-page-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mo-page-btns button {
    background: rgba(31,41,55,0.6);
    border: 1px solid var(--tt-border);
    color: #cbd5e1;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.mo-page-btns button:disabled { opacity: 0.4; cursor: default; }
.mo-page-btns button:not(:disabled):hover {
    border-color: rgba(34,211,238,0.45);
    color: #f1f5f9;
}

@media (max-width: 1000px) {
    .mo-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .mo-stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .mo-stat { padding: 7px 10px; }
    .mo-search { width: 140px; }
}
