/* ══════════════════════════════════════════════════════════════════
   Jesse's Workout Plan — Shared Design System
   Strava-inspired: clean, sporty, mobile-first
   ══════════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-tap-highlight-color: transparent; }

/* ── Variables ── */
:root {
  --bg:          #0b0b0f;
  --surface:     #131318;
  --surface2:    #1c1c22;
  --surface3:    #24242e;
  --accent:      #f04e23;
  --accent2:     #ff8c42;
  --accent-dim:  rgba(240, 78, 35, 0.12);
  --text:        #f4f4f8;
  --text2:       #9a9ab4;
  --muted:       #66667a;
  --border:      #22222c;
  --border2:     #2e2e3c;

  /* Day-type palette */
  --legs:        #a78bfa;
  --push:        #fb923c;
  --pull:        #34d399;
  --full:        #60a5fa;
  --run:         #f97316;
  --recovery:    #22d3ee;

  /* Leaderboard */
  --gold:        #f5b942;
  --silver:      #9eaab8;
  --bronze:      #c97c3a;

  /* Muscle-group colors */
  --c-chest:     #f87171;
  --c-shoulders: #fb923c;
  --c-biceps:    #a78bfa;
  --c-triceps:   #c084fc;
  --c-forearms:  #818cf8;
  --c-abs:       #fbbf24;
  --c-lats:      #34d399;
  --c-upperback: #2dd4bf;
  --c-lowerback: #10b981;
  --c-traps:     #6ee7b7;
  --c-quads:     #60a5fa;
  --c-hamstrings:#3b82f6;
  --c-glutes:    #f472b6;
  --c-calves:    #94a3b8;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-xl: 20px;
  --header-h:  58px;
  --nav-h:     64px;
}

/* ── Base ── */
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Inter', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: var(--text);
  line-height: 1;
}
.logo em { color: var(--accent); font-style: normal; }

/* ── Top navigation (desktop) ── */
nav.top-nav {
  display: flex;
  gap: 0.2rem;
  margin-left: auto;
}
nav.top-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.15s, background 0.15s;
  border: 1px solid transparent;
}
nav.top-nav a:hover { color: var(--text); background: var(--surface2); }
nav.top-nav a.active {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--border2);
}

/* ── "This Week in Iron" nav link ── */
nav.top-nav a.nav-weekly { color: var(--accent); }
nav.top-nav a.nav-weekly:hover { color: var(--accent2); background: var(--accent-dim); border-color: rgba(240,78,35,0.2); }
nav.top-nav a.nav-weekly.active { color: var(--accent2); background: var(--accent-dim); border-color: rgba(240,78,35,0.3); }

/* ── Hide admin from mobile bottom nav ── */
.bnav-admin { display: none !important; }

/* ── Admin nav link — pushed far right, dimmed ── */
nav.top-nav a.nav-admin { margin-left: auto; color: var(--muted); opacity: 0.55; font-size: 0.78rem; }
nav.top-nav a.nav-admin:hover { color: var(--text2); background: var(--surface2); opacity: 1; }
nav.top-nav a.nav-admin.active { color: var(--text2); background: var(--surface2); border-color: var(--border2); opacity: 1; }

/* ── Bottom navigation (mobile) ── */
nav.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  height: var(--nav-h);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bnav-inner {
  display: flex;
  height: 100%;
  align-items: stretch;
}
.bnav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.15s;
  padding: 0.4rem 0;
}
.bnav-link svg { width: 21px; height: 21px; flex-shrink: 0; }
.bnav-link.active { color: var(--accent); }
.bnav-link:not(.active):hover { color: var(--text2); }

/* ── Page container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ── Form controls ── */
.control-group { display: flex; flex-direction: column; gap: 0.35rem; }
label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 2.2rem 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2366667a' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  transition: border-color 0.15s;
  width: 100%;
}
select:hover, select:focus { border-color: var(--accent); outline: none; }

/* ── Pill badge ── */
.pill-accent {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border-radius: 100px;
  padding: 0.22rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Meta tags ── */
.meta-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  padding: 0.15rem 0.48rem;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 500;
}
.meta-tag.rpe  { color: #f5b942; }
.meta-tag.rest { color: #60a5fa; }

/* ── Empty state ── */
.empty { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }

/* ── Loading ── */
.loading { text-align: center; padding: 3rem; color: var(--muted); font-size: 0.9rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  body { padding-bottom: var(--nav-h); }
  nav.top-nav { display: none; }
  nav.bottom-nav { display: block; }
  header { padding: 0 1rem; }
  .container { padding: 1rem; }
}
@media (max-width: 480px) {
  select { font-size: 1rem; } /* prevent iOS zoom */
}
