/*
 * CorpsGuide light/dark theming for the static-SSR marketing site (plan §6.2).
 *
 * MudBlazor components read --mud-palette-* custom properties. MudThemeProvider emits the LIGHT
 * palette at :root (the site's no-JS / crawler default). This file layers dark and explicit-light
 * overrides with higher specificity (attribute selectors beat :root), so:
 *
 *   - no explicit choice + OS dark          -> system media block below
 *   - user toggled to dark  (data-theme)    -> :root[data-theme="dark"]
 *   - user toggled to light (data-theme)    -> :root[data-theme="light"]  (forces light on OS dark)
 *   - no explicit choice + OS light         -> MudThemeProvider's :root light (nothing needed here)
 *
 * theme.js writes data-theme; the inline bootstrap in App.razor sets it before first paint (no FOUC).
 * Values mirror CorpsGuideTheme.cs, which mirrors the MAUI app.
 */

/* ----- Dark palette (shared by explicit-dark and OS-dark-without-choice) ----- */
:root[data-theme="dark"],
:root[data-theme="dark"] .mud-theme-provider {
    --mud-palette-primary: #8FA374;
    --mud-palette-primary-rgb: 143, 163, 116;
    --mud-palette-primary-text: #12131a;
    --mud-palette-secondary: #a08658;
    --mud-palette-secondary-text: #12131a;
    --mud-palette-background: #1a1a27;
    --mud-palette-background-gray: #151521;
    --mud-palette-surface: #1e1e2d;
    --mud-palette-appbar-background: #1a1a27;
    --mud-palette-appbar-text: #c0c0c0;
    --mud-palette-drawer-background: #1a1a27;
    --mud-palette-drawer-text: #92929f;
    --mud-palette-drawer-icon: #92929f;
    --mud-palette-text-primary: #e0e0e0;
    --mud-palette-text-secondary: #92929f;
    --mud-palette-text-disabled: #ffffff33;
    --mud-palette-action-default: #74718e;
    --mud-palette-action-disabled: #9999994d;
    --mud-palette-action-disabled-background: #605f6d4d;
    --mud-palette-divider: #292838;
    --mud-palette-lines-default: #33323e;
    --mud-palette-lines-inputs: #33323e;
    --mud-palette-table-lines: #33323e;
    --mud-palette-table-striped: rgba(255, 255, 255, 0.03);
    --mud-palette-overlay-light: #1e1e2d80;
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --mud-palette-primary: #8FA374;
        --mud-palette-primary-rgb: 143, 163, 116;
        --mud-palette-primary-text: #12131a;
        --mud-palette-secondary: #a08658;
        --mud-palette-secondary-text: #12131a;
        --mud-palette-background: #1a1a27;
        --mud-palette-background-gray: #151521;
        --mud-palette-surface: #1e1e2d;
        --mud-palette-appbar-background: #1a1a27;
        --mud-palette-appbar-text: #c0c0c0;
        --mud-palette-drawer-background: #1a1a27;
        --mud-palette-drawer-text: #92929f;
        --mud-palette-drawer-icon: #92929f;
        --mud-palette-text-primary: #e0e0e0;
        --mud-palette-text-secondary: #92929f;
        --mud-palette-text-disabled: #ffffff33;
        --mud-palette-action-default: #74718e;
        --mud-palette-action-disabled: #9999994d;
        --mud-palette-action-disabled-background: #605f6d4d;
        --mud-palette-divider: #292838;
        --mud-palette-lines-default: #33323e;
        --mud-palette-lines-inputs: #33323e;
        --mud-palette-table-lines: #33323e;
        --mud-palette-table-striped: rgba(255, 255, 255, 0.03);
        --mud-palette-overlay-light: #1e1e2d80;
        color-scheme: dark;
    }
}

/* ----- Explicit light (forces light even when the OS prefers dark) ----- */
:root[data-theme="light"],
:root[data-theme="light"] .mud-theme-provider {
    --mud-palette-primary: #455925;
    --mud-palette-primary-rgb: 69, 89, 37;
    --mud-palette-primary-text: #ffffff;
    --mud-palette-secondary: #C8AD7F;
    --mud-palette-secondary-text: #2b2b2b;
    --mud-palette-background: #f6f6f4;
    --mud-palette-background-gray: #e0e0d6;
    --mud-palette-surface: #ffffff;
    --mud-palette-appbar-background: #455925;
    --mud-palette-appbar-text: #ffffff;
    --mud-palette-drawer-background: #f4f4f1;
    --mud-palette-drawer-text: #333333;
    --mud-palette-drawer-icon: #555555;
    --mud-palette-text-primary: #2b2b2b;
    --mud-palette-text-secondary: #555555;
    --mud-palette-text-disabled: #999999;
    --mud-palette-action-default: #606060;
    --mud-palette-action-disabled: #bdbdbd;
    --mud-palette-action-disabled-background: #e0e0e0;
    --mud-palette-divider: #d2d2d2;
    --mud-palette-lines-default: #cccccc;
    --mud-palette-lines-inputs: #cccccc;
    --mud-palette-table-lines: #dddddd;
    --mud-palette-table-striped: rgba(0, 0, 0, 0.02);
    --mud-palette-overlay-light: rgba(255, 255, 255, 0.5);
    color-scheme: light;
}

:root:not([data-theme]) {
    color-scheme: light;
}
