/*
 * Colour themes of the application. The theme is chosen under Master Data > Appearance and is put on the
 * <html> element as data-theme; "royal" is the look defined in theme-premium.css itself, so it needs nothing here.
 * A theme only re-colours: it changes the variables the pages are drawn with, never the layout.
 */

/* Emerald: deep green navigation, green accent */
html[data-theme="emerald"] {
  --pt-bg: #f2f7f5;
  --pt-navy: #063b2e;
  --pt-navy-2: #0b6b4f;
  --pt-accent: #0a8f65;
  --pt-accent-dark: #087452;
  --pt-accent-soft: #e8f7f1;
  --bs-primary: #0a8f65;
  --bs-primary-rgb: 10, 143, 101;
  --bs-link-color: #0a8f65;
  --bs-link-hover-color: #087452;
  /* marking screens (marking-theme.css) and the login pages (custom-login.css) */
  --mk-navy: #063b2e;
  --mk-navy-2: #0b6b4f;
  --mk-blue: #0a8f65;
  --mk-blue-soft: #e8f7f1;
  --primary: #0b6b4f;
  --primary-dark: #063b2e;
  --accent: #0a8f65;
  --accent-glow: rgba(10, 143, 101, 0.4);
  --card-shadow: 0 20px 40px -10px rgba(6, 59, 46, 0.25);
  --ap-overlay: 6, 59, 46;
}

/* Maroon: wine red navigation, crimson accent */
html[data-theme="maroon"] {
  --pt-bg: #f8f4f5;
  --pt-navy: #4a0f22;
  --pt-navy-2: #861d3d;
  --pt-accent: #b4234c;
  --pt-accent-dark: #951c3e;
  --pt-accent-soft: #fdeef2;
  --bs-primary: #b4234c;
  --bs-primary-rgb: 180, 35, 76;
  --bs-link-color: #b4234c;
  --bs-link-hover-color: #951c3e;
  /* marking screens (marking-theme.css) and the login pages (custom-login.css) */
  --mk-navy: #4a0f22;
  --mk-navy-2: #861d3d;
  --mk-blue: #b4234c;
  --mk-blue-soft: #fdeef2;
  --primary: #861d3d;
  --primary-dark: #4a0f22;
  --accent: #b4234c;
  --accent-glow: rgba(180, 35, 76, 0.4);
  --card-shadow: 0 20px 40px -10px rgba(74, 15, 34, 0.25);
  --ap-overlay: 74, 15, 34;
}

/* What Bootstrap paints in its own blue follows the accent of the theme */
html[data-theme="emerald"] .btn-primary, html[data-theme="maroon"] .btn-primary,
html[data-theme="emerald"] .bg-primary:not(.topbar), html[data-theme="maroon"] .bg-primary:not(.topbar) {
  background-color: var(--pt-accent) !important;
  border-color: var(--pt-accent) !important;
}
html[data-theme="emerald"] .btn-primary:hover, html[data-theme="maroon"] .btn-primary:hover {
  background-color: var(--pt-accent-dark) !important;
  border-color: var(--pt-accent-dark) !important;
}
html[data-theme="emerald"] .btn-outline-primary, html[data-theme="maroon"] .btn-outline-primary {
  color: var(--pt-accent);
  border-color: var(--pt-accent);
}
html[data-theme="emerald"] .btn-outline-primary:hover, html[data-theme="maroon"] .btn-outline-primary:hover,
html[data-theme="emerald"] .btn-outline-primary.active, html[data-theme="maroon"] .btn-outline-primary.active {
  color: #fff;
  background-color: var(--pt-accent);
  border-color: var(--pt-accent);
}
html[data-theme="emerald"] .text-primary, html[data-theme="maroon"] .text-primary { color: var(--pt-accent) !important; }
html[data-theme="emerald"] .code-chip, html[data-theme="maroon"] .code-chip {
  color: var(--pt-accent) !important;
  background: var(--pt-accent-soft) !important;
}
html[data-theme="emerald"] .code-chip-solid, html[data-theme="maroon"] .code-chip-solid {
  color: #fff !important;
  background: var(--pt-accent) !important;
}
html[data-theme="emerald"] .form-control:focus, html[data-theme="maroon"] .form-control:focus,
html[data-theme="emerald"] .form-select:focus, html[data-theme="maroon"] .form-select:focus {
  border-color: var(--pt-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pt-accent) 18%, transparent);
}
html[data-theme="emerald"] .form-check-input:checked, html[data-theme="maroon"] .form-check-input:checked {
  background-color: var(--pt-accent);
  border-color: var(--pt-accent);
}
html[data-theme="emerald"] .page-link.active, html[data-theme="maroon"] .page-link.active,
html[data-theme="emerald"] .active > .page-link, html[data-theme="maroon"] .active > .page-link {
  background-color: var(--pt-accent);
  border-color: var(--pt-accent);
}

/* Login pages: the tint over the picture follows the theme too */
html[data-theme="emerald"] .banner-overlay, html[data-theme="maroon"] .banner-overlay {
  background: linear-gradient(to top, rgba(var(--ap-overlay), 0.95), rgba(var(--ap-overlay), 0.6), transparent);
}
