/* Theme system using CSS variables scoped to body.theme-*. */
body.theme-night {
  --theme-bg: #f3f4f6;
  --theme-fg: #1b1f24;
  --theme-surface: #e6e9ee;
  --theme-muted: #4f5b68;
  --theme-border: #c5ccd6;
  --theme-link: #1f5fbf;
  --theme-btn-bg: #d9dee6;
  --theme-btn-fg: #1b1f24;
}

body.theme-midnight {
  --theme-bg: #eef1f5;
  --theme-fg: #1b2230;
  --theme-surface: #dde3ee;
  --theme-muted: #4a5563;
  --theme-border: #c0c9d6;
  --theme-link: #1c6aa8;
  --theme-btn-bg: #d2d9e3;
  --theme-btn-fg: #1b2230;
}

body.theme-graphite {
  --theme-bg: #f5f6f7;
  --theme-fg: #1d1f22;
  --theme-surface: #e7eaee;
  --theme-muted: #57606a;
  --theme-border: #cdd3da;
  --theme-link: #274b7a;
  --theme-btn-bg: #dde2e9;
  --theme-btn-fg: #1d1f22;
}

body.theme-sepia {
  --theme-bg: #f5efe7;
  --theme-fg: #2b241d;
  --theme-surface: #ece3d8;
  --theme-muted: #5c5247;
  --theme-border: #d6c8b8;
  --theme-link: #8a5a14;
  --theme-btn-bg: #e3d6c7;
  --theme-btn-fg: #2b241d;
}

body.theme-contrast {
  --theme-bg: #ffffff;
  --theme-fg: #000000;
  --theme-surface: #f0f0f0;
  --theme-muted: #000000;
  --theme-border: #000000;
  --theme-link: #0000ee;
  --theme-btn-bg: #ffffff;
  --theme-btn-fg: #000000;
}

body.theme-color-safe {
  --theme-bg: #f2f6f9;
  --theme-fg: #1b2330;
  --theme-surface: #e1e9f0;
  --theme-muted: #465260;
  --theme-border: #c3ced9;
  --theme-link: #0f67b2;
  --theme-btn-bg: #d7e1ea;
  --theme-btn-fg: #1b2330;
}

body.theme-night,
body.theme-midnight,
body.theme-graphite,
body.theme-sepia,
body.theme-contrast,
body.theme-color-safe {
  background-color: var(--theme-bg);
  color: var(--theme-fg);
}

body.theme-night .navbar-custom,
body.theme-midnight .navbar-custom,
body.theme-graphite .navbar-custom,
body.theme-sepia .navbar-custom,
body.theme-contrast .navbar-custom,
body.theme-color-safe .navbar-custom,
body.theme-night .footer,
body.theme-midnight .footer,
body.theme-graphite .footer,
body.theme-sepia .footer,
body.theme-contrast .footer,
body.theme-color-safe .footer,
body.theme-night .starter-template,
body.theme-midnight .starter-template,
body.theme-graphite .starter-template,
body.theme-sepia .starter-template,
body.theme-contrast .starter-template,
body.theme-color-safe .starter-template {
  background-color: var(--theme-surface);
  color: var(--theme-fg);
  border-color: var(--theme-border);
}

body.theme-night a,
body.theme-midnight a,
body.theme-graphite a,
body.theme-sepia a,
body.theme-contrast a,
body.theme-color-safe a {
  color: var(--theme-link);
}

body.theme-night .btn,
body.theme-midnight .btn,
body.theme-graphite .btn,
body.theme-sepia .btn,
body.theme-contrast .btn,
body.theme-color-safe .btn {
  color: var(--theme-btn-fg);
  background-color: var(--theme-btn-bg);
  border-color: var(--theme-border);
}

body.theme-night .btn.btn-dark,
body.theme-midnight .btn.btn-dark,
body.theme-graphite .btn.btn-dark,
body.theme-sepia .btn.btn-dark,
body.theme-contrast .btn.btn-dark,
body.theme-color-safe .btn.btn-dark {
  color: var(--theme-btn-fg);
  background-color: var(--theme-btn-bg);
  border-color: var(--theme-border);
}

body.theme-night .list-group-item,
body.theme-midnight .list-group-item,
body.theme-graphite .list-group-item,
body.theme-sepia .list-group-item,
body.theme-contrast .list-group-item,
body.theme-color-safe .list-group-item {
  background-color: var(--theme-surface);
  color: var(--theme-fg);
  border-color: var(--theme-border);
}

body.theme-night .text-muted,
body.theme-midnight .text-muted,
body.theme-graphite .text-muted,
body.theme-sepia .text-muted,
body.theme-contrast .text-muted,
body.theme-color-safe .text-muted {
  color: var(--theme-muted) !important;
}

body.theme-night .form-check-input,
body.theme-midnight .form-check-input,
body.theme-graphite .form-check-input,
body.theme-sepia .form-check-input,
body.theme-contrast .form-check-input,
body.theme-color-safe .form-check-input {
  background-color: var(--theme-surface);
  border-color: var(--theme-border);
}
