/*
 * Tahwl Plus visual themes.
 *
 * Component layout belongs in app.css. This file owns only semantic color
 * tokens so every theme can provide a light and a dark color mode.
 */

:root,
html[data-app-theme="tahwlplus"] {
    color-scheme: light;
    --theme-bg: #f8fafc;
    --theme-panel: #ffffff;
    --theme-text: #0f172a;
    --theme-muted: #64748b;
    --theme-line: #dbe4ee;
    --theme-primary: #0f766e;
    --theme-primary-dark: #115e59;
    --theme-danger: #b91c1c;
    --theme-warning: #a16207;

    /* Semantic surfaces */
    --surface-canvas: #f8fafc;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-soft: #f1f5f9;
    --surface-muted: #eef2f7;
    --surface-hover: #eef6f5;
    --surface-selected: #e6f4f1;
    --surface-overlay: rgba(15, 23, 42, .46);

    /* Semantic content and borders */
    --text-strong: #0f172a;
    --text-default: #1f2937;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --text-on-accent: #ffffff;
    --border-subtle: #e2e8f0;
    --border-default: #dbe4ee;
    --border-strong: #cbd5e1;
    --border-emphasis: #94a3b8;

    /* Brand and interaction */
    --accent: #0f766e;
    --accent-hover: #115e59;
    --accent-text: #0f766e;
    --accent-soft: #f0fdfa;
    --accent-soft-strong: #ccfbf1;
    --accent-border: #99d8d1;
    --focus-ring: rgba(15, 118, 110, .18);

    /* Status colors */
    --success-text: #047857;
    --success-surface: #ecfdf5;
    --success-border: #a7f3d0;
    --danger-text: #b91c1c;
    --danger-surface: #fef2f2;
    --danger-border: #fecaca;
    --warning-text: #a16207;
    --warning-surface: #fffbeb;
    --warning-border: #fde68a;
    --info-text: #1d4ed8;
    --info-surface: #eff6ff;
    --info-border: #bfdbfe;

    /* Elevation */
    --shadow-color: rgba(15, 23, 42, .12);
    --shadow-color-soft: rgba(15, 23, 42, .06);
    --shadow-color-strong: rgba(15, 23, 42, .20);
    --highlight-color: rgba(255, 255, 255, .58);

    /* Data visualization */
    --chart-1: #0f766e;
    --chart-2: #2563eb;
    --chart-3: #7c3aed;
    --chart-4: #db2777;
    --chart-5: #d97706;
    --chart-6: #059669;
    --chart-7: #0891b2;
    --chart-8: #4f46e5;

    /* Printed documents deliberately remain paper-oriented. */
    --print-page: #ffffff;
    --print-canvas: #f3f5f7;
    --print-text: #111827;
    --print-muted: #475569;
    --print-border: #4b5563;
    --print-border-soft: #cbd5e1;
    --print-heading: #e8eef5;
    --print-summary: #edf2f7;
    --print-accent: #0f766e;
    --print-accent-soft: #e6f4f1;
    --print-row-alternate: #fafafa;
    --print-danger: #9f1239;
    --print-shadow: rgba(15, 23, 42, .10);

    --bg: var(--theme-bg);
    --panel: var(--theme-panel);
    --text: var(--theme-text);
    --muted: var(--theme-muted);
    --line: var(--theme-line);
    --border: var(--border-default);
    --primary: var(--theme-primary);
    --primary-dark: var(--theme-primary-dark);
    --danger: var(--theme-danger);
    --warning: var(--theme-warning);
}

html[data-app-theme="blue"].theme-light {
    color-scheme: light;
    --theme-bg: #f7f9fd;
    --theme-panel: #ffffff;
    --theme-text: #172033;
    --theme-muted: #64748b;
    --theme-line: #d8e2f0;
    --theme-primary: #2563eb;
    --theme-primary-dark: #1d4ed8;

    --surface-canvas: #f7f9fd;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-soft: #f1f5fb;
    --surface-muted: #eaf0f8;
    --surface-hover: #eff6ff;
    --surface-selected: #dbeafe;
    --surface-overlay: rgba(15, 23, 42, .46);

    --text-strong: #0f172a;
    --text-default: #172033;
    --text-muted: #64748b;
    --text-subtle: #8b9bb2;
    --text-on-accent: #ffffff;
    --border-subtle: #e2e8f0;
    --border-default: #d8e2f0;
    --border-strong: #b8c7dc;
    --border-emphasis: #8295b2;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-text: #1d4ed8;
    --accent-soft: #eff6ff;
    --accent-soft-strong: #dbeafe;
    --accent-border: #93c5fd;
    --focus-ring: rgba(37, 99, 235, .20);

    --shadow-color: rgba(30, 64, 175, .13);
    --shadow-color-soft: rgba(30, 64, 175, .06);
    --shadow-color-strong: rgba(30, 64, 175, .22);
    --highlight-color: rgba(255, 255, 255, .62);

    --chart-1: #2563eb;
    --chart-2: #0891b2;
    --chart-3: #0f766e;
    --chart-4: #7c3aed;
    --chart-5: #db2777;
    --chart-6: #d97706;
    --chart-7: #059669;
    --chart-8: #4f46e5;
}

@media screen {
    html:not([data-app-theme]):not(.theme-light),
    html[data-app-theme="tahwlplus"]:not(.theme-light) {
        color-scheme: dark;
        --theme-bg: #0c1423;
        --theme-panel: #172236;
        --theme-text: #f4f7fb;
        --theme-muted: #a5b1c2;
        --theme-line: #2a3951;
        --theme-primary: #0f766e;
        --theme-primary-dark: #115e59;
        --theme-danger: #b91c1c;
        --theme-warning: #a16207;

        --surface-canvas: #0c1423;
        --surface: #172236;
        --surface-raised: #1c2940;
        --surface-soft: #1c2940;
        --surface-muted: #202e46;
        --surface-hover: #21314b;
        --surface-selected: #173a3b;
        --surface-overlay: rgba(0, 0, 0, .62);

        --text-strong: #f8fafc;
        --text-default: #f4f7fb;
        --text-muted: #a5b1c2;
        --text-subtle: #7f8da3;
        --text-on-accent: #ffffff;
        --border-subtle: #2a3951;
        --border-default: #31425e;
        --border-strong: #435675;
        --border-emphasis: #607089;

        --accent: #0f8479;
        --accent-hover: #2aa99d;
        --accent-text: #5eead4;
        --accent-soft: #132f33;
        --accent-soft-strong: #174944;
        --accent-border: #247a72;
        --focus-ring: rgba(45, 212, 191, .22);

        --success-text: #6ee7b7;
        --success-surface: #12382f;
        --success-border: #1f6b58;
        --danger-text: #fca5a5;
        --danger-surface: #451f2a;
        --danger-border: #7f3343;
        --warning-text: #fcd34d;
        --warning-surface: #44351a;
        --warning-border: #7c6022;
        --info-text: #93c5fd;
        --info-surface: #172f55;
        --info-border: #28548b;

        --shadow-color: rgba(0, 0, 0, .28);
        --shadow-color-soft: rgba(0, 0, 0, .18);
        --shadow-color-strong: rgba(0, 0, 0, .42);
        --highlight-color: rgba(255, 255, 255, .05);

        --chart-1: #2dd4bf;
        --chart-2: #60a5fa;
        --chart-3: #a78bfa;
        --chart-4: #f472b6;
        --chart-5: #fbbf24;
        --chart-6: #34d399;
        --chart-7: #22d3ee;
        --chart-8: #818cf8;

        --dark-surface: #111a2b;
        --dark-panel: #172236;
        --dark-panel-soft: #1c2940;
        --dark-control: #202e46;
        --dark-border: #31425e;
        --dark-text: #f4f7fb;
        --dark-muted: #a5b1c2;
    }

    html[data-app-theme="blue"]:not(.theme-light) {
        color-scheme: dark;
        --theme-bg: #0a1120;
        --theme-panel: #111c30;
        --theme-text: #f3f7ff;
        --theme-muted: #a7b5ca;
        --theme-line: #283a56;
        --theme-primary: #2563eb;
        --theme-primary-dark: #1d4ed8;

        --surface-canvas: #0a1120;
        --surface: #111c30;
        --surface-raised: #17243a;
        --surface-soft: #18263d;
        --surface-muted: #1d2d47;
        --surface-hover: #1c3152;
        --surface-selected: #163866;
        --surface-overlay: rgba(0, 0, 0, .64);

        --text-strong: #f8fafc;
        --text-default: #f3f7ff;
        --text-muted: #a7b5ca;
        --text-subtle: #7f91aa;
        --text-on-accent: #ffffff;
        --border-subtle: #283a56;
        --border-default: #334966;
        --border-strong: #49627f;
        --border-emphasis: #68809e;

        --accent: #2563eb;
        --accent-hover: #1d4ed8;
        --accent-text: #93c5fd;
        --accent-soft: #10264a;
        --accent-soft-strong: #163866;
        --accent-border: #285ea8;
        --focus-ring: rgba(96, 165, 250, .24);

        --success-text: #6ee7b7;
        --success-surface: #12382f;
        --success-border: #1f6b58;
        --danger-text: #fca5a5;
        --danger-surface: #451f2a;
        --danger-border: #7f3343;
        --warning-text: #fcd34d;
        --warning-surface: #44351a;
        --warning-border: #7c6022;
        --info-text: #93c5fd;
        --info-surface: #172f55;
        --info-border: #28548b;

        --shadow-color: rgba(0, 0, 0, .30);
        --shadow-color-soft: rgba(0, 0, 0, .19);
        --shadow-color-strong: rgba(0, 0, 0, .44);
        --highlight-color: rgba(255, 255, 255, .05);

        --chart-1: #60a5fa;
        --chart-2: #22d3ee;
        --chart-3: #2dd4bf;
        --chart-4: #a78bfa;
        --chart-5: #f472b6;
        --chart-6: #fbbf24;
        --chart-7: #34d399;
        --chart-8: #818cf8;

        --dark-surface: #0d1729;
        --dark-panel: #111c30;
        --dark-panel-soft: #17243a;
        --dark-control: #1d2d47;
        --dark-border: #334966;
        --dark-text: #f3f7ff;
        --dark-muted: #a7b5ca;
    }
}
