/* ═══════════════════════════════════════════════════
   Sydnee Workout — Styles
   Accessible, high-contrast, large tap targets.
   ═══════════════════════════════════════════════════ */

/* ── Reset & base ───────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --text: #f0f0f0;
  --text-muted: #2f2f35;
  --primary: #0f8b8d;
  --primary-hover: #0da3a5;
  --secondary: #555580;
  --secondary-hover: #6a6a9a;
  --danger: #b03060;
  --danger-hover: #c94070;
  --warning-bg: #4a3800;
  --warning-border: #ff9900;
  --accent: #e94560;
  --rating-selected: #0f8b8d;
  --radius: 16px;
  --max-width: 600px;
}

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ── Screens ────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem 1.5rem 6rem;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.screen.active {
  display: flex;
}

.screen[hidden] {
  display: none;
}

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
}

p {
  font-size: 1.1rem;
}

/* ── Home stats ─────────────────────────────────── */
.home-stats {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  width: 100%;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  padding: 0.3rem 0;
}

.stat-label {
  font-weight: 600;
}

/* ── Warning ────────────────────────────────────── */
.warning {
  background: var(--warning-bg);
  border: 2px solid var(--warning-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  width: 100%;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 0.75rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  max-width: var(--max-width);
  text-decoration: none;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s ease;
}

.btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.btn-primary {
  background: var(--primary);
}
.btn-primary:hover,
.btn-primary:active {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
}
.btn-secondary:hover,
.btn-secondary:active {
  background: var(--secondary-hover);
}

.btn-danger {
  background: var(--danger);
}
.btn-danger:hover,
.btn-danger:active {
  background: var(--danger-hover);
}

.btn-small {
  min-height: 48px;
  font-size: 1rem;
  max-width: 240px;
}

.btn-pause {
  background: var(--secondary);
  margin-top: 1.5rem;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  align-items: center;
}

/* ── Option list (warmup choices) ───────────────── */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.option-list .btn {
  text-align: left;
  padding: 1rem 1.5rem;
  min-height: 72px;
}

.option-label {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
}

.option-desc {
  display: block;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Timer ──────────────────────────────────────── */
.timer-display {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  min-width: 200px;
}

.timer-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* ── Instruction text ───────────────────────────── */
.instruction {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Exercise illustration ──────────────────────── */
.exercise-image {
  width: 180px;
  height: 180px;
  border-radius: var(--radius);
  display: block;
  /* SVGs already have a dark background matching the app */
}

/* ── Strength buttons ───────────────────────────── */
.strength-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

/* ── Progress bar (session) ─────────────────────── */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--bg-card);
  z-index: 100;
}

.progress-bar-container[hidden] {
  display: none;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-label {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Rating buttons ─────────────────────────────── */
.rating-section {
  width: 100%;
}

.rating-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn-rating {
  width: 64px;
  min-height: 64px;
  max-width: 64px;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--secondary);
  border-radius: 50%;
}

.btn-rating.selected {
  background: var(--rating-selected);
  outline: 3px solid #fff;
}

/* ── Plan list ──────────────────────────────────── */
.plan-list {
  text-align: left;
  width: 100%;
  list-style: none;
  counter-reset: plan-step;
}

.plan-list li {
  counter-increment: plan-step;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 1.1rem;
}

.plan-list li::before {
  content: counter(plan-step) ". ";
  font-weight: 700;
  color: var(--primary);
}

/* Plan items with exercise thumbnail */
.plan-item-with-image {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.plan-item-image {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── Image lightbox ────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 2rem;
  cursor: pointer;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(90vw, 400px);
  max-height: min(90vh, 400px);
  border-radius: var(--radius);
}

.lightbox-label {
  position: absolute;
  bottom: max(2rem, env(safe-area-inset-bottom));
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}

/* ── Overlay / Dialog ───────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
}

.overlay[hidden] {
  display: none;
}

.dialog {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

/* ── Utilities ──────────────────────────────────── */
[hidden] {
  display: none !important;
}

/* ── iPad adjustments ───────────────────────────── */
@media (min-width: 768px) {
  html {
    font-size: 20px;
  }
  .screen {
    padding-top: 3rem;
  }
}
