/**
 * Momentum Widget — scoped styles. Mounts on #momentum-widget; every
 * class is `.mw-*` to avoid bleed into the rest of the bittensor page.
 *
 * Theme tokens (--protocol-accent, --color-text-muted, --protocol-border)
 * come from the host page's existing variables — no new globals.
 */

.mw-host {
    /* full-width section card, matching .protocol-summary visual weight */
    margin: 1.5rem 0 2rem;
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid var(--protocol-border, #2a2d35);
    border-radius: 8px;
    background: var(--protocol-card-bg, rgba(20, 20, 24, 0.6));
}

.mw-header { margin-bottom: 0.75rem; }

.mw-title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text, #e5e5ea);
}

.mw-subtitle {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--color-text-muted, #a0a0a8);
}
.mw-subtitle code {
    background: rgba(255, 255, 255, 0.05);
    padding: 0 4px;
    border-radius: 3px;
    font-size: 0.72rem;
}

/* Tabs ----------------------------------------------------------------- */

.mw-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0.75rem 0 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--protocol-border, #2a2d35);
}

.mw-tab {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-muted, #a0a0a8);
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    font-family: inherit;
}
.mw-tab:hover {
    color: var(--color-text, #e5e5ea);
    background: rgba(255, 255, 255, 0.04);
}
.mw-tab-active,
.mw-tab-active:hover {
    color: var(--protocol-accent, #22c55e);
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
}
.mw-tab:focus-visible {
    outline: 2px solid var(--protocol-accent, #22c55e);
    outline-offset: 2px;
}

/* Metrics row ---------------------------------------------------------- */

.mw-metrics { padding: 0.5rem 0 0.75rem; }

.mw-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}
.mw-row-meta {
    margin-bottom: 0.75rem;
    color: var(--color-text-muted, #a0a0a8);
    font-size: 0.72rem;
}

.mw-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 90px;
}
.mw-stat-label {
    font-size: 0.7rem;
    color: var(--color-text-muted, #a0a0a8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mw-stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text, #e5e5ea);
    font-variant-numeric: tabular-nums;
}

.mw-pos { color: var(--positive, #22c55e); }
.mw-neg { color: var(--negative, #ef4444); }

.mw-meta-text {
    font-size: 0.72rem;
    color: var(--color-text-dim, #6b7080);
}

/* Validity chips ------------------------------------------------------- */

.mw-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.mw-chip-good {
    color: var(--positive, #22c55e);
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.mw-chip-warn {
    color: #eab308;
    background: rgba(234, 179, 8, 0.10);
    border: 1px solid rgba(234, 179, 8, 0.3);
}
.mw-chip-bad {
    color: var(--negative, #ef4444);
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Chart ---------------------------------------------------------------- */

.mw-chart-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    margin-top: 0.5rem;
}
.mw-chart { display: block; width: 100%; }

/* Footer + states ------------------------------------------------------ */

.mw-footnote {
    margin: 0.75rem 0 0;
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--color-text-dim, #6b7080);
}
.mw-footnote code {
    background: rgba(255, 255, 255, 0.05);
    padding: 0 4px;
    border-radius: 3px;
}

.mw-loading {
    padding: 1.5rem;
    text-align: center;
    color: var(--color-text-muted, #a0a0a8);
    font-size: 0.85rem;
}

.mw-empty {
    padding: 1.25rem;
    text-align: center;
    color: var(--color-text-muted, #a0a0a8);
    font-size: 0.82rem;
    border: 1px dashed var(--protocol-border, #2a2d35);
    border-radius: 6px;
}
.mw-empty code {
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.78rem;
}

/* Mobile --------------------------------------------------------------- */

@media (max-width: 640px) {
    .mw-host { padding: 1rem 0.85rem 0.85rem; }
    .mw-row { gap: 0.85rem; }
    .mw-stat { min-width: 75px; }
    .mw-stat-value { font-size: 0.95rem; }
    .mw-chart-wrap { height: 220px; }
}
