/* ══════════════════════════════════════════════════════════
   HYROX MODULE — shared between vu-tracker.html + wife-tracker.html
   Replaces running.css. Same purple/pink accent (#e84af0) for continuity.
   ══════════════════════════════════════════════════════════ */

[id="page-hyrox"] { --hyrox-accent: #e84af0; }

/* ── Race banner ── */
.hx-race-banner {
  background: linear-gradient(135deg, var(--hyrox-accent), color-mix(in srgb, var(--hyrox-accent) 70%, #6020a0));
  border-radius: 14px;
  padding: 22px 24px;
  color: #fff;
  margin-bottom: 16px;
}
.hx-race-eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.hx-race-name { font-family: 'Bebas Neue', 'Playfair Display', serif; font-size: 32px; line-height: 1; margin-top: 4px; }
.hx-race-meta { font-size: 13px; opacity: 0.95; margin-top: 8px; }
.hx-progress-track { height: 6px; background: rgba(255,255,255,0.18); border-radius: 3px; margin-top: 14px; overflow: hidden; }
.hx-progress-fill { height: 100%; background: #fff; border-radius: 3px; transition: width 0.4s; }
.hx-race-stats { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; opacity: 0.9; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Category toggle (Vu doubles vs mixed) ── */
.hx-cat-toggle { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.hx-cat-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.hx-cat-btn.active {
  background: color-mix(in srgb, var(--hyrox-accent) 14%, transparent);
  border-color: var(--hyrox-accent);
  color: var(--hyrox-accent);
  font-weight: 600;
}

/* ── Cards ── */
.hx-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
}
.hx-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.hx-card-title { font-family: 'Bebas Neue', 'Playfair Display', serif; font-size: 20px; line-height: 1; letter-spacing: 0.04em; }
.hx-card-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

/* ── This week focus ── */
.hx-focus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.hx-focus-cell {
  background: color-mix(in srgb, var(--hyrox-accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--hyrox-accent) 25%, transparent);
  border-radius: 10px;
  padding: 12px 14px;
}
.hx-focus-label { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.hx-focus-val { font-size: 14px; color: var(--text, var(--ink)); font-weight: 600; line-height: 1.4; }

/* ── Station PB grid ── */
.hx-stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.hx-station {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  position: relative;
  overflow: hidden;
}
.hx-station-name { font-family: 'Bebas Neue', 'Playfair Display', serif; font-size: 15px; letter-spacing: 0.04em; margin-bottom: 2px; }
.hx-station-distance { font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }
.hx-station-pb { font-size: 18px; font-weight: 600; color: var(--hyrox-accent); margin-top: 8px; line-height: 1; }
.hx-station-pb-empty { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.2; }
.hx-station-target { font-size: 10px; color: var(--muted); margin-top: 4px; letter-spacing: 0.04em; }
.hx-station-bar { height: 4px; background: var(--surface3, var(--border)); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.hx-station-bar-fill { height: 100%; background: var(--hyrox-accent); border-radius: 2px; transition: width 0.4s; }
.hx-station-date { font-size: 9px; color: var(--muted); margin-top: 4px; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Session log form ── */
.hx-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
@media (max-width: 600px) { .hx-form-grid { grid-template-columns: 1fr; } }
.hx-input, .hx-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text, var(--ink));
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.hx-input:focus, .hx-select:focus { border-color: var(--hyrox-accent); }
.hx-label {
  font-size: 10px; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  display: block; margin-bottom: 4px;
}
.hx-pill-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.hx-pill-btn {
  padding: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.hx-pill-btn.active {
  background: color-mix(in srgb, var(--hyrox-accent) 12%, transparent);
  border-color: var(--hyrox-accent);
  color: var(--hyrox-accent);
  font-weight: 600;
}
.hx-notes {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text, var(--ink));
  padding: 10px 12px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  resize: none;
  outline: none;
  line-height: 1.5;
}
.hx-save-btn {
  width: 100%;
  padding: 13px;
  background: var(--hyrox-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity 0.15s;
}
.hx-save-btn:active { opacity: 0.85; }
.hx-save-btn:disabled { opacity: 0.4; cursor: default; }

/* Station rows inside the log form */
.hx-station-row {
  display: grid;
  grid-template-columns: 24px 1.4fr 0.9fr 0.9fr;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.hx-station-row:last-child { border-bottom: none; }
.hx-station-row-name { font-size: 12px; color: var(--text, var(--ink)); font-weight: 500; }
.hx-station-row-meta { font-size: 10px; color: var(--muted); display: block; margin-top: 2px; letter-spacing: 0.04em; }
.hx-station-time, .hx-station-load {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text, var(--ink));
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  width: 100%;
  outline: none;
  font-family: 'DM Sans', sans-serif;
}
.hx-station-time:focus, .hx-station-load:focus { border-color: var(--hyrox-accent); }
.hx-station-check {
  width: 20px; height: 20px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--hyrox-accent);
  transition: all 0.15s;
}
.hx-station-check.checked {
  background: color-mix(in srgb, var(--hyrox-accent) 16%, transparent);
  border-color: var(--hyrox-accent);
}

/* ── 12-week table ── */
.hx-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hx-table th {
  text-align: left;
  padding: 8px 6px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
  border-bottom: 1px solid var(--border);
}
.hx-table td { padding: 9px 6px; border-bottom: 1px solid var(--border); color: var(--text, var(--ink)); }
.hx-table tr:last-child td { border-bottom: none; }
.hx-table tr.current-week td {
  background: color-mix(in srgb, var(--hyrox-accent) 8%, transparent);
  font-weight: 600;
}
.hx-table tr.current-week td:first-child { color: var(--hyrox-accent); }

/* ── Session history rows ── */
.hx-session-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.hx-session-row:last-child { border-bottom: none; }
.hx-session-meta { font-size: 12px; color: var(--text, var(--ink)); }
.hx-session-meta strong { color: var(--hyrox-accent); }
.hx-session-sub { font-size: 11px; color: var(--muted); margin-top: 3px; letter-spacing: 0.03em; }
.hx-row-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.hx-row-btn.delete:hover { color: #e84a4a; border-color: #e84a4a; }

/* ── Empty / loading ── */
.hx-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }
.hx-loading { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }

/* ── Intervals card ── */
.hx-interval-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.hx-interval-row:last-child { border-bottom: none; }
@media (max-width: 600px) {
  .hx-interval-row { grid-template-columns: 1fr 1fr; }
}
