/* Every colour in the app. The student picks a theme on Me (js/themePrefs.js sets data-theme on <html>).
   Status colours mean the same in every theme: Present green, Absent rose, Not available slate. Brand red
   is only for the app's own frame (selection, active items, the date box, the header band), never a status.
   The pairs tests/ui/themes_css.test.mjs checks must stay at 4.5:1: change a background, not a status hue. */

/* Colours that are the same in every theme. */
:root {
    --moodle-orange: #f98012;
    --doc-page: #ffffff;
    --swatch-glow-bg: #0b0b0e;
    --swatch-glow-band: linear-gradient(160deg, #ff1e27, #8a0a12);
    --swatch-glow-line: #26262c;
    --swatch-glow-dot: #ffffff;
    --swatch-ember-bg: #0a0a0d;
    --swatch-ember-line: #26262c;
    --swatch-ember-dot: linear-gradient(135deg, #ff1e27, #ff6a3d);
    --swatch-paper-bg: #fbfaf8;
    --swatch-paper-border: #e6e3de;
    --swatch-paper-line: #e6e3de;
    --swatch-paper-dot: #ff1e27;
}

/* Crimson Glow: dark, with a slowly moving brand-red band behind the Calendar header. */
[data-theme="glow"] {
    color-scheme: dark;
    --color-bg: #0b0b0e;
    --color-surface: #141418;
    --color-surface-raised: #1c1c22;
    --color-surface-hover: #26262d;
    --color-border: #26262c;
    --color-border-strong: #3a3a44;
    --color-text: #f5f5f7;
    --color-text-muted: #a1a1ab;
    --color-on-strong: #ffffff;
    --color-brand: #ff1e27;
    --color-brand-strong: #d4101a;
    --color-brand-soft: rgba(255,30,39,.16);
    --brand-gradient: linear-gradient(135deg, #e0131c, #c10e17);
    --color-accent: #ff6a6f;
    --color-accent-strong: #d4101a;
    --color-accent-violet: #ff8a8e;
    --color-danger: #fb7185;
    --color-danger-bg: #402a32;
    --color-success: #34d399;
    --color-success-bg: #203935;
    --color-warning: #f4c95d;
    --color-warning-bg: #4a3c14;
    --overlay: rgba(2,2,4,.76);
    --glass: rgba(11,11,14,.94);
    --hero-surface: linear-gradient(160deg, #e0131c 0%, #c10e17 55%, #7a0910 100%);
    --hero-base: #e0131c;
    --hero-fade: linear-gradient(180deg, #7a0910 0%, #0b0b0e 100%);
    --hero-text: #ffffff;
    --hero-muted: #ffffff;
    --hero-animation: hero-drift 12s linear infinite alternate;
    --hero-pill-bg: #0b0b0e;
    --hero-focus: #ffffff;
    --seg-bg: rgba(0,0,0,.22);
    --seg-text: #ffffff;
    --seg-on-bg: #ffffff;
    --seg-on-base: #ffffff;
    --seg-on-text: #c10e17;
    --datebox-bg: rgba(255,255,255,.16);
    --datebox-border: rgba(255,255,255,.25);
    --datebox-cap: #ffffff;
    --datebox-text: #ffffff;
    --selected-bg: #ffffff;
    --selected-base: #ffffff;
    --selected-text: #c10e17;
    --today-text: #ff6a6f;
    --nav-on-bg: rgba(255,30,39,.14);
    --nav-on-text: #ffffff;
    --nav-on-icon: #ff1e27;
    --status-present: #34d399;
    --status-present-bg: #203935;
    --status-absent: #fb7185;
    --status-absent-bg: #402a32;
    --status-upcoming: #8ea3c0;
    --status-upcoming-bg: #2b3038;
    --status-loading-bg: #1c1c22;
    --badge-pdf: #ff8a8a;
    --badge-pdf-bg: rgba(255,107,107,.16);
    --badge-doc: #7fb2ff;
    --badge-doc-bg: rgba(88,146,255,.16);
    --badge-xls: #6fd8a0;
    --badge-xls-bg: rgba(78,201,138,.16);
    --badge-ppt: #ffb070;
    --badge-ppt-bg: rgba(255,153,77,.16);
    --badge-img: #c3a6ff;
    --badge-img-bg: rgba(167,139,250,.18);
    --badge-other: #b5bccb;
    --badge-other-bg: rgba(168,176,194,.14);
    --shadow-raised: 0 18px 50px rgba(0,0,0,.42);
    --shadow-card: 0 8px 24px rgba(0,0,0,.2);
    --focus-color: #ff6a6f;
}

/* Midnight Ember: dark, with a red → coral gradient on the selection, the active items and the date-box cap. */
[data-theme="ember"] {
    color-scheme: dark;
    --color-bg: #0a0a0d;
    --color-surface: #131318;
    --color-surface-raised: #1b1b21;
    --color-surface-hover: #24242b;
    --color-border: #222228;
    --color-border-strong: #34343d;
    --color-text: #f5f5f7;
    --color-text-muted: #9d9da8;
    --color-on-strong: #ffffff;
    --color-brand: #ff1e27;
    --color-brand-strong: #c80f18;
    --color-brand-soft: rgba(255,30,39,.14);
    --brand-gradient: linear-gradient(135deg, #c80f18, #d63a1a);
    --color-accent: #ff5a3c;
    --color-accent-strong: #c80f18;
    --color-accent-violet: #ff8a6a;
    --color-danger: #fb7185;
    --color-danger-bg: #3f2931;
    --color-success: #34d399;
    --color-success-bg: #1f3833;
    --color-warning: #f4c95d;
    --color-warning-bg: #4a3c14;
    --overlay: rgba(2,2,4,.76);
    --glass: rgba(10,10,13,.94);
    --hero-surface: #0a0a0d;
    --hero-base: #0a0a0d;
    --hero-fade: #0a0a0d;
    --hero-text: #f5f5f7;
    --hero-muted: #9d9da8;
    --hero-animation: none;
    --hero-pill-bg: #17171c;
    --hero-focus: #ff5a3c;
    --seg-bg: #17171c;
    --seg-text: #9d9da8;
    --seg-on-bg: linear-gradient(135deg, #c80f18, #d63a1a);
    --seg-on-base: #d63a1a;
    --seg-on-text: #ffffff;
    --datebox-bg: #17171c;
    --datebox-border: #2a2a31;
    --datebox-cap: linear-gradient(90deg, #ff1e27, #ff6a3d);
    --datebox-text: #f5f5f7;
    --selected-bg: linear-gradient(135deg, #c80f18, #d63a1a);
    --selected-base: #d63a1a;
    --selected-text: #ffffff;
    --today-text: #ff5a3c;
    --nav-on-bg: rgba(255,30,39,.12);
    --nav-on-text: #ffffff;
    --nav-on-icon: #ff5a3c;
    --status-present: #34d399;
    --status-present-bg: #1f3833;
    --status-absent: #fb7185;
    --status-absent-bg: #3f2931;
    --status-upcoming: #8ea3c0;
    --status-upcoming-bg: #2a2f37;
    --status-loading-bg: #1b1b21;
    --badge-pdf: #ff8a8a;
    --badge-pdf-bg: rgba(255,107,107,.16);
    --badge-doc: #7fb2ff;
    --badge-doc-bg: rgba(88,146,255,.16);
    --badge-xls: #6fd8a0;
    --badge-xls-bg: rgba(78,201,138,.16);
    --badge-ppt: #ffb070;
    --badge-ppt-bg: rgba(255,153,77,.16);
    --badge-img: #c3a6ff;
    --badge-img-bg: rgba(167,139,250,.18);
    --badge-other: #b5bccb;
    --badge-other-bg: rgba(168,176,194,.14);
    --shadow-raised: 0 18px 50px rgba(0,0,0,.42);
    --shadow-card: 0 8px 24px rgba(0,0,0,.2);
    --focus-color: #ff5a3c;
}

/* Paper (the default): light, near-black text on warm white, flat brand red for the selection and accents.
   :root:not([data-theme]) covers a page whose theme script didn't run. */
:root:not([data-theme]),
[data-theme="paper"] {
    color-scheme: light;
    --color-bg: #fbfaf8;
    --color-surface: #ffffff;
    --color-surface-raised: #f6f5f2;
    --color-surface-hover: #efedea;
    --color-border: #e4e1dc;
    --color-border-strong: #cfcac2;
    --color-text: #141416;
    --color-text-muted: #5f5f68;
    --color-on-strong: #ffffff;
    --color-brand: #ff1e27;
    --color-brand-strong: #d4101a;
    --color-brand-soft: rgba(255,30,39,.08);
    --brand-gradient: linear-gradient(135deg, #d4101a, #d4101a);
    --color-accent: #d4101a;
    --color-accent-strong: #b00d16;
    --color-accent-violet: #d4101a;
    --color-danger: #be123c;
    --color-danger-bg: #fde7eb;
    --color-success: #047857;
    --color-success-bg: #e3f5ee;
    --color-warning: #92400e;
    --color-warning-bg: #fef3c7;
    --overlay: rgba(20,20,22,.4);
    --glass: rgba(255,255,255,.94);
    --hero-surface: #fbfaf8;
    --hero-base: #fbfaf8;
    --hero-fade: #fbfaf8;
    --hero-text: #141416;
    --hero-muted: #5f5f68;
    --hero-animation: none;
    --hero-pill-bg: #ffffff;
    --hero-focus: #d4101a;
    --seg-bg: #efedea;
    --seg-text: #5f5f68;
    --seg-on-bg: #141416;
    --seg-on-base: #141416;
    --seg-on-text: #ffffff;
    --datebox-bg: #ffffff;
    --datebox-border: #e4e1dc;
    --datebox-cap: #ff1e27;
    --datebox-text: #141416;
    --selected-bg: #d4101a;
    --selected-base: #d4101a;
    --selected-text: #ffffff;
    --today-text: #d4101a;
    --nav-on-bg: rgba(255,30,39,.08);
    --nav-on-text: #141416;
    --nav-on-icon: #d4101a;
    --status-present: #047857;
    --status-present-bg: #e3f5ee;
    --status-absent: #be123c;
    --status-absent-bg: #fde7eb;
    --status-upcoming: #475569;
    --status-upcoming-bg: #eef0f3;
    --status-loading-bg: #efedea;
    --badge-pdf: #b42318;
    --badge-pdf-bg: #fde8e7;
    --badge-doc: #1d4ed8;
    --badge-doc-bg: #e5edff;
    --badge-xls: #047857;
    --badge-xls-bg: #e3f5ee;
    --badge-ppt: #b45309;
    --badge-ppt-bg: #fdf0e1;
    --badge-img: #6d28d9;
    --badge-img-bg: #efe8fd;
    --badge-other: #475569;
    --badge-other-bg: #eef0f3;
    --shadow-raised: 0 18px 50px rgba(20,20,22,.14);
    --shadow-card: 0 8px 24px rgba(20,20,22,.08);
    --focus-color: #d4101a;
}
