/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f0f1a;
  --surface: #16213e;
  --surface2: #1a2a4a;
  --accent: #00d4ff;
  --green: #2ecc71;
  --yellow: #f39c12;
  --red: #e74c3c;
  --text: #e0e0e0;
  --muted: #7a8ab0;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 1.1rem; font-weight: 600; }
.muted { color: var(--muted); font-size: 0.9rem; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

/* ── Layout ───────────────────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 24px 16px; }

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar { background: var(--surface); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 56px; border-bottom: 1px solid #222; position: sticky; top: 0; z-index: 10; }
.brand { font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 16px; font-size: 0.9rem; }
.credits-badge { background: var(--surface2); padding: 4px 10px; border-radius: 20px; font-weight: 600; color: var(--accent); }
.avatar { width: 30px; height: 30px; border-radius: 50%; vertical-align: middle; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary { background: var(--accent); color: #0f0f1a; font-weight: 700; padding: 10px 20px; border-radius: var(--radius); border: none; cursor: pointer; display: inline-block; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary.btn-lg { font-size: 1.1rem; padding: 14px 28px; }
.btn-secondary { background: var(--surface2); color: var(--text); padding: 8px 16px; border-radius: var(--radius); border: 1px solid #333; cursor: pointer; display: inline-block; }

/* ── Flash messages ───────────────────────────────────────────────────── */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.95rem; }
.flash-success { background: #1a3a2a; border-left: 4px solid var(--green); }
.flash-error   { background: #3a1a1a; border-left: 4px solid var(--red); }
.flash-info    { background: #1a2a3a; border-left: 4px solid var(--accent); }

/* ── Badges ───────────────────────────────────────────────────────────── */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.badge-green  { background: #1a3a2a; color: var(--green); }
.badge-yellow { background: #3a2a0a; color: var(--yellow); }
.badge-red    { background: #3a1a1a; color: var(--red); }
.badge-gray   { background: #222; color: var(--muted); }

/* ── Page header ──────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 12px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ── Landing ──────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 60px 16px 40px; }
.hero h1 { font-size: 2.8rem; line-height: 1.2; margin-bottom: 20px; }
.hero-sub { color: var(--muted); font-size: 1.15rem; max-width: 520px; margin: 0 auto 28px; }
.hero-note { color: var(--muted); font-size: 0.85rem; margin-top: 12px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; padding: 20px 0 40px; }
.feature-card { background: var(--surface); border-radius: var(--radius); padding: 24px; }
.feature-icon { font-size: 2rem; display: block; margin-bottom: 12px; }

/* ── Player grid ──────────────────────────────────────────────────────── */
.player-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 32px; }
.player-card { background: var(--surface); border-radius: var(--radius); padding: 20px; text-align: center; transition: background 0.2s; }
.player-card:hover { background: var(--surface2); }
.player-avatar { width: 52px; height: 52px; background: var(--accent); color: #0f0f1a; border-radius: 50%; font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.player-card h3 { margin-bottom: 4px; }

/* ── Session list ─────────────────────────────────────────────────────── */
.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-row { background: var(--surface); border-radius: var(--radius); padding: 14px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; transition: background 0.2s; }
.session-row:hover { background: var(--surface2); }
.session-player { font-weight: 600; min-width: 80px; }
.session-date { color: var(--muted); font-size: 0.9rem; min-width: 100px; }
.session-shots { font-size: 0.9rem; }
.mini-bar { flex: 1; height: 4px; background: #333; border-radius: 2px; min-width: 60px; }
.bar-good { height: 100%; background: var(--green); border-radius: 2px; }
.status-complete   { color: var(--green); font-size: 0.8rem; }
.status-processing { color: var(--yellow); font-size: 0.8rem; }
.status-failed     { color: var(--red); font-size: 0.8rem; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-page { max-width: 480px; margin: 0 auto; }
.form-page h1 { margin-bottom: 8px; }
.form-card { background: var(--surface); border-radius: var(--radius); padding: 24px; margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
label { font-size: 0.9rem; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
input[type=text], input[type=number], input[type=date], input[type=file], input[type=password], select, textarea {
  background: var(--bg); border: 1px solid #333; color: var(--text);
  padding: 10px 12px; border-radius: 6px; font-size: 1rem; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

/* ── Session view ─────────────────────────────────────────────────────── */
.processing-banner { background: var(--surface2); border-left: 4px solid var(--yellow); padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--muted); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.summary-bar { display: flex; gap: 16px; background: var(--surface); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px; flex-wrap: wrap; }
.summary-stat { text-align: center; flex: 1; min-width: 60px; }
.stat-num { display: block; font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--muted); }
.summary-stat.good .stat-num { color: var(--green); }
.summary-stat.yellow .stat-num { color: var(--yellow); }
.summary-stat.red .stat-num { color: var(--red); }

.shot-card { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.shot-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.shot-frames { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; }
.shot-frames img { width: 22%; min-width: 80px; border-radius: 6px; object-fit: cover; }
.shot-section { margin-bottom: 10px; }
.shot-section h4 { font-size: 0.9rem; margin-bottom: 6px; }
.shot-section ul { padding-left: 18px; font-size: 0.9rem; color: var(--muted); }
.shot-section ul li { margin-bottom: 4px; }
.coaching-tip { background: var(--surface2); border-radius: 6px; padding: 10px 14px; font-size: 0.9rem; color: #a8d8ea; font-style: italic; margin-top: 10px; }

/* ── Credits ──────────────────────────────────────────────────────────── */
.credit-packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 24px 0; }
.package-card { background: var(--surface); border-radius: var(--radius); padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.package-credits { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.package-shots { color: var(--muted); font-size: 0.9rem; }
.package-price { font-size: 1.3rem; font-weight: 600; }

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state a { margin-top: 16px; display: inline-block; }

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .page-header { flex-direction: column; }
  .summary-bar { gap: 10px; }
  .navbar { padding: 0 12px; }
  .nav-links { gap: 10px; font-size: 0.82rem; }
}
