/* ═══════════════════════════════════════════════════════════════════════════
   style.css — Exhibition Showcase "Health Digital Twin"
   Dark premium theme · Glassmorphism · Animated gauge · R/G/B toggles
   Optimised for 1920×1080 booth screen
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #06060a;
  color: #e2e8f0;
  min-height: 100vh;
  overflow: hidden;
}

/* ── Layout ───────────────────────────────────────────────────────────── */
.showcase {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  max-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 28px;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(6,182,212,0.08));
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}
.subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 400;
}
.lang-toggle {
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
}
.lang-btn {
  padding: 5px 14px;
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.lang-btn.active {
  background: rgba(139,92,246,0.3);
  color: #fff;
}

/* ── Split Screen ─────────────────────────────────────────────────────── */
.split-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
}

/* ── Panels ───────────────────────────────────────────────────────────── */
.panel {
  padding: 18px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.panel-individual {
  border-right: 1px solid rgba(255,255,255,0.06);
}
.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

/* ── Glass Card ───────────────────────────────────────────────────────── */
.glass {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(12px);
  margin-bottom: 14px;
}
.glass-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ── Score Gauge ──────────────────────────────────────────────────────── */
.score-section {
  display: flex;
  align-items: center;
  gap: 24px;
}
.gauge-container {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gauge-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 10;
}
.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              stroke 0.4s ease;
}
.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}
.gauge-label {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  font-weight: 600;
}
.sub-scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.sub-score {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sub-score-label {
  font-size: 0.72rem;
  color: #94a3b8;
  width: 70px;
  font-weight: 500;
}
.sub-score-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.sub-score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.4s ease;
}
.sub-score-value {
  font-size: 0.78rem;
  font-weight: 700;
  width: 28px;
  text-align: right;
}

/* ── Zone Badge ───────────────────────────────────────────────────────── */
.zone-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* ── Bio Age ──────────────────────────────────────────────────────────── */
.bio-age-section {
  display: flex;
  align-items: center;
  gap: 20px;
}
.bio-age-number {
  text-align: center;
}
.bio-age-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
.bio-age-label {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 2px;
}
.bio-age-delta {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
}
.bio-age-delta.older {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.2);
}
.bio-age-delta.younger {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.2);
}
.bio-age-delta.aligned {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.2);
}
.bio-age-vs {
  font-size: 1.2rem;
  color: #475569;
  font-weight: 300;
}

/* ── Recommendations ──────────────────────────────────────────────────── */
.rec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rec-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border-left: 3px solid;
  transition: opacity 0.3s, transform 0.3s;
}
.rec-card.sev-critical { border-left-color: #ef4444; }
.rec-card.sev-warning  { border-left-color: #f59e0b; }
.rec-card.sev-info     { border-left-color: #3b82f6; }
.rec-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.rec-body {
  flex: 1;
  min-width: 0;
}
.rec-text {
  font-size: 0.78rem;
  line-height: 1.4;
  color: #cbd5e1;
}
.rec-gain {
  font-size: 0.68rem;
  color: #4ade80;
  font-weight: 600;
  margin-top: 3px;
}

/* ── Causal Chain ─────────────────────────────────────────────────────── */
.causal-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
}
.causal-node {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
  font-weight: 500;
}
.causal-arrow {
  color: #475569;
  font-size: 0.9rem;
}

/* ── Org Graph ────────────────────────────────────────────────────────── */
#org-graph-container {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0f;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.org-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.org-stat {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.org-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.org-stat-label {
  font-size: 0.65rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-top: 2px;
}
.org-risk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.org-risk-item {
  display: grid;
  grid-template-columns: 1fr auto 70px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  transition: background 0.3s;
}
.org-risk-item.highlight {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.15);
}
.org-risk-detail {
  text-align: right;
  font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
}
.org-risk-pct {
  color: #fbbf24;
}
.org-risk-count {
  color: #64748b;
  font-weight: 500;
  font-size: 0.65rem;
}
.org-risk-bar-bg {
  width: 70px;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.org-risk-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ── Score Distribution Bar ──────────────────────────────────────────── */
.score-dist-bar {
  display: flex;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.dist-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  min-width: 0;
  overflow: hidden;
}
.dist-seg span {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(0,0,0,0.7);
  white-space: nowrap;
}
.score-dist-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.score-dist-stats {
  display: flex;
  gap: 16px;
  font-size: 0.7rem;
  color: #94a3b8;
}
.score-dist-stats strong {
  color: #e2e8f0;
}

/* ── Graph Legend (overlay inside org-graph-container) ─────────────────── */
.graph-legend {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.75);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.6);
  backdrop-filter: blur(4px);
  z-index: 5;
  pointer-events: none;
}
.graph-legend-title {
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  margin-bottom: 4px;
  font-size: 0.65rem;
}
.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}
.graph-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.graph-legend-dot.hex { border-radius: 2px; }

/* ── Input Bar ────────────────────────────────────────────────────────── */
.input-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 20px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-top: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
  flex-wrap: nowrap;
}
.input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  flex-shrink: 0;
}
.input-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 5px;
  white-space: nowrap;
}

/* ── R/G/B Segmented Toggle ───────────────────────────────────────────── */
.rgb-toggle {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.rgb-btn {
  padding: 5px 8px;
  border: none;
  background: rgba(255,255,255,0.03);
  color: #94a3b8;
  font-size: 0.58rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1.2;
}
.rgb-btn:not(:last-child) {
  border-right: 1px solid rgba(255,255,255,0.06);
}
.rgb-btn[data-color="red"].active {
  background: rgba(239,68,68,0.25);
  color: #fca5a5;
  box-shadow: inset 0 0 12px rgba(239,68,68,0.15);
}
.rgb-btn[data-color="green"].active {
  background: rgba(34,197,94,0.2);
  color: #86efac;
  box-shadow: inset 0 0 12px rgba(34,197,94,0.1);
}
.rgb-btn[data-color="blue"].active {
  background: rgba(59,130,246,0.25);
  color: #93c5fd;
  box-shadow: inset 0 0 12px rgba(59,130,246,0.15);
}

/* ── Select / Dropdown ────────────────────────────────────────────────── */
.input-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.7rem;
  font-family: inherit;
  padding: 5px 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 20px;
  min-width: 90px;
}
.input-select:focus {
  outline: 1px solid rgba(139,92,246,0.5);
}
.input-select option {
  background: #1e1e2e;
  color: #e2e8f0;
}

/* ── Sex Toggle ───────────────────────────────────────────────────────── */
.sex-toggle {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.sex-btn {
  padding: 5px 12px;
  border: none;
  background: rgba(255,255,255,0.03);
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.sex-btn.active {
  background: rgba(139,92,246,0.25);
  color: #c4b5fd;
}

/* ── Score Colors ─────────────────────────────────────────────────────── */
.color-blue    { color: #60a5fa; }
.color-green   { color: #4ade80; }
.color-yellow  { color: #fbbf24; }
.color-orange  { color: #fb923c; }
.color-red     { color: #f87171; }

.bg-blue    { background: #3b82f6; }
.bg-green   { background: #22c55e; }
.bg-yellow  { background: #eab308; }
.bg-orange  { background: #f97316; }
.bg-red     { background: #ef4444; }

/* ── Graph Zoom Controls ──────────────────────────────────────────────── */
.graph-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 10;
}
.graph-ctrl-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  background: rgba(0,0,0,0.6);
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
}
.graph-ctrl-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ── Disclaimer ───────────────────────────────────────────────────────── */
.disclaimer {
  text-align: center;
  font-size: 0.58rem;
  color: #475569;
  padding: 4px;
  background: rgba(0,0,0,0.3);
}

/* ── Option A: Narrative Bridge Callout ───────────────────────────────── */
.bridge-callout {
  background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(249,115,22,0.06));
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeInUp 0.3s ease-out;
}
.bridge-line {
  font-size: 0.75rem;
  color: #fca5a5;
  line-height: 1.5;
  display: block;
}
.bridge-line strong {
  color: #f87171;
}

/* ── Option C: Cost Tags (individual side) ────────────────────────────── */
.cost-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 3px 4px 3px 0;
}
.cost-tag-red {
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.2);
}

/* ── Option C: Cost Rows (org side) ───────────────────────────────────── */
.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.75rem;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cost-row:last-child {
  border-bottom: none;
}
.cost-row strong {
  color: #f87171;
}

/* ── Cost Drivers List ───────────────────────────────────────────────── */
.cost-drivers-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cost-driver {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
  transition: background 0.3s;
}
.cost-driver small {
  color: #64748b;
  font-size: 0.65rem;
}
.cost-driver-red {
  background: rgba(239,68,68,0.08);
  color: #fca5a5;
}
.driver-metrics {
  display: flex;
  gap: 10px;
  font-weight: 600;
  font-size: 0.7rem;
}
.driver-pres {
  color: #f87171;
}
.driver-abs {
  color: #fb923c;
}

/* ── Animations ───────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%      { box-shadow: 0 0 12px 4px rgba(239,68,68,0.3); }
}
.animate-in {
  animation: fadeInUp 0.4s ease-out both;
}
.rec-card:nth-child(1) { animation-delay: 0s; }
.rec-card:nth-child(2) { animation-delay: 0.08s; }
.rec-card:nth-child(3) { animation-delay: 0.16s; }
.rec-card:nth-child(4) { animation-delay: 0.24s; }

/* ── Responsive (laptop rehearsal) ────────────────────────────────────── */
@media (max-width: 1200px) {
  html { font-size: 13px; }
  .gauge-container { width: 130px; height: 130px; }
  .gauge-value { font-size: 2rem; }
  #org-graph-container { height: 240px; }
}
