/* ============================================================
   MedRecords.ai — OHIF DICOM Viewer Theme (2026 refresh)
   LIGHT EARTHY theme — warm paper, white cards, forest accents,
   warm hairlines — matching the MedRecords design system.
   Every legacy blue/navy icon, border and surface is remapped.
   Loaded after app.bundle.css.
   ============================================================ */

/* Brand font for the wordmark */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:wght@500;600&display=swap');

:root {
  /* Surfaces — warm paper + white cards */
  --background: 0 0% 100%;         /* #FFFFFF white */
  --card: 0 0% 100%;              /* #FFFFFF */
  --card-foreground: 43 19% 7%;   /* #16140F ink */
  --popover: 0 0% 100%;
  --popover-foreground: 43 19% 7%;
  --muted: 40 29% 94%;            /* #F4F1EB raised */
  --muted-foreground: 43 8% 40%;  /* #6C685E slate-soft */
  --border: 43 23% 88%;           /* #E7E3D9 hairline */
  --input: 43 23% 88%;
  --secondary: 142 30% 92%;       /* #E4EFE8 verify-wash */
  --secondary-foreground: 153 39% 30%;
  --accent: 150 33% 95%;          /* #F1F7F3 forest-tint */
  --accent-foreground: 150 40% 25%;

  /* Text — ink */
  --foreground: 43 19% 7%;
  --primary-foreground: 0 0% 100%;

  /* Accent / action — forest */
  --primary: 153 39% 30%;         /* #2F6B50 */
  --ring: 153 39% 30%;
  --highlight: 153 39% 30%;
  --neutral: 44 7% 30%;
  --neutral-light: 43 8% 51%;
  --neutral-dark: 43 19% 7%;

  /* Semantic — status only */
  --destructive: 12 53% 49%;      /* #C0563B */
  --destructive-foreground: 0 0% 100%;

  /* Charts */
  --chart-1: 153 39% 30%;
  --chart-2: 150 40% 25%;
  --chart-3: 40 59% 45%;
  --chart-4: 248 60% 59%;
  --chart-5: 12 53% 49%;

  /* Notification chips — design-system washes */
  --success-bg: #E4EFE8;
  --success-border: #C9DFD2;
  --success-text: #2F6B50;
  --info-bg: #F1F7F3;
  --info-border: #D5E8DE;
  --info-text: #275A43;
  --warning-bg: #F4E9CD;
  --warning-border: #E7D5A4;
  --warning-text: #8A6420;
  --error-bg: #F5E1DA;
  --error-border: #E9C2B7;
  --error-text: #C0563B;
}

/* ── JS-inline icon colors → forest / ink ─────────────────── */
[fill="#348CFD"], [fill="#358CFD"], [fill="#5ACCE6"],
[fill="#3A3F99"], [fill="#0944B3"], [fill="#3378C8"],
[fill="#263A71"], [fill="#1A3F7E"], [fill="#090C29"],
[fill="#041C4A"], [fill="#06081D"], [fill="#1F2937"],
[fill="#111827"] {
  fill: #2F6B50 !important;
}
[stroke="#348CFD"], [stroke="#358CFD"], [stroke="#5ACCE6"],
[stroke="#3A3F99"], [stroke="#0944B3"], [stroke="#3378C8"],
[stroke="#263A71"], [stroke="#1A3F7E"], [stroke="#090C29"] {
  stroke: #2F6B50 !important;
}
/* Lowercase hex variants (attribute selectors are case-sensitive) */
[fill="#348cfd"], [stroke="#348cfd"],
[fill="#358cfd"], [stroke="#358cfd"],
[fill="#5acce6"], [stroke="#5acce6"],
[fill="#0944b3"], [fill="#3378c8"] {
  fill: #2F6B50 !important;
  stroke: #2F6B50 !important;
}
[fill="#000000"] { fill: #16140F !important; }
/* Dark circle / ring icon → ink + mint */
[fill="#0D0E24"] { fill: #16140F !important; }
[stroke="#7BB2CE"] { stroke: #7FB89B !important; }

/* ── Mode launch buttons (expanded study rows) ────────────── */
/* Valid modes: forest fill + white text/icon (compound selectors —
   the button carries both classes on the same element). */
button.bg-primary-main,
button.bg-primary,
button.bg-primary-active {
  color: #FFFFFF !important;
}
button.bg-primary-main svg,
button.bg-primary svg,
button.bg-primary-active svg,
button.bg-primary-main .text-black,
button.bg-primary .text-black,
button.bg-primary-active .text-black {
  color: #FFFFFF !important;
  fill: #FFFFFF !important;
  stroke: #FFFFFF !important;
}

/* Disabled modes: light surface + muted text/icon */
button[disabled] {
  background-color: #F4F1EB !important;
  color: #8A857A !important;
}
button[disabled] svg,
button[disabled] path,
button[disabled] circle {
  fill: #8A857A !important;
  stroke: #8A857A !important;
  color: #8A857A !important;
}

/* Arbitrary dark classes used by the build */
.bg-\[\#04225b\] { background-color: #FFFFFF !important; }
.bg-\[\#222d44\] { background-color: #F4F1EB !important; }

/* Legacy customblue hovers → forest */
.hover\:bg-customblue-80:hover { background-color: #275A43 !important; }
.active\:bg-customblue-40:active { background-color: #1E452F !important; }
.hover\:bg-customblue-50:hover { background-color: #E4EFE8 !important; }

/* ── Sidebar / panel icons & selected states ─────────────── */
/* Unselected sidebar icons (list/tab toggles) — blue → neutral slate */
.text-actions-primary {
  color: #6C685E !important;
}
/* Selected toggle stays forest */
button[data-state="on"].text-actions-primary,
[data-state="on"] .text-actions-primary {
  color: #2F6B50 !important;
}

/* OHIF "customblue" palette (buttons, selected rows, chips) → forest */
.bg-customblue-10,
.bg-customblue-20,
.bg-customblue-30,
.bg-customblue-40,
.bg-customblue-50,
.bg-customblue-60,
.bg-customblue-70,
.bg-customblue-80,
.bg-customblue-90,
.bg-customblue-100 {
  background-color: #2F6B50 !important;
}
.text-customblue-10,
.text-customblue-20,
.text-customblue-30,
.text-customblue-40,
.text-customblue-50,
.text-customblue-60,
.text-customblue-70,
.text-customblue-80,
.text-customblue-90,
.text-customblue-100 {
  color: #2F6B50 !important;
}
.border-customblue-10,
.border-customblue-20,
.border-customblue-30,
.border-customblue-40,
.border-customblue-50,
.border-customblue-60,
.border-customblue-70,
.border-customblue-80,
.border-customblue-90,
.border-customblue-100 {
  border-color: #2F6B50 !important;
}

/* ── Results-per-page dropdown — white + ink ──────────────── */
.customSelect__control {
  background-color: #FFFFFF !important;
  color: #16140F !important;
}
.customSelect__single-value,
.customSelect__input,
.customSelect__indicator,
.customSelect__option {
  color: #16140F !important;
}

/* ── Legacy OHIF blue/navy color classes → light earthy ───── */

/* Backgrounds */
.bg-primary-dark { background-color: #F4F1EB !important; }
.bg-primary-main { background-color: #2F6B50 !important; }
.bg-primary-active { background-color: #2F6B50 !important; }
.bg-primary-light { background-color: #F1F7F3 !important; }
.bg-secondary-dark { background-color: #FFFFFF !important; border-bottom: 1px solid #E7E3D9 !important; }
.bg-secondary-light { background-color: #E4EFE8 !important; }
.bg-bkg-low { background-color: #FAF9F5 !important; }
.bg-bkg-med { background-color: #FFFFFF !important; }

/* Text */
.text-primary-light { color: #2F6B50 !important; }
.text-primary-dark { color: #275A43 !important; }
.text-primary-main { color: #2F6B50 !important; }
.text-primary-active { color: #2F6B50 !important; }
.text-secondary-light { color: #3E8862 !important; }
.text-aqua-pale { color: #6C685E !important; }

/* Borders — warm hairline / forest */
.border-primary-light { border-color: #7FB89B !important; }
.border-primary-dark { border-color: #E7E3D9 !important; }
.border-primary-main { border-color: #2F6B50 !important; }
.border-primary-active { border-color: #3E8862 !important; }
.border-secondary-light { border-color: #E4EFE8 !important; }
.border-white\/10 { border-color: #E7E3D9 !important; }
.border-white\/20 { border-color: #E7E3D9 !important; }

/* Hover states — light forest tint, never heavy green */
.hover\:bg-primary-dark:hover,
.hover\:bg-primary-active:hover,
.hover\:bg-primary\/20:hover,
.hover\:bg-primary\/30:hover,
.hover\:bg-primary\/40:hover {
  background-color: #F1F7F3 !important;
}
.hover\:text-primary-dark:hover,
.hover\:text-primary-light:hover,
.hover\:text-primary-main:hover,
.hover\:text-primary-active:hover {
  color: #2F6B50 !important;
}
.hover\:border-primary-dark:hover,
.hover\:border-primary-light:hover,
.hover\:border-primary-main:hover,
.hover\:border-primary-active:hover {
  border-color: #2F6B50 !important;
}

/* Icon strokes */
.stroke-secondary-light { stroke: #2F6B50 !important; }

/* ── Inputs / selects — indigo borders → warm ─────────────── */
.border-inputfield-main {
  border-color: #E7E3D9 !important;
}
.focus\:border-inputfield-focus:focus {
  border-color: #2F6B50 !important;
}
.customSelect__control {
  border-color: #E7E3D9 !important;
}
.customSelect__control:hover,
.customSelect__control--menu-is-open {
  border-color: #2F6B50 !important;
}

/* ── Study list header titles — white-on-paper → ink ──────── */
.text-\[20px\].text-white {
  color: #16140F !important;
}

/* ── Hardcoded chrome ─────────────────────────────────────── */

/* Top bar — white with forest items */
.bg-secondary-dark,
.bg-secondary-dark * {
  color: #16140F !important;
}

/* App roots / side panels — black → paper / white */
.bg-black {
  background-color: #FAF9F5 !important;
}
.bg-black.border-black {
  background-color: #FFFFFF !important;
  border-color: #E7E3D9 !important;
}

/* Image viewport stays black (grayscale DICOM reading) */
.bg-black.flex-1 {
  background-color: #000000 !important;
}

/* Loading splash — paper + forest spinner */
div[class*="z-50"][class*="bg-black"][class*="items-center"] {
  background-color: #FAF9F5 !important;
}
div[class*="z-50"][class*="bg-black"][class*="items-center"] svg {
  fill: #2F6B50 !important;
  color: #2F6B50 !important;
}

/* White-on-white safety net */
.bg-white,
.bg-card {
  color: #16140F !important;
}

/* Any hardcoded white text becomes ink on light surfaces —
   kept white only inside dark/colored fills (image overlay,
   forest buttons, the dark-green table header). */
.text-white {
  color: #16140F !important;
}
.bg-black.flex-1 .text-white,
.bg-primary .text-white,
.bg-primary-main .text-white,
.bg-primary-active .text-white {
  color: #FFFFFF !important;
}

/* Form controls — dark text on white */
input,
textarea,
select {
  color: #16140F !important;
}
input::placeholder,
textarea::placeholder {
  color: #8A857A !important;
  opacity: 1 !important;
}

/* Remaining white borders → warm hairline */
.border-white,
.border-white\/5,
.border-white\/30,
.border-white\/40 {
  border-color: #E7E3D9 !important;
}

/* ── Scrollbars — warm light ──────────────────────────────── */
.ohif-scrollbar::-webkit-scrollbar-thumb,
.ohif-scrollbar::-webkit-scrollbar-thumb:window-inactive {
  background-color: #2F6B50 !important;
}
.ohif-scrollbar::-webkit-scrollbar-track {
  background-color: #F4F1EB !important;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #F4F1EB;
}
::-webkit-scrollbar-thumb {
  background: #D8D3C7;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2F6B50;
}

/* ── Custom selects / dropdowns — white + forest focus ────── */
.customSelect__menu-portal .customSelect__menu {
  background-color: #FFFFFF !important;
  border: 2px solid #2F6B50 !important;
  color: #16140F !important;
}
.customSelect__option--is-focused,
.customSelect__menu-portal .customSelect__option:hover {
  background-color: rgba(47, 107, 80, 0.12) !important;
  color: #16140F !important;
}
.customSelect__menu-portal .customSelect__menu-list::-webkit-scrollbar-thumb {
  background-color: #2F6B50 !important;
}

/* ── Line charts — warm hairlines ─────────────────────────── */
.LineChart svg {
  border: 1px solid #E7E3D9 !important;
  color: #514E46 !important;
}
.LineChart svg .axis.grid .tick line {
  stroke: #E7E3D9 !important;
}

/* ── Brand wordmark — Newsreader ──────────────────────────── */
.logo-text,
.ime-logo,
.header-branding {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  letter-spacing: -0.011em;
}

/* Loading indicator — forest */
.loading-indicator,
.progress-bar-indicator {
  background-color: #2F6B50 !important;
}
