/* Make the whole viewport a flex column */
html, body {
  height: 100%;
  margin: 0;
}

/* Overall layout */
body {
  display: flex;
  flex-direction: column;
  font-family: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

}

h1, h2, h3, h4, h5, h6,
header,
.sidebar,
.content,
#tree,
#path,
#link {
  font-family: inherit;   /* same as body */
}

header .hero-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40vh;        /* adjust as needed */
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Full-bleed hero image */
header .hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* fill without distortion */
  z-index: 0;
}

/* Title on top of the image */
header .hero-title {
  position: relative;
  max-width: 60%;
  color: #ffffff;
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  z-index: 1;
}

/* logo to the left of the title */
header .hero-logo-left {
  position: absolute;
  left: 5%;          /* distance from left edge */
  top: 50%;
  transform: translateY(-50%);  /* vertically center */
  height: 120px;      /* tweak size */
  width: auto;
  z-index: 1;        /* above image, same layer as title */
}

/* logo to the left of the title */
header .hero-logo-right {
  position: absolute;
  right: 5%;          /* distance from left edge */
  top: 50%;
  transform: translateY(-50%);  /* vertically center */
  height: 120px;      /* tweak size */
  width: auto;
  z-index: 1;        /* above image, same layer as title */
}

/* Main row: sidebar + content */
main.page {
  flex: 1;                 /* fill remaining height under header */
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 0;           /* allow children to control scrolling */
}

/* Header bar similar to .app-header-top */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background-color: #215732;
  color: #ffffff;
  border-bottom: 2px solid #12b628;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Sidebar-style column for the tree wrap */
.sidebar {
  background-color: #215732;
  color: #ffffff;
  padding: 1rem;
  width: 300px;
  box-sizing: border-box;
  overflow-y: auto;        /* its own scrollbar */
}

/* Main content area */
.content {
  flex: 1;
  padding: 1rem;
  background-color: #f5f5f5;
  color: #000000;
  box-sizing: border-box;
  overflow-y: auto;        /* its own scrollbar */
}

/* Tree container (#tree div) */
#tree {
  color: #ffffff;
  background-color: #215732;
  padding: 0.5rem;
  border-radius: 4px;
}

/* Basic tree UL reset */
#tree ul {
  list-style: none;
  padding-left: 1rem;
  margin: 0;
}

/* Individual nodes */
#tree li {
  margin: 2px 0;
}

/* Node labels similar to .q-tree__label */
.node-label {
  cursor: pointer;
  display: inline-block;
  padding: 2px 4px;
  border-radius: 3px;
  color: #ffffff;
}

/* Hover state similar to .q-tree__node:hover */
.node-label:hover {
  background-color: #12b628;
  color: #ffffff;
}

/* Selected node similar to .q-tree__node--selected */
.node-label.selected {
  background-color: #12b628;
  color: #ffffff;
}

/* Children indentation */
.children {
  margin-left: 1rem;
}

/* Path and link sections */
#path,
#link {
  font-family: monospace;
  font-size: 0.9rem;
  word-break: break-all;
}

/* Direct link input styling */
#link {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  border-radius: 3px;
  border: 1px solid #ccc;
}

/* Headings inside content */
h2 {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  color: #215732;
}

h3 {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  color: #ffffff;
}

/* keep everything in a single column without explicit .sidebar/.content: */

.page {
  display: grid;
  grid-template-columns: 300px 1fr;
}

/* Optional: hero/banner wrapper with an image later */
.hero-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40vh;
  width: 100vw;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-title {
  position: relative;
  max-width: 60%;
  color: #ffffff;
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  z-index: 1;
}

.hero-logo {
  position: absolute;
  left: 10%;
  bottom: 15%;
  height: 60px;
  width: auto;
}


.detail-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.detail-label {
  font-weight: 600;
  min-width: 9rem;
}

.detail-icon {
  margin-right: 0.25rem;
}

/* example badges */
.badge {
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  font-size: 0.85rem;
}

.badge-ex { background-color: #000000; }
.badge-ew { background-color: #532343; }
.badge-re { background-color: #9b4e97; }
.badge-cr { background-color: #d32001; }
.badge-en { background-color: #fc7f3f; }
.badge-vu { background-color: #f9e814; }
.badge-nt { background-color: #cce228; }
.badge-lc { background-color: #5dc757; }
.badge-dd { background-color: #d1d1c7; }
.badge-na { background-color: #c1b5a4; }
.badge-ne { background-color: #ffffff; }
.badge-esa { background-color: #c09c10; }

/* ============================================================
   Biobank Visualization — append these rules to css/style.css
   ============================================================ */

/* ── Container ─────────────────────────────────────────────── */
#biobank-viz {
  margin-top: 0.5rem;
  font-family: inherit;
}

/* ── Summary cards ─────────────────────────────────────────── */
.viz-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.viz-card {
  background: #f5f7f8;
  border: 1px solid #e0e4e6;
  border-radius: 6px;
  padding: 10px 18px;
  min-width: 90px;
  text-align: center;
}

.viz-card-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2e7d8e;
  line-height: 1.1;
}

.viz-card-lbl {
  font-size: 0.72rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

/* ── Legend ────────────────────────────────────────────────── */
.viz-legend {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: #555;
  margin: 8px 0 1.25rem;
}

.viz-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.viz-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* ── Overview bar chart SVG ────────────────────────────────── */
#biobank-viz svg {
  display: block;
  overflow: visible;
}

/* ── Overview breakdown table ──────────────────────────────── */
.viz-breakdown {
  margin-top: 1.25rem;
  overflow-x: auto;
}

.viz-table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}

.viz-table th {
  background: #f0f3f4;
  color: #555;
  font-weight: 600;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.viz-table td {
  padding: 5px 10px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.viz-cls-name {
  font-weight: 600;
  color: #333;
}

.viz-count {
  text-align: right;
  color: #2e7d8e;
  font-variant-numeric: tabular-nums;
}

.viz-heatmap-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 540px;
  border: 1px solid #dde2e4;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.viz-heatmap {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
}

.viz-heatmap thead th {
  position: sticky;
  top: 0;
  background: #f0f3f4;
  z-index: 2;
  padding: 7px 8px;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.viz-heatmap thead th.viz-hm-name {
  text-align: left;
  min-width: 160px;
  position: sticky;
  left: 0;
  z-index: 3;
}

.viz-heatmap tbody .viz-hm-row:hover td {
  background: #f0f7f9;
}

.viz-heatmap tbody td {
  padding: 4px 8px;
  border-bottom: 1px solid #eef1f2;
  vertical-align: middle;
}

.viz-hm-name {
  text-align: left;
  min-width: 160px;
  max-width: 220px;
  font-size: 11.5px;
  color: #333;
  position: sticky;
  left: 0;
  background: #fff;
}

.viz-hm-row:hover .viz-hm-name {
  background: #f0f7f9;
}

.viz-hm-status {
  text-align: center;
  white-space: nowrap;
}

.viz-hm-col {
  text-align: center;
  min-width: 68px;
  font-size: 11px;
  color: #666;
}

.viz-hm-total {
  text-align: center;
  font-weight: 600;
  font-size: 11.5px;
  color: #444;
  white-space: nowrap;
}

.viz-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.viz-dot-yes {
  background: #2e7d8e;
}

.viz-dot-no {
  background: #dde2e4;
}

.viz-iucn-badge {
  display: inline-block;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.viz-empty {
  color: #888;
  font-style: italic;
  padding: 1rem 0;
}

.viz-back {
  font-size: 12px;
  margin-top: 0.5rem;
}

.viz-back a {
  color: #2e7d8e;
  text-decoration: none;
}

.viz-back a:hover {
  text-decoration: underline;
}

.viz-species-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.viz-species-card {
  border: 1px solid #dde2e4;
  border-radius: 8px;
  padding: 14px 18px;
  background: #fafcfc;
}

.viz-sp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.viz-sp-common {
  font-size: 15px;
  font-weight: 600;
  color: #222;
}

.viz-sp-sci {
  font-size: 12px;
  font-style: italic;
  color: #777;
  margin-top: 2px;
}

.viz-sp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viz-sp-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid transparent;
}

.viz-sp-yes {
  background: #e0f4f6;
  border-color: #2e7d8e;
  color: #2e7d8e;
  font-weight: 600;
}

.viz-sp-no {
  background: #f5f5f5;
  border-color: #ddd;
  color: #aaa;
}

.viz-sp-yes .viz-sp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2e7d8e;
  flex-shrink: 0;
}

.viz-sp-no .viz-sp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
}

/* ── View toggle ───────────────────────────────────────────── */
.viz-toggle-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}

.viz-toggle-btn {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid #2e7d8e;
  border-radius: 20px;
  background: #fff;
  color: #2e7d8e;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: 0.02em;
}

.viz-toggle-btn:hover {
  background: #e0f4f6;
}

.viz-toggle-btn.active {
  background: #2e7d8e;
  color: #fff;
}

/* ── Chart area ────────────────────────────────────────────── */
.viz-chart-area {
  margin-bottom: 0.5rem;
}

.viz-table-area {
  margin-bottom: 0.5rem;
}

/* ── Species radial chart ──────────────────────────────────── */
.viz-sp-radial {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}
