/* SeriousMindware.Widgets.Razor styles. Link once from the host app's <head>:
   <link rel="stylesheet" href="_content/SeriousMindware.Widgets.Razor/widgets.css" />
   Override --widget-* custom properties on :root (or any ancestor) to theme. */

.debt-counter {
    margin: 1.5rem 0;
    padding: 1.1rem 1.25rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(20, 28, 52, 0.95), rgba(12, 18, 36, 0.95));
    border: 1px solid rgba(255, 190, 90, 0.35);
    box-shadow: 0 0 18px rgba(255, 170, 60, 0.12);
    text-align: center;
    break-inside: avoid;
}

.debt-counter-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--widget-label, #5fd4e0);
}

.debt-counter-value {
    margin: 0.35rem 0 0.5rem;
    font-size: clamp(1.4rem, 3.2vw, 2.1rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--widget-value, #ffc164);
    text-shadow: 0 0 12px rgba(255, 170, 60, 0.35);
    white-space: nowrap;
}

.debt-counter-note {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--widget-note, #aab0c0);
}

.widget-link {
    color: var(--widget-link, #87a7e9);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(135, 167, 233, 0.4);
}

.widget-link:hover {
    border-bottom-color: currentColor;
}

.rate-widget {
    margin: 1.5rem 0;
    padding: 1.1rem 1.25rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(20, 28, 52, 0.95), rgba(12, 18, 36, 0.95));
    border: 1px solid rgba(95, 212, 224, 0.35);
    box-shadow: 0 0 18px rgba(95, 212, 224, 0.12);
    text-align: center;
    break-inside: avoid;
}

.rate-widget-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--widget-label, #5fd4e0);
}

.rate-widget-value {
    margin: 0.35rem 0 0.25rem;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--widget-value, #ffc164);
    text-shadow: 0 0 12px rgba(255, 170, 60, 0.35);
}

/* LineChart.razor - an SVG line chart with axes. Scales with its container. */
.line-chart-wrap {
    container-type: inline-size;
    width: 100%;
    max-width: 560px;
    margin: 0.5rem auto 0.75rem;
}

.line-chart {
    display: block;
    width: 100%;
    height: auto;
    color: var(--widget-label, #5fd4e0);
}

.chart-grid {
    stroke: rgba(170, 176, 192, 0.18);
    stroke-width: 1;
}

.chart-axis {
    stroke: rgba(170, 176, 192, 0.55);
    stroke-width: 1;
}

.chart-label {
    fill: var(--widget-note, #aab0c0);
    font-size: 10.5px;
}

.chart-title {
    letter-spacing: 0.04em;
}

/* The SVG scales with its container, so its text shrinks with it. Where the chart is narrow
   (phones, two-up cells on small tablets) bump the label size in the SVG's own units so the
   rendered text stays around 9-10px. */
@container (max-width: 440px) {
    .chart-label {
        font-size: 13px;
    }

    .chart-title {
        font-size: 12px;
    }
}

@container (max-width: 320px) {
    .chart-label {
        font-size: 15px;
    }
}

.chart-area {
    fill: currentColor;
    fill-opacity: 0.15;
    stroke: none;
}

.chart-line {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.chart-dot {
    fill: var(--widget-value, #ffc164);
}

.rate-widget-note {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--widget-note, #aab0c0);
}

/* Trend glow. A widget with a TrendSignal gets class "trend-glow" and an inline --trend-hue
   (0 red -> 55 yellow -> 130 green); the edge glow and the badge are both drawn from it.
   Kept last in the file so it overrides each widget's default border and shadow. */
.trend-glow {
    border-color: hsl(var(--trend-hue) 85% 55% / 0.55);
    box-shadow:
        0 0 14px 1px hsl(var(--trend-hue) 90% 55% / 0.55),
        0 0 34px hsl(var(--trend-hue) 90% 55% / 0.28),
        inset 0 0 24px hsl(var(--trend-hue) 90% 55% / 0.35);
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.4rem 0 0;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    border: 1px solid hsl(var(--trend-hue) 85% 55% / 0.5);
    background: hsl(var(--trend-hue) 60% 40% / 0.25);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #e6e9f2;
}

.trend-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: hsl(var(--trend-hue) 90% 58%);
    box-shadow: 0 0 6px hsl(var(--trend-hue) 90% 58%);
}

.trend-window {
    font-weight: 400;
    color: var(--widget-note, #aab0c0);
}

.widget-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
