/* ── Page-Specific Styles ─────────────────────────────────────── */

/* ── Dashboard Page ───────────────────────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.stat-card__value {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--accent-green);
  line-height: 1.2;
}

.stat-card__label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-card--calories .stat-card__value { color: var(--accent-green); }
.stat-card--protein  .stat-card__value { color: var(--macro-protein); }
.stat-card--streak   .stat-card__value { color: var(--accent-orange); }

.dash-recovery {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
}

.dash-recovery__score {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}

.dash-recovery__label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ── Workout Page ─────────────────────────────────────────────── */
.workout-history-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
  border-left: 3px solid var(--accent-orange);
}

.workout-history-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.workout-history-item__name {
  font-weight: var(--font-weight-semibold);
}

.workout-history-item__date {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.workout-history-item__sets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.set-badge {
  background: var(--bg-tertiary);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.muscle-group-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.muscle-group-option {
  padding: var(--space-md);
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.muscle-group-option:active,
.muscle-group-option.selected {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: var(--accent-green-dim);
}

.exercise-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.exercise-option {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exercise-option:active,
.exercise-option.selected {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

/* ── Macro Page ───────────────────────────────────────────────── */
.meal-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.meal-list-item:last-child {
  border-bottom: none;
}

.meal-list-item__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.meal-list-item__info {
  flex: 1;
  min-width: 0;
}

.meal-list-item__name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meal-list-item__type {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: capitalize;
}

.meal-list-item__cals {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--accent-green);
  text-align: right;
}

.meal-list-item__macros {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: right;
}

.macro-pie-container {
  display: flex;
  justify-content: center;
  margin: var(--space-lg) 0;
}

.macro-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-md);
}

.macro-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-xs);
}

.macro-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.macro-legend-dot--protein { background: var(--macro-protein); }
.macro-legend-dot--carbs   { background: var(--macro-carbs); }
.macro-legend-dot--fat     { background: var(--macro-fat); }

/* ── Recovery Page ────────────────────────────────────────────── */
.recovery-heatmap {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.recovery-muscle-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
}

.recovery-muscle-row__name {
  width: 90px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  flex-shrink: 0;
}

.recovery-muscle-row__bar {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.recovery-muscle-row__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.recovery-muscle-row__pct {
  width: 48px;
  text-align: right;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.recovery-muscle-row__status {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* Simple body heat map fallback layout */
.body-map {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto var(--space-lg);
}

.body-map svg {
  width: 100%;
  height: auto;
}

.body-map__zone {
  cursor: pointer;
  transition: fill var(--transition-base);
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: var(--space-xs);
}

.legend-dot--ready      { background: var(--recovery-green); }
.legend-dot--recovering { background: var(--recovery-yellow); }
.legend-dot--sore       { background: var(--recovery-red); }

/* ── Settings Section ─────────────────────────────────────────── */
.settings-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.settings-section__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-lg);
  color: var(--accent-green);
}