/* =========================================================
   24-Uur Zwemmarathon – Stijlblad
   Thema: Industrial / Sporty Dark
   ========================================================= */

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

:root {
  --bg-0:       #080c18;
  --bg-1:       #0f1626;
  --bg-2:       #151e33;
  --bg-3:       #1c2640;
  --border:     #1e2d4a;
  --border-2:   #253350;
  --text:       #e2e8f0;
  --text-muted: #64748b;
  --text-sub:   #94a3b8;
  --accent:     #3b82f6;
  --accent-2:   #60a5fa;
  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --cap-red:    #e63946;
  --cap-white:  #f1faee;
  --cap-blue:   #457b9d;
  --cap-black:  #1d3557;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background:  var(--bg-0);
  color:       var(--text);
  line-height: 1.5;
  min-height:  100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigatie ───────────────────────────────────────────── */
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .5px;
  text-decoration: none;
  margin-right: 16px;
}
.nav-brand-icon { font-size: 1.4rem; }

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius);
  color: var(--text-sub);
  font-weight: 500;
  font-size: .9rem;
  transition: .15s;
  text-decoration: none;
}
.nav-link:hover { background: var(--bg-3); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--bg-3); color: var(--accent-2); }

/* ── Footer ──────────────────────────────────────────────── */
.main-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8rem;
  margin-top: 40px;
}

/* ── Hoofdinhoud ─────────────────────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
}

/* ── Kaarten ─────────────────────────────────────────────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .5px;
  color: var(--text);
}
.card-header-sm { font-size: .9rem; padding: 10px 14px; }
.card-body { padding: 16px; }
.mb-3 { margin-bottom: 16px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 16px; }
.p-0  { padding: 0; }
.p-3  { padding: 12px 16px; }

/* ── Statistiekvakken ────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.small-stats .stat-card { padding: 12px 14px; }
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.stat-value small { font-size: .9rem; color: var(--text-muted); font-weight: 400; }
.stat-clock .stat-value { font-size: 2.2rem; color: var(--accent-2); letter-spacing: 2px; }

/* ── Tabellen ────────────────────────────────────────────── */
.ranking-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.ranking-table, .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.ranking-table th, .data-table th {
  background: var(--bg-2);
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.ranking-table td, .data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ranking-table tr:last-child td, .data-table tr:last-child td { border-bottom: none; }
.ranking-table tbody tr:hover, .data-table tbody tr:hover { background: var(--bg-2); }

.rank-num {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  width: 40px;
}
.rank-1 { color: #fbbf24; }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #b45309; }
.distance { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--accent-2); }
.mono { font-family: 'Courier New', monospace; }

/* ── Badges & labels ─────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.badge-setup    { background: #1e2d4a; color: var(--text-muted); }
.badge-running  { background: #052e16; color: #86efac; border: 1px solid #14532d; }
.badge-paused   { background: #451a03; color: #fcd34d; border: 1px solid #92400e; }
.badge-finished { background: #1e1b4b; color: #a5b4fc; }
.badge-info     { background: var(--bg-3); color: var(--text-sub); }
.badge-warning  { background: #451a03; color: #fcd34d; }

/* ── Cap badges ──────────────────────────────────────────── */
.cap-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .5px;
}
.cap-red   { background: var(--cap-red);   color: #fff; }
.cap-white { background: var(--cap-white); color: #1a1a2e; }
.cap-blue  { background: var(--cap-blue);  color: #fff; }
.cap-black { background: var(--cap-black); color: #a5b4fc; border: 1px solid var(--border); }
.cap-grey  { background: var(--bg-3);      color: var(--text-sub); }

/* ── Team dot ────────────────────────────────────────────── */
.team-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ── Formulieren ─────────────────────────────────────────── */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-group  { display: flex; flex-direction: column; gap: 4px; }
.form-group label, .small-label { font-size: .82rem; color: var(--text-muted); font-weight: 600; letter-spacing: .3px; }
.form-input {
  background: var(--bg-0);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-size: .9rem;
  font-family: var(--font-body);
  width: 100%;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input-sm { padding: 5px 10px; font-size: .85rem; }
.form-color    { padding: 4px 6px; height: 36px; cursor: pointer; }
.form-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-select { display: inline-block; width: auto; margin-left: 8px; }
.form-full { grid-column: 1 / -1; }

/* ── Knoppen ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: .15s;
  text-decoration: none;
  letter-spacing: .3px;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { filter: brightness(.95); transform: scale(.98); }
.btn-primary { background: var(--accent);  color: #fff; }
.btn-success { background: #16a34a;        color: #fff; }
.btn-warning { background: var(--warning); color: #1a1a1a; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-outline { background: transparent; color: var(--text-sub); border: 1px solid var(--border-2); }
.btn-outline:hover { background: var(--bg-3); }
.btn-full { width: 100%; }
.btn-sm   { padding: 6px 12px; font-size: .82rem; }
.btn-xs   { padding: 3px 8px; font-size: .75rem; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.inline-form { display: inline; }
.ml-auto { margin-left: auto; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .9rem;
}
.alert-success { background: #052e16; color: #86efac; border: 1px solid #14532d; }
.alert-danger  { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.info-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text-sub); }

/* ── Dashboard ───────────────────────────────────────────── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.ql-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: .15s;
}
.ql-card:hover { background: var(--bg-3); border-color: var(--accent); text-decoration: none; }
.ql-icon  { font-size: 2rem; }
.ql-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--text); }
.ql-sub   { font-size: .82rem; color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sub);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 8px; }

.section-title {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 20px 0 10px;
}

/* ── Team beheerpagina ───────────────────────────────────── */
.team-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }

.team-sidebar .card { position: sticky; top: 70px; }
.team-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: .12s;
  color: var(--text);
}
.team-list-item:last-child { border-bottom: none; }
.team-list-item:hover  { background: var(--bg-3); text-decoration: none; }
.team-list-item.active { background: var(--bg-3); border-left: 3px solid var(--accent); }
.team-list-name { font-weight: 600; font-size: .95rem; }
.team-list-sub  { font-size: .78rem; color: var(--text-muted); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 600;
  transition: .12s;
  margin-bottom: -1px;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.tab-content { display: none; }
.tab-content.active { display: block; padding-top: 12px; }

/* Schema & slots */
.slot-list { display: flex; flex-direction: column; gap: 8px; }
.slot-item { display: flex; align-items: center; gap: 10px; }
.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 50%;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-sub);
  flex-shrink: 0;
}
.gender-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: .75rem;
  font-weight: 700;
}
.gender-d { background: #4c1d95; color: #e9d5ff; }
.gender-h { background: #1e3a5f; color: #bfdbfe; }

.muted { color: var(--text-muted); }
.small { font-size: .85rem; }

/* ══════════════════════════════════════════════════════════
   TIJDMETING PAGINA – speciale grote UI
   ══════════════════════════════════════════════════════════ */
.timing-main {
  min-height: calc(100vh - 56px);
  background: var(--bg-0);
  display: flex;
  flex-direction: column;
}

.timing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}
.timing-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}
.timing-logo { font-size: 1.4rem; }
.timing-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--text-sub); }
.timing-empty-icon { font-size: 3rem; }

/* Klokken balk */
.clock-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  background: var(--bg-1);
  border-bottom: 2px solid var(--border);
}
.clock-block {
  padding: 16px 20px;
  text-align: center;
}
.clock-divider { width: 1px; background: var(--border); }
.clock-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.clock-value {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text);
  line-height: 1;
}
.clock-value-rem  { color: var(--accent-2); }
.clock-value-lap  { color: #34d399; }
.clock-warning    { color: var(--warning) !important; }
.clock-danger     { color: var(--danger) !important; animation: blink 1s infinite; }

@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:.4; } }

/* Huidige zwemmer display */
.swimmer-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 16px;
  gap: 8px;
}
.swimmer-cap {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 16px;
  border-radius: 6px;
  min-width: 80px;
  text-align: center;
}
.cap-bg-rood  { background: var(--cap-red);   color: #fff; }
.cap-bg-wit   { background: var(--cap-white); color: #1a1a2e; }
.cap-bg-blauw { background: var(--cap-blue);  color: #fff; }
.cap-bg-zwart { background: var(--cap-black); color: #a5b4fc; border: 1px solid #3b4f7a; }
.cap-bg-grey  { background: var(--bg-3);      color: var(--text-sub); }

.swimmer-name {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 2px;
  text-align: center;
  line-height: 1;
}
.swimmer-sub { font-size: .9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }

/* Aantiknop */
.touch-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: background .1s;
}
.touch-area.touch-flash { background: rgba(34, 197, 94, .12); }

.touch-btn {
  width: min(480px, 90vw);
  height: 140px;
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border: 2px solid #3b82f6;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all .1s;
  box-shadow: 0 8px 32px rgba(29,78,216,.4);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.touch-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 12px 40px rgba(29,78,216,.6);
  transform: translateY(-1px);
}
.touch-btn:active:not(:disabled), .touch-btn-pressed {
  transform: scale(.97) translateY(1px) !important;
  box-shadow: 0 4px 16px rgba(29,78,216,.3) !important;
}
.touch-btn:disabled {
  background: var(--bg-3);
  border-color: var(--border-2);
  box-shadow: none;
  cursor: not-allowed;
}
.touch-btn-text {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
}
.touch-btn-sub { font-size: .75rem; color: rgba(255,255,255,.5); letter-spacing: 1px; }
.touch-btn:disabled .touch-btn-text { color: var(--text-muted); }

/* Volgende zwemmer */
.next-swimmer {
  text-align: center;
  padding: 6px 16px;
  font-size: .9rem;
  color: var(--text-muted);
  min-height: 28px;
}
.next-swimmer strong { color: var(--text-sub); }

/* Recente rondes */
.recent-laps {
  flex: 1;
  padding: 12px 20px 20px;
  overflow-y: auto;
  max-height: 280px;
}
.recent-laps-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.lap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.lap-row:last-child { border-bottom: none; }
.lap-num  { font-family: var(--font-display); font-weight: 700; color: var(--text-muted); min-width: 32px; }
.lap-name { flex: 1; color: var(--text); font-weight: 500; }
.lap-time { font-family: 'Courier New', monospace; font-weight: 700; color: #34d399; min-width: 80px; text-align: right; }
.lap-dist { font-size: .8rem; min-width: 36px; text-align: right; }

/* Overlay */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.overlay-box {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  text-align: center;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.overlay-icon { font-size: 3rem; margin-bottom: 12px; }
.overlay-text { font-size: 1.1rem; color: var(--text); margin-bottom: 20px; line-height: 1.5; }

/* ── Diverse hulpklassen ─────────────────────────────────── */
.flex { display: flex; }
.gap-2 { gap: 8px; }

@media (max-width: 768px) {
  .team-layout { grid-template-columns: 1fr; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .clock-bar { grid-template-columns: 1fr; }
  .clock-divider { width: 100%; height: 1px; }
  .swimmer-name { font-size: 2.2rem; }
  .touch-btn { height: 120px; }
  .touch-btn-text { font-size: 2rem; }
  .main-nav .nav-links { gap: 2px; }
  .nav-link { padding: 5px 8px; font-size: .82rem; }
}
