/* ── Page shell ───────────────────────────────────────────────────── */

.markets-dashboard-shell {
    margin: 0 auto;
    width: 100%;
}

/* ── Page header ──────────────────────────────────────────────────── */

.markets-hero {
    margin: 0 auto;
    max-width: 720px;
}

.markets-subtitle {
    color: var(--app-color-text-secondary);
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
}

.markets-live-badge {
    align-items: center;
    background: rgba(var(--app-success-rgb), 0.10);
    border-radius: 999px;
    color: var(--app-success);
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 700;
    gap: 0.35rem;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.75rem;
    text-transform: uppercase;
}

.markets-live-badge i {
    font-size: 0.85rem;
}

/* ── Snapshot & halving cards ─────────────────────────────────────── */

.snapshot-card,
.halving-card {
    background: var(--app-color-bg);
    border: 1px solid var(--app-color-border);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.07);
}

.snapshot-card {
    border-top: 3px solid var(--app-success);
}

.halving-card {
    border-top: 3px solid #f59e0b;
}

.snapshot-card .card-body,
.halving-card .card-body {
    padding: 1.5rem;
}

.snapshot-card .card-title,
.halving-card .card-title {
    align-items: center;
    display: flex;
    font-size: 0.8rem;
    font-weight: 700;
    gap: 0.4rem;
    letter-spacing: 0.07em;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    color: var(--app-color-text-secondary);
}

.snapshot-card .card-title i,
.halving-card .card-title i {
    font-size: 1rem;
}

/* ── Fear & Greed gauge rows ──────────────────────────────────────── */

.fg-row {
    margin-bottom: 1.1rem;
}

.fg-row:last-child {
    margin-bottom: 0;
}

.fg-row-header {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.fg-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.fg-value-text {
    color: var(--app-color-text-secondary);
    font-size: 0.82rem;
}

.fg-value-text strong {
    color: var(--app-color-heading);
    font-size: 0.92rem;
}

.fg-description-badge {
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-left: 0.35rem;
    padding: 0.1rem 0.55rem;
    text-transform: uppercase;
    vertical-align: middle;
}

.fg-gauge-track {
    background: #eef0f4;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    width: 100%;
}

.fg-gauge-fill {
    border-radius: 999px;
    height: 100%;
    transition: width 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Sentiment colour bands */
.fg-extreme-fear   { background: #e74c3c; }
.fg-fear           { background: #e67e22; }
.fg-neutral        { background: #f1c40f; }
.fg-greed          { background: #82ca9d; }
.fg-extreme-greed  { background: #27ae60; }

.badge-extreme-fear  { background: rgba(231, 76, 60, 0.12);  color: #c0392b; }
.badge-fear          { background: rgba(230, 126, 34, 0.12);  color: #d35400; }
.badge-neutral       { background: rgba(241, 196, 15, 0.14);  color: #9a7d0a; }
.badge-greed         { background: rgba(130, 202, 157, 0.18); color: #1e8449; }
.badge-extreme-greed { background: rgba(39, 174, 96, 0.12);   color: #1a6635; }

/* ── Halving progress bar ─────────────────────────────────────────── */

.halving-detail-grid {
    display: grid;
    gap: 0.25rem 1rem;
    grid-template-columns: auto 1fr;
    margin-bottom: 1rem;
}

.halving-detail-label {
    color: var(--app-color-text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
}

.halving-detail-value {
    font-size: 0.82rem;
    font-weight: 700;
}

.halving-progress-wrapper {
    margin-top: 0.75rem;
}

.halving-progress-track {
    background: #eef0f4;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    width: 100%;
}

.halving-progress-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
    border-radius: 999px;
    height: 100%;
    transition: width 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.halving-progress-label {
    color: var(--app-color-text-secondary);
    font-size: 0.78rem;
    margin-top: 0.4rem;
}

/* ── Snapshot meta & source ───────────────────────────────────────── */

.snapshot-meta {
    color: var(--app-color-text-secondary);
    margin: 0;
}

.snapshot-source {
    color: #7b8794;
    font-size: 0.78rem;
}

.snapshot-link {
    font-weight: 700;
}

/* ── Cross-market tape widget shell ───────────────────────────────── */

.tape-shell {
    background: var(--app-color-bg);
    border: 1px solid var(--app-color-border);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.tape-header {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem 0.5rem;
}

.tape-title {
    color: var(--app-color-heading);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.tape-title i {
    color: var(--app-color-text-secondary);
    font-size: 1rem;
}

/* ── Generic widget shell (for tab panels) ────────────────────────── */

.widget-shell {
    background: var(--app-color-bg);
    border: 1px solid var(--app-color-border);
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.widget-shell + .widget-shell {
    margin-top: 1.25rem;
}

.markets-dashboard-shell .tradingview-widget-container,
.markets-dashboard-shell .tradingview-widget-container__widget,
.markets-dashboard-shell .tradingview-widget-container iframe {
    background: transparent !important;
}

.widget-shell .widget-title {
    align-items: center;
    color: var(--app-color-heading);
    display: flex;
    font-size: 0.8rem;
    font-weight: 700;
    gap: 0.4rem;
    letter-spacing: 0.07em;
    padding: 0.85rem 1.25rem 0.5rem;
    text-transform: uppercase;
}

.widget-shell .widget-title i {
    color: var(--app-color-text-secondary);
    font-size: 1rem;
}

/* ── Tab navigation ───────────────────────────────────────────────── */

.markets-tabs {
    --tab-gap: 0.5rem;
}

.markets-tabs .nav {
    gap: var(--tab-gap);
}

.markets-tabs .tab-pane {
    background: var(--app-color-surface);
    border: 1px solid var(--app-color-border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    padding: 1.5rem;
}

.markets-tabs .tab-pane .row:last-child {
    margin-bottom: 0 !important;
}

.markets-tabs .nav-link {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--app-color-body-text);
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 0.4rem;
    padding: 0.6rem 1.35rem;
}

.markets-tabs .nav-link i {
    font-size: 1.05rem;
}

.markets-tabs .nav-link.active {
    background-color: var(--app-success);
    border-color: var(--app-success);
    box-shadow: 0 4px 12px rgba(var(--app-success-rgb), 0.28);
    color: var(--app-color-surface);
}

.markets-tabs .nav-link:hover:not(.active),
.markets-tabs .nav-link:focus:not(.active) {
    background: rgba(var(--app-success-rgb), 0.06);
    border-color: rgba(var(--app-success-rgb), 0.28);
    box-shadow: none;
    color: #222222;
}

/* ── Tab panel padding ────────────────────────────────────────────── */

.dashboard-panel {
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
}

/* ── Individual stock section ─────────────────────────────────────── */

.individual-stock-shell {
    display: grid;
    gap: 2rem;
}

.individual-stock-toolbar {
    display: flex;
    justify-content: center;
}

.individual-stock-form {
    width: 100%;
}

#individual-stock-content {
    display: grid;
    gap: 2rem;
}

.individual-stock-control {
    align-items: center;
    background: var(--app-color-surface);
    border: 2px solid #d5dbe5;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    display: flex;
    margin: 0 auto;
    max-width: 560px;
    overflow: hidden;
    transition: border-color 0.15s ease;
    width: 100%;
}

.individual-stock-control:focus-within {
    border-color: var(--app-success);
    box-shadow: 0 0 0 3px rgba(var(--app-success-rgb), 0.15);
}

.individual-stock-icon {
    align-items: center;
    color: #98a2b3;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    padding-left: 1.15rem;
    padding-right: 0.55rem;
}

.individual-stock-icon svg {
    fill: none;
    height: 1.55rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
    width: 1.55rem;
}

.individual-stock-input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex: 1 1 auto;
    font-size: 1rem;
    font-weight: 700;
    max-width: none;
    min-height: 56px;
    padding: 0 0.85rem 0 0;
    width: 100%;
}

.individual-stock-input:focus {
    box-shadow: none;
}

.individual-stock-submit {
    align-items: center;
    align-self: stretch;
    border: 0;
    border-radius: 0 999px 999px 0;
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 700;
    min-width: 90px;
    padding: 0 1.25rem;
    white-space: nowrap;
}


.individual-stock-inline-error {
    font-size: 0.95rem;
    margin: -1rem auto 0;
    max-width: 560px;
    text-align: center;
}

.individual-stock-section {
    border: 0;
    box-shadow: none;
    margin: 0;
    overflow: visible;
    padding: 0;
}

.individual-stock-section-title {
    color: var(--app-color-heading);
    font-size: 1rem;
    font-weight: 800;
    margin: 0 0 0.85rem;
    padding: 0;
}

.individual-stock-widget {
    height: 380px;
    width: 100%;
}

.individual-stock-widget-sm {
    height: 240px;
}

.individual-stock-widget-md {
    height: 560px;
}

.individual-stock-widget-profile {
    height: 320px;
}

.individual-stock-widget-fundamentals {
    height: 1040px;
}

.individual-stock-widget-chart {
    height: 700px;
}

.individual-stock-widget-news {
    height: 700px;
}

.individual-stock-widget .tradingview-widget-container,
.individual-stock-widget .tradingview-widget-container__widget {
    height: 100%;
    width: 100%;
}

/* ── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .individual-stock-toolbar {
        justify-content: center;
    }

    .markets-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.55rem 1rem;
    }
}

@media (max-width: 575.98px) {
    #individual-stock-content {
        gap: 1.5rem;
    }

    .individual-stock-control {
        border-radius: 1.5rem;
        flex-direction: column;
        overflow: visible;
    }

    .individual-stock-input {
        min-height: 52px;
        padding: 0 1rem 0.6rem;
    }

    .individual-stock-icon {
        padding: 0.95rem 1rem 0.2rem;
        width: 100%;
    }

    .individual-stock-submit {
        border-radius: 0 0 1.35rem 1.35rem;
        justify-content: center;
        min-height: 50px;
        width: 100%;
    }

    .markets-tabs .nav-link span {
        display: none;
    }

    .markets-tabs .nav-link i {
        font-size: 1.25rem;
    }
}
