/* ==========================================================================
   COLOSIAN MARKETS — MARKET DATA
   ========================================================================== */

.app-page {
    display: grid;
    gap: 0.7rem;
}

.app-page__header {
    display: none;
}

.app-page__body {
    display: grid;
    gap: 0.75rem;
}

.app-page__kicker {
    margin: 0;

    color:
        var(--color-text-muted);

    font-size: 0.8rem;

    text-transform: uppercase;

    letter-spacing: 0.1em;
}

.app-page__eyebrow,
.app-page__title,
.app-page__description {
    display: none;
}

/* ==========================================================================
   MARKET INDEX PAGE LAYOUT
   ========================================================================== */

.alpha500-page,
.alpha100-page {
    height: 100%;
    min-height: 0;

    display: grid;

    grid-template-rows:
        auto minmax(0, 1fr);

    gap: 0.7rem;

    overflow: hidden;
}

/* ==========================================================================
   TERMINAL CARD
   ========================================================================== */

.terminal-card {
    min-width: 0;

    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.022) 0%,
            rgba(255, 255, 255, 0.01) 100%);

    border:
        1px solid rgba(255, 255, 255, 0.045);

    border-radius: 18px;

    padding:
        0.9rem 1rem;

    box-sizing: border-box;

    box-shadow: none;
}

/* ==========================================================================
   INDEX STATS

   This section remains visible while the creator rows scroll.
   ========================================================================== */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 0.65rem;

    margin: 0;

    flex: 0 0 auto;
}

.stat-card__label {
    margin:
        0 0 0.35rem;

    color:
        var(--color-text-muted);

    font-size: 0.68rem;

    text-transform: uppercase;

    letter-spacing: 0.1em;
}

.stat-card__value {
    margin: 0;

    font-size: 1.22rem;

    line-height: 1.04;

    letter-spacing: -0.03em;
}

/* ==========================================================================
   MARKET TABLE CARD

   The card fills all remaining viewport height.
   The card header remains fixed.
   ========================================================================== */

.market-table-card {
    min-width: 0;
    min-height: 0;

    height: 100%;

    display: grid;

    grid-template-rows:
        auto minmax(0, 1fr);

    overflow: hidden;
}

.market-table-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    padding-bottom: 0.65rem;

    margin: 0;

    flex: 0 0 auto;

    background:
        transparent;
}

.market-table-card__title {
    margin: 0;

    font-size: 0.96rem;

    letter-spacing: -0.02em;

    font-weight: 650;
}

.market-table-card__meta {
    margin: 0;

    color:
        var(--color-text-muted);

    font-size: 0.76rem;

    white-space: nowrap;
}

/* ==========================================================================
   SCROLLING DATA REGION

   This is intentionally the only scrolling area on desktop.
   ========================================================================== */

.market-table-wrap {
    position: relative;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    overflow:
        auto;

    overscroll-behavior: contain;

    scrollbar-width: thin;

    scrollbar-gutter: stable;
}

.market-table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.market-table-wrap::-webkit-scrollbar-track {
    background:
        rgba(255, 255, 255, 0.015);
}

.market-table-wrap::-webkit-scrollbar-thumb {
    background:
        rgba(255, 255, 255, 0.12);

    border-radius: 999px;
}

/* ==========================================================================
   MARKET TABLE
   ========================================================================== */

.market-table {
    width: 100%;

    min-width: 1260px;

    border-collapse: separate;
    border-spacing: 0;

    table-layout: auto;
}

.market-table th,
.market-table td {
    padding:
        0.68rem 0.62rem;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.045);

    vertical-align: middle;

    font-size: 0.85rem;

    white-space: nowrap;
}

.market-table td {
    text-align: left;
}

/* ==========================================================================
   STICKY COLUMN HEADERS

   These remain visible while creator rows scroll vertically.
   ========================================================================== */

.market-table thead {
    position: relative;

    z-index: 5;
}

.market-table th {
    position: sticky;

    top: 0;

    z-index: 6;

    color:
        var(--color-text-muted);

    background:
        #1b1d1f;

    border-top:
        1px solid rgba(255, 255, 255, 0.025);

    border-bottom:
        1px solid rgba(255, 255, 255, 0.065);

    font-size: 0.68rem;

    text-transform: uppercase;

    letter-spacing: 0.09em;

    text-align: left;

    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   COLUMN ALIGNMENT

   1  Symbol
   2  Channel
   3  Niche
   4  Price
   5  Change
   6  % Change
   7  Est. Rev Min
   8  Est. Rev Max
   9  Subscribers
   10 Videos
   11 28D Views
   12 Available Shares
   13 Market Cap
   ========================================================================== */

.market-table td:nth-child(4),
.market-table td:nth-child(5),
.market-table td:nth-child(6),
.market-table td:nth-child(7),
.market-table td:nth-child(8),
.market-table td:nth-child(9),
.market-table td:nth-child(10),
.market-table td:nth-child(11),
.market-table td:nth-child(12),
.market-table td:nth-child(13),
.market-table th:nth-child(4),
.market-table th:nth-child(5),
.market-table th:nth-child(6),
.market-table th:nth-child(7),
.market-table th:nth-child(8),
.market-table th:nth-child(9),
.market-table th:nth-child(10),
.market-table th:nth-child(11),
.market-table th:nth-child(12),
.market-table th:nth-child(13) {
    text-align: right;
}

/* ==========================================================================
   COLUMN WIDTHS
   ========================================================================== */

.market-table th:nth-child(1),
.market-table td:nth-child(1) {
    min-width: 72px;
}

.market-table th:nth-child(2),
.market-table td:nth-child(2) {
    min-width: 150px;
}

.market-table th:nth-child(3),
.market-table td:nth-child(3) {
    min-width: 120px;
}

.market-table th:nth-child(4),
.market-table td:nth-child(4) {
    min-width: 90px;
}

.market-table th:nth-child(5),
.market-table td:nth-child(5) {
    min-width: 88px;
}

.market-table th:nth-child(6),
.market-table td:nth-child(6) {
    min-width: 82px;
}

.market-table th:nth-child(7),
.market-table td:nth-child(7),
.market-table th:nth-child(8),
.market-table td:nth-child(8) {
    min-width: 110px;
}

.market-table th:nth-child(9),
.market-table td:nth-child(9) {
    min-width: 110px;
}

.market-table th:nth-child(10),
.market-table td:nth-child(10) {
    min-width: 82px;
}

.market-table th:nth-child(11),
.market-table td:nth-child(11) {
    min-width: 105px;
}

.market-table th:nth-child(12),
.market-table td:nth-child(12) {
    min-width: 118px;
}

.market-table th:nth-child(13),
.market-table td:nth-child(13) {
    min-width: 118px;
}

/* ==========================================================================
   ROW STATES
   ========================================================================== */

.market-table__row:hover td {
    background:
        rgba(255, 255, 255, 0.015);
}

.market-table__empty {
    color:
        var(--color-text-muted);

    text-align: center;

    padding:
        2rem 1rem;
}

/* ==========================================================================
   MARKET COLOURS
   ========================================================================== */

.data-positive {
    color:
        var(--color-positive);
}

.data-negative {
    color:
        var(--color-negative);
}

.data-neutral {
    color:
        var(--color-text);
}

.terminal-error {
    margin: 0;

    color:
        var(--color-negative);

    line-height: 1.6;
}

/* ==========================================================================
   CREATOR LINKS
   ========================================================================== */

.market-table__link-button {
    appearance: none;

    background: transparent;

    border: 0;

    padding: 0;

    color: inherit;

    font: inherit;

    cursor: pointer;

    text-align: left;
}

.market-table__link-button:hover {
    text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1280px) {

    .alpha500-page,
    .alpha100-page {
        height: auto;

        overflow: visible;

        display: grid;
    }

    .market-table-card {
        height: auto;

        overflow: visible;
    }

    .market-table-wrap {
        height: auto;

        max-height: none;

        overflow-x: auto;
        overflow-y: visible;
    }
}

@media (max-width: 980px) {
    .stats-grid {
        grid-template-columns:
            1fr 1fr;
    }

    .market-table-card__header {
        flex-direction: column;

        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns:
            1fr;
    }

    .terminal-card {
        padding:
            0.8rem;
    }

    .market-table {
        min-width: 1220px;
    }
}