﻿:root {
    color-scheme: dark;
    --page-bg: #07111f;
    --page-bg-secondary: #0f172a;
    --surface: rgba(15, 23, 42, 0.82);
    --surface-strong: rgba(15, 23, 42, 0.94);
    --surface-soft: rgba(30, 41, 59, 0.7);
    --border: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --soft: #cbd5e1;
    --shadow: 0 24px 60px rgba(2, 8, 23, 0.35);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(8, 138, 248, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(99, 8, 232, 0.18), transparent 24%),
        linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-secondary) 100%);
    color: var(--text);
}

body {
    min-height: 100vh;
}

a,
.btn-link {
    color: #7dd3fc;
}

h1:focus {
    outline: none;
}

#app {
    min-height: 100vh;
}

.app-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.app-main,
.dashboard {
    display: grid;
    gap: 18px;
}

.eyebrow,
.metric-label,
.meta-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.surface {
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow);
    background: var(--surface);
    overflow: hidden;
}

.hero-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
    gap: 20px;
    padding: 28px;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -70px;
    bottom: -120px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 66%);
    pointer-events: none;
}

.hero-copy,
.hero-meta {
    position: relative;
    z-index: 1;
}

.hero-top,
.metric-header,
.error-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-title,
.summary-title,
.loading-title {
    margin: 0;
    color: #f8fafc;
}

.hero-title {
    margin-top: 12px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.hero-subtitle,
.metric-copy,
.summary-copy,
.error-card-copy,
.loading-copy {
    margin: 0;
    line-height: 1.6;
    color: var(--soft);
}

.hero-subtitle {
    margin-top: 14px;
    max-width: 36rem;
}

.hero-price-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin: 26px 0 8px;
}

.hero-price {
    font-size: clamp(4rem, 12vw, 7.5rem);
    line-height: 0.9;
    font-weight: 800;
    letter-spacing: -0.08em;
}

.hero-period,
.metric-period {
    color: #f8fafc;
}

.hero-period {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
}

.status-pill,
.trend-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.trend-chip {
    background: rgba(15, 23, 42, 0.62);
}

.trend-compact {
    padding: 7px 10px;
}

.trend-up {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.24);
}

.trend-down {
    color: #fb923c;
    background: rgba(249, 115, 22, 0.14);
    border-color: rgba(249, 115, 22, 0.24);
}

.trend-flat {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.22);
}

.trend-unknown {
    color: #f8fafc;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.22);
}

.status-neutral {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.22);
}

.status-purple {
    color: #c4b5fd;
    background: rgba(99, 8, 232, 0.14);
    border-color: rgba(99, 8, 232, 0.26);
}

.status-blue {
    color: #7dd3fc;
    background: rgba(8, 138, 248, 0.14);
    border-color: rgba(8, 138, 248, 0.26);
}

.status-green {
    color: #86efac;
    background: rgba(35, 181, 13, 0.14);
    border-color: rgba(35, 181, 13, 0.26);
}

.status-yellow {
    color: #fde047;
    background: rgba(255, 216, 0, 0.14);
    border-color: rgba(255, 216, 0, 0.26);
}

.status-orange {
    color: #fdba74;
    background: rgba(255, 106, 0, 0.14);
    border-color: rgba(255, 106, 0, 0.26);
}

.status-red {
    color: #fca5a5;
    background: rgba(255, 0, 0, 0.14);
    border-color: rgba(255, 0, 0, 0.26);
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.meta-panel {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(8, 15, 30, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.meta-panel strong {
    color: #f8fafc;
}

.metrics-grid,
.summary-grid {
    display: grid;
    gap: 18px;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card,
.summary-card {
    display: grid;
    gap: 14px;
    padding: 22px;
}

.metric-value {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.metric-period {
    font-size: 1rem;
    font-weight: 600;
}

.summary-title {
    font-size: 1.35rem;
}

.error-card {
    display: grid;
    gap: 10px;
    padding: 18px 22px;
    background: rgba(68, 18, 29, 0.74);
    border-color: rgba(248, 113, 113, 0.32);
}

.loading-card {
    display: grid;
    justify-items: center;
    gap: 18px;
    padding: 40px 24px;
    text-align: center;
}

.dashboard-loader {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(148, 163, 184, 0.2);
    border-top-color: #7dd3fc;
    animation: dashboard-spin 0.8s linear infinite;
}

.surface-accent-purple {
    border-color: rgba(99, 8, 232, 0.28);
}

.surface-accent-blue {
    border-color: rgba(8, 138, 248, 0.28);
}

.surface-accent-green {
    border-color: rgba(35, 181, 13, 0.28);
}

.surface-accent-yellow {
    border-color: rgba(255, 216, 0, 0.28);
}

.surface-accent-orange {
    border-color: rgba(255, 106, 0, 0.28);
}

.surface-accent-red {
    border-color: rgba(255, 0, 0, 0.28);
}

.Purple {
    color: #c084fc;
}

.Blue {
    color: #38bdf8;
}

.Green {
    color: #4ade80;
}

.Yellow {
    color: #fde047;
}

.Orange {
    color: #fb923c;
}

.Red {
    color: #f87171;
}

#blazor-error-ui {
    color-scheme: light only;
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
    padding: 14px 18px;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    background: lightyellow;
    color: #111827;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 14px;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: rgba(148, 163, 184, 0.22);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #38bdf8;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    text-align: center;
    font-weight: 700;
    color: var(--text);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

@keyframes dashboard-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 960px) {
    .hero-card,
    .summary-grid,
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 18px 14px 36px;
    }

    .hero-card,
    .summary-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        padding: 22px;
    }

    .hero-meta {
        grid-template-columns: 1fr;
    }
}

/* ── Chart ── */
.chart-card {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.chart-date {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f8fafc;
}

.chart-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.chart-svg {
    width: 100%;
    min-width: 480px;
    height: auto;
}

.chart-grid-line {
    stroke: rgba(148, 163, 184, 0.12);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.chart-zero-line {
    stroke: rgba(148, 163, 184, 0.4);
    stroke-width: 1.5;
}

.chart-axis-label {
    fill: var(--muted);
    font-size: 11px;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
}

.chart-y-label {
    text-anchor: end;
}

.chart-x-label {
    text-anchor: middle;
}

.chart-bar {
    transition: opacity 0.15s ease;
}

.chart-bar-current {
    filter: drop-shadow(0 0 6px rgba(125, 211, 252, 0.5));
    stroke: rgba(125, 211, 252, 0.6);
    stroke-width: 1.5;
}

.chart-bar-purple { fill: #c084fc; }
.chart-bar-blue   { fill: #38bdf8; }
.chart-bar-green  { fill: #4ade80; }
.chart-bar-yellow { fill: #fde047; }
.chart-bar-orange { fill: #fb923c; }
.chart-bar-red    { fill: #f87171; }
.chart-bar-future { fill: rgba(148, 163, 184, 0.18); }

/* Tooltip */
.chart-hit-area {
    fill: transparent;
    cursor: pointer;
}

.chart-tooltip {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.chart-tooltip-group:hover .chart-tooltip {
    opacity: 1;
}

.chart-tooltip-group:hover .chart-bar {
    opacity: 0.85;
}

.chart-tooltip-bg {
    fill: var(--surface-strong);
    stroke: var(--border);
    stroke-width: 1;
}

.chart-tooltip-text {
    fill: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    text-anchor: middle;
}

/* Legend */
.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 18px;
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--muted);
}

.chart-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.chart-swatch-purple  { background: #c084fc; }
.chart-swatch-green   { background: #4ade80; }
.chart-swatch-yellow  { background: #fde047; }
.chart-swatch-orange  { background: #fb923c; }
.chart-swatch-red     { background: #f87171; }
.chart-swatch-pending { background: rgba(148, 163, 184, 0.18); border: 1px dashed rgba(148, 163, 184, 0.4); }
