/* ═══ Running Performance Template Styles ═══ */
/* Sport-specific styles for ux_type: running calculators */

/* ─── Training Zone Colors ─── */
:root {
  --zone-easy:        #22c55e; /* green  */
  --zone-tempo:       #facc15; /* yellow */
  --zone-threshold:   #f97316; /* orange */
  --zone-interval:    #ef4444; /* red    */
  --zone-repetition:  #7c3aed; /* purple */
  --zone-easy-bg:     #dcfce7;
  --zone-tempo-bg:    #fef9c3;
  --zone-threshold-bg:#ffedd5;
  --zone-interval-bg: #fee2e2;
  --zone-repetition-bg:#ede9fe;
}

[data-theme="dark"] {
  --zone-easy-bg:     #14532d;
  --zone-tempo-bg:    #713f12;
  --zone-threshold-bg:#7c2d12;
  --zone-interval-bg: #7f1d1d;
  --zone-repetition-bg:#4c1d95;
}

/* ─── Body marker for running pages ─── */
.running-active .result {
  padding: 1.5rem;
  border-radius: 1rem;
  text-align: center;
  position: relative;
}

/* ─── Pace/Speed Toggle ─── */
.running-unit-toggle {
  display: inline-flex;
  border: 2px solid var(--accent, #2563eb);
  border-radius: 2rem;
  overflow: hidden;
  margin: 0.75rem auto;
  font-size: 0.85rem;
  font-weight: 600;
}

.running-unit-toggle button {
  padding: 0.35rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--accent, #2563eb);
  transition: background 0.2s, color 0.2s;
  line-height: 1.4;
}

.running-unit-toggle button.active {
  background: var(--accent, #2563eb);
  color: #fff;
}

.running-unit-toggle button:hover:not(.active) {
  background: rgba(37,99,235,0.08);
}

/* ─── Training Zone Card ─── */
.running-zones {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.running-zones__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.25rem;
}

.zone-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border-left: 4px solid transparent;
  font-size: 0.88rem;
  transition: transform 0.15s;
}

.zone-row:hover { transform: translateX(2px); }

.zone-row.zone--easy        { background: var(--zone-easy-bg);        border-color: var(--zone-easy); }
.zone-row.zone--tempo       { background: var(--zone-tempo-bg);       border-color: var(--zone-tempo); }
.zone-row.zone--threshold   { background: var(--zone-threshold-bg);   border-color: var(--zone-threshold); }
.zone-row.zone--interval    { background: var(--zone-interval-bg);    border-color: var(--zone-interval); }
.zone-row.zone--repetition  { background: var(--zone-repetition-bg);  border-color: var(--zone-repetition); }

.zone-row__name {
  font-weight: 700;
  font-size: 0.8rem;
}

.zone-row__label {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.zone-row__pace {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: right;
  white-space: nowrap;
}

.zone-row.zone--active {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

/* ─── Pace Band (visual gradient bar) ─── */
.pace-band-wrap {
  margin: 1rem 0 0.5rem;
}

.pace-band-wrap__label {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.pace-band {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(to right,
    var(--zone-easy) 0%,
    var(--zone-tempo) 35%,
    var(--zone-threshold) 57%,
    var(--zone-interval) 75%,
    var(--zone-repetition) 100%
  );
  position: relative;
  overflow: visible;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.pace-band__marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #1e293b;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15);
  transition: left 0.6s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}

[data-theme="dark"] .pace-band__marker {
  background: #1e293b;
  border-color: #f1f5f9;
}

.pace-band__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 0.3rem;
}

/* ─── Race Prediction Table ─── */
.race-predictions {
  margin-top: 1.25rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
}

.race-predictions__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #64748b);
  padding: 0.6rem 0.75rem 0.4rem;
  background: var(--surface, #f8fafc);
  border-bottom: 1px solid var(--border, #e2e8f0);
}

[data-theme="dark"] .race-predictions__title {
  background: #1e293b;
}

.race-predictions table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.race-predictions th {
  padding: 0.45rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  background: var(--surface, #f8fafc);
  border-bottom: 1px solid var(--border, #e2e8f0);
}

[data-theme="dark"] .race-predictions th {
  background: #1e293b;
}

.race-predictions td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-variant-numeric: tabular-nums;
}

.race-predictions tr:last-child td { border-bottom: none; }

.race-predictions tr:hover td {
  background: rgba(37,99,235,0.04);
}

.race-predictions td:last-child {
  font-weight: 600;
  text-align: right;
}

/* ─── Split Table ─── */
.split-table-wrap {
  margin-top: 1.25rem;
}

.split-table-wrap__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.split-table-wrap__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #64748b);
}

.split-table-unit-toggle {
  display: inline-flex;
  border: 1.5px solid var(--border, #cbd5e1);
  border-radius: 1rem;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 600;
}

.split-table-unit-toggle button {
  padding: 0.2rem 0.6rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted, #64748b);
  transition: background 0.15s, color 0.15s;
}

.split-table-unit-toggle button.active {
  background: var(--accent, #2563eb);
  color: #fff;
}

.split-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
  overflow: hidden;
}

.split-table th {
  padding: 0.4rem 0.6rem;
  background: var(--surface, #f8fafc);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  border-bottom: 1px solid var(--border, #e2e8f0);
  text-align: left;
}

[data-theme="dark"] .split-table th {
  background: #1e293b;
}

.split-table td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-variant-numeric: tabular-nums;
}

.split-table tr:last-child td { border-bottom: none; }

.split-table tr:nth-child(even) td {
  background: rgba(0,0,0,0.02);
}

[data-theme="dark"] .split-table tr:nth-child(even) td {
  background: rgba(255,255,255,0.03);
}

.split-table td.split-highlight {
  font-weight: 700;
  color: var(--accent, #2563eb);
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .race-predictions td,
  .race-predictions th,
  .split-table td,
  .split-table th {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }

  .running-unit-toggle button {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
  }
}
