/* Athena design tokens aliasing the MudBlazor/AthenaTheme palette, so the theme stays the single
   source of truth and consumers track light/dark automatically.

   Loaded app-wide from the host index.html. This is the design-system home for the tokens; the
   parallel src/UI cv-tokens.css is the pre-migration copy, and tokens retire from it as each
   component that uses them moves into Athena.Design. */
:root {
    --athena-blue: var(--mud-palette-primary);
    --athena-blue-deep: var(--mud-palette-primary-darken);
    --athena-blue-700: var(--mud-palette-primary-darken);
    --athena-blue-300: var(--mud-palette-primary);
    --athena-blue-100: var(--mud-palette-primary-lighten);
    --athena-blue-50: var(--mud-palette-primary-lighten);
    --athena-green: var(--mud-palette-success);
    --athena-green-deep: var(--mud-palette-success-darken);
    --athena-green-50: var(--mud-palette-success-lighten);
    --athena-ink: var(--mud-palette-text-primary);
    --athena-ink-2: var(--mud-palette-text-primary);
    --athena-ink-3: var(--mud-palette-text-secondary);
    --athena-ink-4: var(--mud-palette-gray-default);
    --athena-ink-5: var(--mud-palette-text-disabled);
    --athena-line: var(--mud-palette-lines-default);
    --athena-line-soft: var(--mud-palette-divider-light);
    --athena-bg: var(--mud-palette-background);
    --athena-bg-soft: var(--mud-palette-surface);
    --athena-surface: var(--mud-palette-surface);
    --athena-warn: var(--mud-palette-warning);
    --athena-warn-bg: var(--mud-palette-warning-lighten);
    --athena-warn-deep: var(--mud-palette-warning-darken);
    --athena-danger-deep: var(--mud-palette-error-darken);
    --athena-danger-bg: var(--mud-palette-error-lighten);
    --athena-danger-border: color-mix(in srgb, var(--mud-palette-error) 35%, var(--mud-palette-error-lighten));
    --athena-danger-tint: var(--mud-palette-error-lighten);
    --shadow-1: var(--mud-elevation-1);
    --shadow-2: var(--mud-elevation-2);
    --shadow-3: var(--mud-elevation-8);
    --font-display: "Inter", "Segoe UI", system-ui, sans-serif;
    /* Mirrors AthenaColors.MonospaceFontFamily so chart C# and CSS agree on tabular figures. */
    --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;

    /* Radius scale by surface role. The Mud theme default (8px) is the card step, so controls and the
       smaller steps need naming or every component re-guesses them. */
    --athena-radius-overlay: 12px;
    --athena-radius-card: 8px;
    --athena-radius-control: 4px;
    --athena-radius-cell: 3px;

    /* Categorical hues identifying a page-variable's type. Distinct from the semantic palette on
       purpose — these encode identity, not state, so there is no Mud equivalent to alias.
       Backgrounds are mixed against the surface at use time so tints follow light/dark. */
    --athena-type-text: #4A5870;
    --athena-type-number: #2D4F9E;
    --athena-type-boolean: #0E7490;
    --athena-type-datetime: #6E2A91;
    --athena-type-location: #2E8C36;
    --athena-type-struct: #8E5E12;
    --athena-type-geometry: #2A4480;
    --athena-type-guid: #6B7890;
}

/* The Mud theme default radius is the card step, and MudIconButton is a circle. Controls that owe the
   4px step opt in with this, since a scoped rule cannot reach a MudBlazor component's root element. */
.athena-control-radius {
    border-radius: var(--athena-radius-control);
}

/* The drawer palette is themed for the dark nav rail; page panels opt in to surface colors. */
.athena-drawer-surface.mud-drawer {
    --mud-palette-drawer-background: var(--mud-palette-surface);
    --mud-palette-drawer-text: var(--mud-palette-text-primary);
    --mud-palette-drawer-icon: var(--mud-palette-text-secondary);
}

/* AthenaResponsiveDrawer's side drawer before the viewport answers: shown from Md up, where it will stay. */
@media (max-width: 959.98px) {
    .athena-drawer-pending.mud-drawer {
        display: none !important;
    }
}

/* Data values — offsets, times, counts — so stacked columns of them stay aligned. */
.athena-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* A panel pinned to a corner of a positioned parent, such as a map. Near-opaque on the theme surface so its text reads
   over whatever is behind it in either theme. */
.athena-map-overlay {
    position: absolute;
    z-index: 2;
    max-width: calc(50% - 1.25rem);
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, transparent);
    backdrop-filter: blur(6px);
    border: 1px solid var(--athena-line);
    border-radius: var(--athena-radius-control);
}

.athena-map-overlay-top-left { top: 0.625rem; left: 0.625rem; }
.athena-map-overlay-top-right { top: 0.625rem; right: 0.625rem; }
.athena-map-overlay-bottom-left { bottom: 0.625rem; left: 0.625rem; }
.athena-map-overlay-bottom-right { bottom: 0.625rem; right: 0.625rem; }

.athena-map-overlay-center {
    top: 50%;
    left: 50%;
    width: max-content;
    max-width: min(26rem, calc(100% - 1.25rem));
    transform: translate(-50%, -50%);
}

/* Shimmer is motion with no meaning, so it stops for anyone who has asked for less of it. */
@media (prefers-reduced-motion: reduce) {
    .mud-skeleton {
        animation: none;
    }
}

/* Secondary text in the theme's text-secondary color. MudText's own Color.Secondary is the brand accent, not this. */
.athena-text-muted {
    color: var(--mud-palette-text-secondary);
}

/* Warning-colored text that stays readable on both themes: the amber is pulled toward the text color, so it darkens on
   a light surface and lightens on a dark one. */
.athena-text-warn {
    color: color-mix(in srgb, var(--mud-palette-warning) 65%, var(--mud-palette-text-primary));
}

/* AthenaOptionButton. A scoped rule can't reach a MudBlazor root element, so these sit here. The name gives way before
   the hint does, a choice that can't be picked has a dashed border, and an unchosen one has the quiet theme border
   rather than the heavy one Mud gives an outlined button. */
.athena-option-button .athena-option-button-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.athena-option-button .athena-option-button-hint {
    flex: none;
    white-space: nowrap;
}

.athena-option-button.mud-button-outlined-default {
    border-color: var(--mud-palette-lines-default);
}

.athena-option-button.mud-button-outlined-warning {
    color: color-mix(in srgb, var(--mud-palette-warning) 65%, var(--mud-palette-text-primary));
}

.athena-option-button.mud-button-root:disabled {
    border-style: dashed;
}
