@font-face {
  font-family: "Figtree";
  src: url("Figtree-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Figtree";
  src: url("Figtree-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --brand-green: #0b5126;
  --brand-navy: #24226f;
  --brand-blue: #7cc6fe;
  --brand-purple: #8789c0;
  --brand-orange: #f06449;

  --lighter-bg: #e2e4ff;

  --border: rgba(36, 34, 111, 0.15);
  --text-muted: rgba(36, 34, 111, 0.75);
}

html,
body,
#react-entry-point {
  height: 100%;
  margin: 0;
}

html,
body {
  color: var(--brand-navy);
  background-color: var(--lighter-bg);
  overflow-x: hidden; 
}

.app-shell {
  width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
}

.js-plotly-plot,
.plot-container,
.dash-graph {
  min-width: 0 !important;
}

/* apply figtree everywhere EXCEPT icons */
html,
body,
.dash-text,
.dash-title,
.dash-table,
.control-label,
.Select-control {
  font-family: "Figtree", system-ui, -apple-system, Segoe UI, sans-serif !important;
}

/* do not override Font Awesome */
.fa,
.fas,
.far,
.fal,
.fab,
[class*="fa-"] {
  font-family: initial !important;
}

/* navbar */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 96px;
  padding: 0 28px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: linear-gradient(90deg, #ffffff 0%, #f6f7ff 100%);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

/* header content spacing */
.navbar > div:first-child {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* sidebar */

.sidebar {
  background-color: #ffffff;
  border-right: 1px solid var(--border);
  box-shadow: none;
  overflow-x: hidden;
}

/* section cards inside sidebar */
.sidebar-section {
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
  background-color: #ffffff;
}

.sidebar-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-navy);
  margin-bottom: 8px;
}

/* nav items */
.nav-radio label {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 8px 10px;
  border-radius: 10px;

  cursor: pointer;
  font-weight: 500;
  color: var(--brand-navy);
}

.nav-radio label:hover {
  background: rgba(124, 198, 254, 0.2);
}

.Select-control {
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.Select.is-focused > .Select-control {
  border-color: var(--brand-blue) !important;
}


.main {
  background: transparent !important;
  min-width: 0; 
}

.panel-card {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 16px;
  min-width: 0; 
}

/* headings */
h1,
h2,
h3,
h4,
h5 {
  color: var(--brand-navy);
  margin-top: 0;
}

/* links */
a {
  color: var(--brand-green);
  text-decoration: none;
}

a:hover {
  color: var(--brand-orange);
}

/* table tweaks */
.dash-table-container {
  margin-top: 10px;
}

.dash-spreadsheet-container {
  border-radius: 12px;
}

/* optional nav-link style (if used elsewhere) */
.nav-link {
  color: var(--brand-navy);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
}

.nav-link:hover {
  background: rgba(124, 198, 254, 0.2);
  color: var(--brand-navy);
}

/* domain divergence bar charts */
.domain-bars-row {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.domain-bar-col {
  flex: 1;
  min-width: 0;
}

/* about panel info cards */
.info-card {
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border-left: 4px solid;
}

.info-card--imd {
  background: #f0faf0;
  border-left-color: #27ae60;
}

.info-card--ppfi {
  background: #eef4ff;
  border-left-color: #2255aa;
}

/* accessibility: keyboard focus styles */

/* visible focus ring on all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* focus on summary (collapsible sections) */
summary:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 8px;
}

/* accessibility, fieldset/legend resets */

/* fieldset used as sidebar section card */
fieldset.sidebar-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  background-color: #ffffff;
  position: relative;
  min-width: 0;
}

/* visually hidden legend. screen readers still read it */
fieldset.sidebar-section > legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* sidebar collapsibles */

details.sidebar-collapsible {
  padding: 0;
  overflow: visible;
}

details.sidebar-collapsible > summary.sidebar-collapsible-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-navy);
  user-select: none;
  border-radius: 10px;
}

details.sidebar-collapsible > summary.sidebar-collapsible-summary::-webkit-details-marker {
  display: none;
}

details.sidebar-collapsible > summary.sidebar-collapsible-summary::after {
  content: "▾";
  font-size: 14px;
  font-weight: 400;
  color: var(--brand-navy);
  transition: transform 0.2s;
  text-transform: none;
}

details.sidebar-collapsible[open] > summary.sidebar-collapsible-summary::after {
  transform: rotate(-180deg);
}

details.sidebar-collapsible > summary.sidebar-collapsible-summary:hover {
  background: rgba(124, 198, 254, 0.15);
}

details.sidebar-collapsible > *:not(summary) {
  padding: 0 10px 10px 10px;
}

/* how-to accordion for abt panel */

.how-to-accordion details {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
}

.accordion-summary {
  font-family: "Figtree", system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--brand-navy);
  background: #f6f7ff;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary::after {
  content: "+";
  font-size: 18px;
  font-weight: 400;
  color: var(--brand-navy);
  transition: transform 0.2s;
}

details[open] > .accordion-summary::after {
  content: "−";
}

.accordion-summary:hover {
  background: rgba(124, 198, 254, 0.15);
}

.accordion-body {
  padding: 10px 14px;
  background: #ffffff;
}

/* loading overlay (CSS-only, uses data-dash-is-loading) */

.dash-graph {
  position: relative;
}

.dash-graph[data-dash-is-loading="true"]::before {
  content: "";
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.65);
  z-index: 19;
  pointer-events: none;
}

.dash-graph[data-dash-is-loading="true"]::after {
  content: "";
  position: absolute;
  top: calc(50% + 20px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border: 4px solid rgba(36, 34, 111, 0.2);
  border-top-color: #24226f;
  border-radius: 50%;
  animation: map-spin 0.75s linear infinite;
  z-index: 20;
  pointer-events: none;
}

@keyframes map-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* side bar scrolljng */

.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(36, 34, 111, 0.2) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(36, 34, 111, 0.2);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(36, 34, 111, 0.4);
}

/* mismatch map panel */
#mismatch_map_panel {
  min-width: 0;
}

#mismatch_map_panel .dash-graph {
  flex: 1;
  min-height: 0;
}
