/* ==================================================================
   Mina design tokens — inky console, dark-first with light counterpart
   ==================================================================
   Why this lives in its own stylesheet (not embedded in App.razor):
     - Mud's MudThemeProvider can read CSS variables at runtime to keep
       its primitives (DataGrid, Dialog) coherent with our shell.
     - Tokens are theme-switched via [data-theme="..."] on <html>,
       set synchronously by the inline script in App.razor before first
       paint to avoid a flash of unthemed content.
   ================================================================== */
:root {
    /* Identity */
    --mina-brand-glyph: #00E5FF;

    /* Surfaces (DARK is the default :root set; light overrides below) */
    --mina-bg-deep:    #0A0612;
    --mina-bg:         #110821;
    --mina-surface:    #14081E;
    --mina-surface-2:  #1B0F2A;
    --mina-surface-3:  #251535;
    --mina-border:     #2D1B4E;
    --mina-border-2:   #3D2766;

    /* Text */
    --mina-text:       #E5DDF5;
    --mina-text-2:     #B5A8D5;
    --mina-muted:      #8B7CB5;
    --mina-disabled:   #5A4D7A;

    /* Accents */
    --mina-accent:     #00E5FF;            /* cyan: live, primary action */
    --mina-accent-2:   #7C3AED;            /* violet: link, secondary */
    --mina-accent-on:  #061018;            /* foreground over cyan */

    /* Semantic */
    --mina-ok:         #4ADE80;
    --mina-ok-soft:    rgba(74, 222, 128, 0.14);
    --mina-warn:       #F5A524;
    --mina-warn-soft:  rgba(245, 165, 36, 0.14);
    --mina-err:        #FF6B9D;
    --mina-err-soft:   rgba(255, 107, 157, 0.14);
    --mina-thinking:   #C084FC;            /* the agent-mid-thought hue */

    /* Effects */
    --mina-shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.5);
    --mina-shadow-md:  0 8px 24px rgba(0, 0, 0, 0.5),
                       0 1px 0 rgba(255, 255, 255, 0.04) inset;
    --mina-shadow-lg:  0 24px 60px rgba(0, 0, 0, 0.6),
                       0 1px 0 rgba(255, 255, 255, 0.05) inset;
    --mina-glow-cyan:  0 0 0 1px rgba(0, 229, 255, 0.18),
                       0 0 24px -6px rgba(0, 229, 255, 0.55);
    --mina-grid-line:  rgba(124, 58, 237, 0.045);

    /* Radius */
    --mina-radius-xs:  4px;
    --mina-radius-sm:  6px;
    --mina-radius-md:  10px;
    --mina-radius-lg:  14px;

    /* Type — Geist Sans for body, Geist Mono for status / numerics / IDs */
    --mina-font-sans:  'Geist', ui-sans-serif, -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;
    --mina-font-mono:  'Geist Mono', ui-monospace, 'JetBrains Mono', 'Fira Code', 'Cascadia Mono', Menlo, Consolas, monospace;

    /* Motion */
    --mina-ease:       cubic-bezier(0.32, 0.72, 0, 1);
    --mina-fast:       120ms;
    --mina-base:       200ms;
    --mina-slow:       400ms;

    /* Sidebar widths */
    --mina-sidebar-w:        232px;
    --mina-sidebar-w-collapsed: 64px;
    --mina-topbar-h:         56px;

    /* Z-index ladder */
    --mina-z-shell:    10;
    --mina-z-sticky:   20;
    --mina-z-overlay:  100;
    --mina-z-dialog:   1000;
}

/* Explicit dark — same as :root default; provided for [data-theme="dark"]
   selectors that some scripts might force. */
[data-theme="dark"] {
    color-scheme: dark;
}

/* Light mode — flips surfaces + text; keeps accents in semantic roles
   but darkens cyan for AA contrast on light backgrounds. */
[data-theme="light"] {
    color-scheme: light;

    --mina-bg-deep:    #F5F2FA;
    --mina-bg:         #FFFFFF;
    --mina-surface:    #FAF7FF;
    --mina-surface-2:  #F1ECFB;
    --mina-surface-3:  #E5DDF5;
    --mina-border:     #E5DDF5;
    --mina-border-2:   #C9B8E8;

    --mina-text:       #1A0F2E;
    --mina-text-2:     #3D2766;
    --mina-muted:      #6E5E8E;
    --mina-disabled:   #B5A8D5;

    --mina-accent:     #0099B3;
    --mina-accent-2:   #6D28D9;
    --mina-accent-on:  #FFFFFF;

    --mina-ok:         #16A34A;
    --mina-ok-soft:    rgba(22, 163, 74, 0.10);
    --mina-warn:       #B45309;
    --mina-warn-soft:  rgba(180, 83, 9, 0.10);
    --mina-err:        #BE185D;
    --mina-err-soft:   rgba(190, 24, 93, 0.10);
    --mina-thinking:   #7C3AED;

    --mina-shadow-sm:  0 1px 2px rgba(20, 8, 30, 0.06);
    --mina-shadow-md:  0 4px 16px rgba(20, 8, 30, 0.08),
                       0 1px 2px rgba(20, 8, 30, 0.04);
    --mina-shadow-lg:  0 16px 40px rgba(20, 8, 30, 0.12);
    --mina-glow-cyan:  0 0 0 1px rgba(0, 153, 179, 0.25),
                       0 0 18px -4px rgba(0, 153, 179, 0.35);
    --mina-grid-line:  rgba(124, 58, 237, 0.06);
}

/* prefers-reduced-motion: kill the pulse + collapse the transitions to
   instant. Operators with reduced-motion preferences get the same
   information without the heartbeat. */
@media (prefers-reduced-motion: reduce) {
    :root {
        --mina-fast: 0ms;
        --mina-base: 0ms;
        --mina-slow: 0ms;
    }
}
