/* ─────────────────────────────────────────
   HEALTH INDEX — STATS BAR
   The small scrolling row of chips at the top (Age, Height, Weight, etc.)
───────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: space-between;
  padding-bottom: 2px;
  margin-bottom: 22px;
}

.stat-chip       { display: flex; flex-direction: column; gap: 1px; }

.stat-chip-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #bbb;
  text-transform: uppercase;
}

.stat-chip-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1a1a1a;
}


/* ─────────────────────────────────────────
   HEALTH INDEX — METRIC CARDS
───────────────────────────────────────── */

/* The TDEE/BMR card is swipeable — padding: 0 so the slide panels sit flush inside */
/* This rule must come before .metric-card so the padding: 16px doesn't override it */
.slide-card        { overflow: hidden; padding: 0; position: relative; cursor: pointer; }
.slide-card:active { cursor: pointer; }

/* Each slide panel (TDEE and BMR) is absolutely positioned so they overlap */
.slide-panel {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 28px; /* bottom gap for the dots */
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

/* Indicator dots at the bottom of the swipe card */
.slide-dots {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.dot        { width: 6px; height: 6px; border-radius: 50%; background: #D0D0D8; transition: background 0.2s; }
.dot.active { background: #1a1a1a; }

/* The two small side-by-side cards (BMI + TDEE/BMR) */
.metric-pair {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.metric-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Square aspect ratio for the cards in the pair — looks balanced on any screen width */
.metric-pair .metric-card { aspect-ratio: 1; }

/* Full-width cards (body fat and weight) */
.metric-card.full {
  flex: none;
  width: 100%;
  margin-bottom: 12px;
}

.metric-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #aaa;
  margin-bottom: 6px;
}

/* The big number inside a card */
.metric-value {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
  margin-top: 20px;
  margin-bottom: 6px;
}

.metric-sub {
  display: block;
  font-size: 0.72rem;
  color: #aaa;
  font-weight: 500;
}

/* Row that holds the large number and the ideal range label side by side */
.metric-value-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Slightly smaller number style used on the full-width cards */
.metric-value-lg {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
}


/* ─────────────────────────────────────────
   HEALTH INDEX — GRADIENT BARS
   The colored bars under body fat and weight metrics
───────────────────────────────────────── */
.gbar-wrap { margin-top: 4px; }

.gbar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* Blue → green → yellow → red for body fat */
.bf-gradient {
  background: linear-gradient(to right,
    #2196f3 0%,
    #2196f3 20%,
    #4caf50 36%,
    #4caf50 58%,
    #FFC107 72%,
    #f44336 84%,
    #f44336 100%);
}

/* Blue → green → orange → red for weight */
.weight-gradient {
  background: linear-gradient(to right,
    #2196f3 0%, #2196f3 12%,
    #4caf50 25%, #4caf50 42%,
    #ff9800 62%,
    #f44336 84%, #f44336 100%);
}

/* The white dot with dark border that slides along the bar */
.gbar-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2.5px solid #1a1a1a;
  border-radius: 50%;
  transition: left 0.9s cubic-bezier(0.34, 1.56, 0.64, 1); /* spring easing so it bounces into place */
  left: 5%; /* starting position — JS moves it to the real value */
}

.gbar-labels      { display: flex; justify-content: space-between; }

.gbar-labels span {
  font-size: 0.58rem;
  font-weight: 600;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* The "IDEAL RANGE" label + value shown to the right of the big number */
.bf-ideal-range {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.ideal-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ccc;
}

.ideal-value {
  font-size: 1rem;
  font-weight: 700;
  color: #777;
  line-height: 1;
}


/* ─────────────────────────────────────────
   FOCUS MODAL
───────────────────────────────────────── */
.focus-clickable { cursor: pointer; }

.focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 24px 24px;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.focus-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.focus-card {
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  width: 100%;
  max-width: 360px;
  max-height: 82vh;
  overflow-y: auto;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.focus-overlay.open .focus-card {
  transform: scale(1);
}

.focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.focus-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #aaa;
  text-transform: uppercase;
}

.focus-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  padding: 2px;
  display: flex;
  align-items: center;
  line-height: 1;
}

.focus-value {
  display: block;
  font-size: 3.2rem;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
  margin-bottom: 4px;
}

.focus-value-sub {
  display: block;
  font-size: 0.75rem;
  color: #aaa;
  font-weight: 500;
  margin-bottom: 20px;
}

.focus-desc {
  font-size: 0.83rem;
  color: #333;
  line-height: 1.6;
  margin-bottom: 16px;
}

.focus-def {
  font-size: 0.74rem;
  color: #aaa;
  line-height: 1.55;
  border-top: 1px solid #f0f0f0;
  padding-top: 14px;
}

/* BMI zone bar */
.focus-bar-wrap {
  position: relative;
  margin-bottom: 20px;
}

.focus-bar {
  height: 8px;
  border-radius: 4px;
  margin-bottom: 18px;
}

.bmi-gradient {
  background: linear-gradient(to right,
    #2196f3 0%, #2196f3 12%,
    #4caf50 18%, #4caf50 42%,
    #FFC107 52%, #FFC107 65%,
    #f44336 73%, #f44336 100%);
}

.focus-bar-dot-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  pointer-events: none;
}

.focus-bar-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2.5px solid #1a1a1a;
  border-radius: 50%;
  transition: left 0.7s cubic-bezier(0.34,1.56,0.64,1);
  left: 5%;
}

.focus-bar-labels {
  display: flex;
  justify-content: space-between;
}

.focus-bar-labels span {
  font-size: 0.53rem;
  font-weight: 600;
  color: #bbb;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* TDEE calorie reference row */
.focus-targets {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.focus-target {
  flex: 1;
  background: #f6f6f9;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.focus-target-label {
  display: block;
  font-size: 0.53rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #bbb;
  margin-bottom: 4px;
}

.focus-target-val {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: #1a1a1a;
}

/* BMR split bar */
.focus-split {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.focus-split-block {
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.focus-split-label {
  font-size: 0.53rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.focus-split-val {
  font-size: 0.88rem;
  font-weight: 800;
}
