/* ============================================================
   HeartScore — GFR / eGFR Calculator Page CSS
   Extends global style.css — page-specific rules only
   ============================================================ */

/* ── Unit Toggle ─────────────────────────────────────────── */
.unit-toggle-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.unit-toggle-btn {
  padding: 4px 14px; border-radius: 20px;
  border: 1.5px solid var(--slate-200);
  font-family: 'Lexend', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--slate-500); background: #fff;
  cursor: pointer; transition: all 0.2s;
}
.unit-toggle-btn.active {
  background: var(--navy); color: #fff;
  border-color: var(--navy);
}

/* ── Formula Tabs ────────────────────────────────────────── */
.formula-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.formula-tab {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--slate-200);
  font-family: 'Lexend', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--slate-500); background: #fff;
  cursor: pointer; transition: all 0.2s;
}
.formula-tab.active {
  background: var(--vitred); color: #fff;
  border-color: var(--vitred);
}
.formula-badge {
  display: inline-block; margin-left: 4px;
  padding: 1px 6px; border-radius: 10px;
  font-size: 9px; font-weight: 700;
  background: #4ade80; color: #15803d;
  vertical-align: middle;
}

/* ── GFR Result Display ──────────────────────────────────── */
#gfr-result-area { display: none; }
#gfr-result-area.show { display: block; }

.gfr-result-top {
  text-align: center;
  padding: 20px 0 12px;
  border-bottom: 1px solid var(--slate-100);
  margin-bottom: 16px;
}
.gfr-num {
  font-family: 'Lexend', sans-serif;
  font-size: 68px; font-weight: 800;
  line-height: 1; margin-bottom: 2px;
}
.gfr-unit-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px; color: var(--slate-500);
  margin-bottom: 10px;
}

/* CKD Stage Visual */
.ckd-stage-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px; margin: 12px 0;
}
.ckd-stage-cell {
  border-radius: 6px; padding: 8px 4px;
  text-align: center;
  font-family: 'Lexend', sans-serif;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.7);
  transition: all 0.3s;
  cursor: default;
}
.ckd-stage-cell.active {
  color: #fff;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(-3px);
}
.ckd-s1 { background: #16a34a; }
.ckd-s2 { background: #65a30d; }
.ckd-s3 { background: #ca8a04; }
.ckd-s4 { background: #ea580c; }
.ckd-s5 { background: #dc2626; }
.ckd-stage-cell .stage-num {
  font-size: 16px; font-weight: 800;
  display: block; line-height: 1.2;
}
.ckd-stage-cell .stage-range {
  font-size: 9px; display: block;
  color: rgba(255,255,255,0.8);
  margin-top: 2px;
}

/* Stage Detail Box */
.stage-detail-box {
  border-radius: 12px; padding: 16px;
  margin-bottom: 14px;
}
.stage-detail-title {
  font-family: 'Lexend', sans-serif;
  font-weight: 800; font-size: 16px;
  margin-bottom: 4px;
}
.stage-detail-sub {
  font-family: 'Inter', sans-serif;
  font-size: 13px; line-height: 1.65;
  margin: 0;
}

/* Input helper text */
.input-helper {
  font-family: 'Inter', sans-serif;
  font-size: 11px; color: var(--slate-400);
  margin-top: 3px;
}

/* GFR age decline table */
.age-table { width: 100%; border-collapse: collapse; font-family: 'Inter', sans-serif; font-size: 13px; }
.age-table th {
  background: var(--navy); color: #fff;
  font-family: 'Lexend', sans-serif; font-weight: 600;
  font-size: 12px; padding: 10px 14px; text-align: left;
}
.age-table th:first-child { border-radius: 8px 0 0 0; }
.age-table th:last-child  { border-radius: 0 8px 0 0; }
.age-table td { padding: 10px 14px; color: var(--slate-600); border-bottom: 1px solid var(--slate-100); }
.age-table tr:last-child td { border-bottom: none; }
.age-table tr:nth-child(even) td { background: var(--slate-50); }
.age-table .highlight td { background: #fef9c3 !important; font-weight: 600; }

/* Formula Box */
.formula-box {
  background: var(--slate-800);
  border-radius: 12px; padding: 20px;
  margin: 16px 0;
}
.formula-title {
  color: #94a3b8;
  font-family: 'Lexend', sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 10px;
}
.formula-text {
  font-family: 'Courier New', monospace;
  font-size: 13px; color: #e2e8f0;
  line-height: 1.8;
}
.formula-text .f-green  { color: #4ade80; }
.formula-text .f-yellow { color: #facc15; }
.formula-text .f-blue   { color: #60a5fa; }
.formula-text .f-red    { color: #f87171; }

/* Risk Matrix Table */
.risk-matrix { width: 100%; border-collapse: collapse; font-size: 11px; }
.risk-matrix th, .risk-matrix td { padding: 8px; text-align: center; border: 1px solid #e2e8f0; }
.risk-matrix th { background: var(--navy); color: #fff; font-family: 'Lexend', sans-serif; font-weight: 600; }
.risk-low    { background: #dcfce7; color: #15803d; font-weight: 600; }
.risk-mod    { background: #fef9c3; color: #854d0e; font-weight: 600; }
.risk-high   { background: #fed7aa; color: #9a3412; font-weight: 600; }
.risk-vhigh  { background: #fee2e2; color: #991b1b; font-weight: 600; }

/* CKD Info Cards */
.ckd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.ckd-card {
  border-radius: 12px; padding: 16px;
  border-left: 4px solid;
}
.ckd-card-s1 { border-color: #16a34a; background: #f0fdf4; }
.ckd-card-s2 { border-color: #65a30d; background: #f7fee7; }
.ckd-card-s3 { border-color: #ca8a04; background: #fefce8; }
.ckd-card-s4 { border-color: #ea580c; background: #fff7ed; }
.ckd-card-s5 { border-color: #dc2626; background: #fef2f2; }
.ckd-card-title {
  font-family: 'Lexend', sans-serif;
  font-weight: 700; font-size: 13px; margin-bottom: 6px;
}
.ckd-card-range {
  font-family: 'Lexend', sans-serif;
  font-weight: 800; font-size: 18px;
  margin-bottom: 4px;
}
.ckd-card-desc {
  font-family: 'Inter', sans-serif;
  font-size: 12px; color: var(--slate-600);
  line-height: 1.6; margin: 0;
}

/* GFR stat row */
.gfr-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.gfr-stat-box {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 12px; padding: 14px 10px;
  text-align: center;
}
.gfr-stat-val {
  font-family: 'Lexend', sans-serif;
  font-weight: 800; font-size: 22px;
  color: var(--navy); line-height: 1.1;
}
.gfr-stat-val.red { color: var(--vitred); }
.gfr-stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px; color: var(--slate-500);
  margin-top: 4px;
}

/* Share strip */
.gfr-share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.gfr-share-btn {
  flex: 1; min-width: 80px;
  padding: 9px 4px; border-radius: 10px;
  border: none; cursor: pointer;
  font-family: 'Lexend', sans-serif;
  font-size: 11px; font-weight: 600;
  color: #fff; transition: transform 0.2s;
}
.gfr-share-btn:hover { transform: translateY(-2px); }
.gsb-wa { background: #25D366; }
.gsb-fb { background: #1877f2; }
.gsb-tw { background: #0f0f0f; }
.gsb-em { background: var(--navy); }

/* Content section */
.content-prose h2 { margin-top: 32px; margin-bottom: 14px; }
.content-prose h3 { margin-top: 24px; margin-bottom: 10px; }
.content-prose p  { margin-bottom: 16px; }
.content-prose ul, .content-prose ol { margin: 0 0 16px 22px; }
.content-prose li { font-family: 'Inter', sans-serif; color: var(--slate-600); line-height: 1.75; margin-bottom: 6px; font-size: 15px; }

/* Kidney icon badge */
.kidney-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #7e22ce 0%, #a855f7 100%);
  color: #fff; border-radius: 20px; padding: 5px 14px;
  font-size: 12px; font-weight: 600;
  font-family: 'Lexend', sans-serif;
  letter-spacing: 0.3px; margin-bottom: 16px;
}

/* Next steps panel */
.next-steps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.next-step-card {
  background: #fff; border: 1px solid var(--slate-100);
  border-radius: 12px; padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.ns-icon { font-size: 24px; margin-bottom: 8px; }
.ns-title {
  font-family: 'Lexend', sans-serif;
  font-weight: 700; font-size: 13px;
  color: var(--navy); margin-bottom: 5px;
}
.ns-body {
  font-family: 'Inter', sans-serif;
  font-size: 12px; color: var(--slate-600);
  line-height: 1.65; margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .gfr-num { font-size: 52px; }
  .ckd-grid { grid-template-columns: 1fr; }
  .next-steps-grid { grid-template-columns: 1fr; }
  .gfr-stat-row { grid-template-columns: 1fr 1fr; }
  .formula-text { font-size: 11px; }
}
@media (max-width: 480px) {
  .ckd-stage-bar { grid-template-columns: repeat(5,1fr); }
  .ckd-stage-cell { padding: 6px 2px; font-size: 10px; }
  .ckd-stage-cell .stage-num { font-size: 13px; }
}