/*
* schoolapp dark theme
* Re-tokens the CSS custom properties defined in app.css for dark mode
* (no !important needed) + the few dark-only component rules that don't
* map to a token (button chrome, form fields, primary button).
* Activated via <html data-theme="dark">, set by js/theme.js.
*/

html[data-theme="light"] {
  color-scheme: light;
}
html[data-theme="dark"] {
  color-scheme: dark;
}

/* Dark re-token of app.css custom properties */
html[data-theme="dark"] {
  /* neutrals + brand */
  --c-text: #ddd;
  --c-muted: #999;
  --c-bg: #333;
  --c-surface: #2b2b2b;
  --c-fill: #444;
  --c-border: #666;
  --c-border-hover: #fff;
  --c-line: #555;

  --c-primary: #33C3F0;
  --c-primary-hover: #5fd3f5;
  --c-primary-fill: #188fb4;
  --c-primary-fill-hover: #1EAEDB;

  --c-input-bg: #aaa;
  --c-input-fg: #000;
  --c-input-border: #000;

  /* results */
  --res-danger-fg: #f0776f;
  --res-danger-bg: #7a3333;
  --res-success-fg: #8fce93;
  --res-success-bg: #2f5232;
  --res-warning-fg: #e0b34f;
  --res-warning-bg: #58582a;
  --res-info-fg: #6fa8dc;
  --res-info-bg: #2e5266;

  /* actions (act-delete follows --res-danger-bg) */
  --act-add: #58582a;
  --act-edit: #2e5266;
  --act-show: #3f3f7a;
  --act-back: #6b4f3a;

  /* accents */
  --c-accent: #5aa3e8;
  --c-accent-bg: #2e5266;
  --c-accent-hl: rgba(90, 163, 232, 0.15);
  --c-now-bg: rgba(230, 162, 60, 0.18);
  --c-now-line: rgba(230, 162, 60, 0.45);
}

/* Base
–––––––––––––––––––––––––––––––––––––––––––––––––– */
html[data-theme="dark"] body {
  background-color: var(--c-bg);
  color: var(--c-text);
}

/* Skeleton button chrome — dark values, no token (component shape) */
html[data-theme="dark"] .button,
html[data-theme="dark"] button,
html[data-theme="dark"] input[type="submit"],
html[data-theme="dark"] input[type="reset"],
html[data-theme="dark"] input[type="button"] {
  color: #CCC;
  border-color: #BBB;
}
html[data-theme="dark"] .button:hover,
html[data-theme="dark"] button:hover,
html[data-theme="dark"] input[type="submit"]:hover,
html[data-theme="dark"] input[type="reset"]:hover,
html[data-theme="dark"] input[type="button"]:hover {
  color: #CCC;
  border-color: var(--c-border-hover);
}
html[data-theme="dark"] .button:active,
html[data-theme="dark"] button:active,
html[data-theme="dark"] input[type="submit"]:active,
html[data-theme="dark"] input[type="reset"]:active,
html[data-theme="dark"] input[type="button"]:active {
  color: #333;
  border-color: #888;
  background-color: #DDD;
}
html[data-theme="dark"] .button.button-primary,
html[data-theme="dark"] button.button-primary,
html[data-theme="dark"] input[type="submit"].button-primary,
html[data-theme="dark"] input[type="reset"].button-primary,
html[data-theme="dark"] input[type="button"].button-primary {
  color: #FFF;
  background-color: var(--c-primary-fill);
  border-color: var(--c-primary-fill);
}
html[data-theme="dark"] .button.button-primary:hover,
html[data-theme="dark"] button.button-primary:hover,
html[data-theme="dark"] input[type="submit"].button-primary:hover,
html[data-theme="dark"] input[type="reset"].button-primary:hover,
html[data-theme="dark"] input[type="button"].button-primary:hover,
html[data-theme="dark"] .button.button-primary:active,
html[data-theme="dark"] button.button-primary:active,
html[data-theme="dark"] input[type="submit"].button-primary:active,
html[data-theme="dark"] input[type="reset"].button-primary:active,
html[data-theme="dark"] input[type="button"].button-primary:active {
  color: #FFF;
  background-color: var(--c-primary-fill-hover);
  border-color: var(--c-primary-fill);
}

/* Dark-only components (no light-theme counterpart to retoken) */
html[data-theme="dark"] .gradenotice {
  background-color: var(--c-fill);
}
