/* overlay-config.css — specifieke styles voor de upload-pagina.
   Override container max-width omdat upload-pagina iets breder is. */

/* Avatar grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.runner {
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 8px;
  background: var(--ink2);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
}
.runner:hover { background: rgba(255,106,61,0.18); }
.runner.selected { border-color: var(--a1); background: rgba(255,106,61,0.25); }
.runner img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: var(--ink);
}
.runner .name { margin-top: 6px; font-weight: 700; font-size: 13px; letter-spacing: 1px; }
/* Selection-order badge — shows the position (1, 2, 3…) of each picked runner
   so the user knows who lands where in the overlay. Replaces the old ✓ glyph. */
.runner .order-badge {
  position: absolute;
  top: -6px; right: -6px;
  background: var(--a1);
  color: #fff;
  min-width: 26px; height: 26px;
  padding: 0 6px;
  box-sizing: border-box;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  line-height: 26px;
  text-align: center;
  border: 2px solid var(--ink2);
}

/* Selected list (legacy section 3, niet meer gebruikt maar styles blijven) */
.selected-list { display: flex; flex-direction: column; gap: 12px; }
.runner-config {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 1fr 40px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--ink2);
  border-radius: 12px;
  border-left: 4px solid var(--a1);
}
.runner-config img {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--a1);
}
.runner-config input[type=text] {
  background: rgba(247,239,228,0.06);
  border: 1px solid var(--line-d);
  color: var(--on-dark);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
}
.runner-config input[type=color] {
  width: 50px; height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.runner-config .swatch-row { display: flex; gap: 4px; }
.runner-config .swatch {
  width: 22px; height: 22px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
}
.runner-config .swatch:hover { transform: scale(1.15); }
.runner-config .remove {
  background: rgba(247,239,228,0.1);
  border: none;
  color: var(--on-dark);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}
.runner-config .remove:hover { background: rgba(255,106,61,0.4); }

/* Form rows + inputs */
.row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.row label { font-size: 13px; letter-spacing: 1px; min-width: 130px; opacity: 0.85; }

input[type=text], input[type=number], select {
  background: rgba(247,239,228,0.06);
  border: 1px solid var(--line-d);
  color: var(--on-dark);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
input[type=text] { width: 240px; }
input[type=range] { width: 100%; accent-color: var(--a1); }

.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { accent-color: var(--a1); width: 18px; height: 18px; }

/* Option pills (post-type / fit / format). The selected state is a .selected
   class toggled by the JS updaters (updatePostType / updateFit / updateFormat),
   which replaced the old inline borderColor writes. */
.post-type-opt, .gpx-mode-opt, .fit-opt, .fmt-opt {
  border: 2px solid var(--line-d);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  justify-content: center;
  flex: 1 1 calc(33% - 8px);
  min-width: 120px;
  transition: border-color 0.12s, background 0.12s;
}
.fit-opt, .fmt-opt { flex-basis: calc(50% - 8px); min-width: 140px; }
.post-type-opt.selected, .gpx-mode-opt.selected,
.fit-opt.selected, .fmt-opt.selected {
  border-color: var(--a1);
  background: rgba(255,106,61,0.14);
}
.post-type-opt:hover, .fit-opt:hover, .fmt-opt:hover { border-color: rgba(247,239,228,0.4); }

/* Sticky submit bar — keeps the primary action reachable on the long form. */
.submit-bar {
  position: sticky;
  bottom: 0;
  z-index: 50;
  margin-top: 18px;
  padding: 14px;
  background: rgba(22,23,31,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-d);
  border-radius: 14px;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.submit-bar .primary { width: 100%; max-width: 420px; }

/* Banner (e.g. pending-upload notice after a reload). */
.wo-banner {
  background: linear-gradient(100deg, var(--a1), var(--a2));
  border: 1px solid var(--line-d);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Dropzone */
.dropzone {
  border: 3px dashed rgba(247,239,228,0.25);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.dropzone:hover,
.dropzone.drag { background: rgba(255,106,61,0.18); border-color: var(--a1); }
.dropzone p { margin: 6px 0; opacity: 0.85; }
.dropzone strong { color: var(--a1); }

.preview { margin-top: 12px; display: none; position: relative; width: max-content; }
.preview img {
  max-width: 200px; max-height: 200px;
  border-radius: 10px;
  border: 2px solid var(--a1);
  display: block;
}
.preview .filename { display: block; margin-top: 6px; font-size: 12px; opacity: 0.7; }
.preview #clear-photo {
  position: absolute;
  top: -10px; right: -10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--ink2);
  background: var(--a1);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.preview #clear-photo:hover { background: var(--a2); }

/* Buttons */
.actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
button.primary,
button.secondary {
  border: none;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
}
button.primary { background: linear-gradient(100deg, var(--a1), var(--a2)); color: #fff; box-shadow: 0 10px 26px rgba(247,52,94,0.32); }
button.primary:hover { filter: brightness(1.06); }
button.secondary {
  background: transparent;
  color: var(--on-dark);
  border: 1px solid var(--line-d);
}
button.secondary:hover { background: rgba(247,239,228,0.1); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* JSON debug preview */
.json-preview {
  background: var(--ink);
  border-radius: 12px;
  padding: 16px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
  color: var(--on-dark);
  border: 1px solid var(--line-d);
}

/* Processing + result stages */
.stage-result,
.stage-processing { display: none; }
.stage-result.active,
.stage-processing.active { display: block; }

.processing-card { text-align: center; padding: 40px 20px; }

.spinner {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border: 5px solid rgba(247,239,228,0.12);
  border-top-color: var(--a1);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-card { text-align: center; padding: 4px; }
.result-hint { font-size: 13px; color: var(--on-dark-soft); margin: 0 0 12px; line-height: 1.45; }

/* ---- Share carousel (story-only, swipeable, Strava-style) ---- */
.share-carousel { position: relative; margin: 0 -4px; }
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-sizing: border-box;
}
.carousel-slide img {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
  border: 1px solid var(--line-d);
}
/* Transparent variant: show a checkerboard so the alpha is obvious. */
.carousel-slide.is-transparent img {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #c9c9c9 25%, transparent 25%, transparent 75%, #c9c9c9 75%),
    linear-gradient(45deg, #c9c9c9 25%, transparent 25%, transparent 75%, #c9c9c9 75%);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
}
.carousel-dots { display: flex; gap: 7px; justify-content: center; margin-top: 12px; }
.carousel-dots .dot {
  width: 8px; height: 8px; padding: 0; border: 0; cursor: pointer;
  border-radius: 50%; background: var(--line-d); transition: all .18s ease;
}
.carousel-dots .dot.on { width: 22px; border-radius: 4px; background: var(--a1); }
.carousel-label { font-size: 12.5px; font-weight: 700; color: var(--on-dark-soft); margin-top: 8px; }

/* Step indicator pills */
.step {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(247,239,228,0.06);
  border: 1px solid var(--line-d);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
  color: var(--on-dark-soft);
}
.step.active {
  background: rgba(255,106,61,0.25);
  border-color: var(--a1);
  color: var(--on-dark);
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(255,106,61,0.3);
}
.step.done {
  background: rgba(123,174,79,0.25);
  border-color: rgba(123,174,79,0.5);
  color: var(--on-dark);
}
.step.done::after { content: " ✓"; }

/* Wider container voor upload-pagina (heeft veel sections) */
.container { max-width: 920px; }

details { margin-top: 6px; }
details summary { cursor: pointer; opacity: 0.7; font-size: 12px; letter-spacing: 1px; }
details[open] summary { opacity: 1; }

/* ============================================================
   v0.21 — opgeschoonde upload-UI
   ============================================================ */

/* Section header chip (LOPERS / SUPPORTERS …). Was inline-styled per use. */
.section-header {
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 1px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Crew sub-headers inside the runners grid (grouped-by-team picker). Span the
   full grid width so each crew's avatars flow underneath their label. */
.team-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: 0.85;
  margin: 6px 0 -2px;
  padding-top: 6px;
}
.team-header:first-child { padding-top: 0; }
.team-header .team-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}
.team-header .team-count { opacity: 0.5; margin-left: auto; font-weight: 700; }

/* Tekstvelden (boodschap, plaats, km) — één gedeelde stijl i.p.v. inline. */
.field {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-d);
  background: rgba(247,239,228,0.06);
  color: var(--on-dark);
  font-size: 15px;
  font-family: inherit;
}
textarea.field { resize: vertical; min-height: 60px; line-height: 1.4; }
.field:focus { outline: none; border-color: var(--a1); }
.field-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  opacity: 0.6;
  font-size: 12px;
}

/* Transparant-toggle in de foto-kaart. Klikt aan/uit; .active = aan. */
#transparent-btn.active {
  background: var(--a1);
  color: #fff;
  border-color: var(--a1);
}

/* Submit-bar met twee knoppen (post + cartoon). */
.submit-bar .btn-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 460px;
  flex-wrap: wrap;
  justify-content: center;
}
.submit-bar .btn-row .primary { flex: 1 1 220px; }
#cartoon-btn { flex: 1 1 200px; }
#cartoon-btn .cost { font-weight: 400; opacity: 0.75; text-transform: none; letter-spacing: 0; }

/* Km stepper buttons (verborgen rij, maar consistent gestyled). */
.stepper-btn { padding: 10px 14px; font-size: 18px; font-weight: 700; min-width: 48px; }

/* GPX-locatie status (live-only). */
.loc-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.loc-status {
  flex: 1;
  min-width: 120px;
  font-size: 13px;
  opacity: 0.85;
}
.loc-status.ok { color: var(--sage); opacity: 1; }

/* Collapsible supporters-toggle (was inline-styled). */
.collapse-toggle {
  width: 100%;
  background: rgba(247,239,228,0.06);
  border: 1px solid var(--line-d);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--on-dark);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.collapse-toggle:hover { background: rgba(247,239,228,0.1); }

/* ---- Live voorbeeld (framed compositie-preview) ---- */
.preview-wrap { margin-top: 16px; display: none; flex-direction: column; align-items: center; gap: 8px; }
.preview-wrap.show { display: flex; }
.wo-preview {
  position: relative;
  height: 340px;
  aspect-ratio: 9 / 16;            /* updated to 4/5 by JS for Post-formaat */
  background:
    repeating-conic-gradient(#2a2730 0% 25%, #211e27 0% 50%) 0 / 22px 22px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--a1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  max-width: 100%;
}
.wo-preview .ph-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;             /* contain set by JS when fit=contain */
  background: var(--ink);
}
.wo-preview .ph-img.hide { display: none; }
.wo-preview-badge {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  background: var(--a1);
  color: #fff;
  padding: 5px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 2px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.wo-preview-logo {
  position: absolute;
  top: 10px; right: 12px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.wo-preview-logo span { color: var(--a1); }
.wo-preview-avatars {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 10px;
}
.wo-preview-avatars img {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  background: var(--ink);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.wo-preview-bubble {
  position: absolute;
  left: 12px; right: 12px; bottom: 62px;
  background: #fff;
  color: #1a1a1d;
  padding: 8px 12px;
  border-radius: 12px 12px 12px 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  max-height: 4.2em;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}
.wo-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-size: 13px;
  opacity: 0.6;
}
.preview-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  opacity: 0.85;
}
.preview-clear {
  background: transparent;
  border: 1px solid var(--line-d);
  color: var(--on-dark);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}
.preview-clear:hover { background: rgba(255,106,61,0.18); border-color: var(--a1); }

/* ============================ 3-step camera flow (oc-steps.js) ============== */
.wiz-steps { display: flex; align-items: center; gap: 8px; margin: 12px 2px 16px; }
.wiz-dot { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 800; color: var(--on-dark-soft); }
.wiz-dot b { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink2); border: 1px solid var(--line-d); font-size: 12px; }
.wiz-dot span { display: none; }
.wiz-dot.active { color: var(--on-dark); }
.wiz-dot.active b { background: linear-gradient(100deg, var(--a1), var(--a2)); border-color: transparent; color: #fff; }
.wiz-dot.active span { display: inline; }
.wiz-dot.done b { background: rgba(255,106,61,0.18); border-color: rgba(255,106,61,0.4); color: var(--a1); }
.wiz-bar { flex: 1; height: 2px; background: var(--line-d); border-radius: 2px; }

.wiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 4px; }
.wiz-nav .wo-btn-primary { margin-left: auto; min-width: 150px; }
.wiz-nav .wo-btn-ghost { min-width: 110px; }

/* Step 1 — camera-first */
.camera-card { text-align: center; }
.cam-actions { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.cam-primary {
  border: none; cursor: pointer; font-family: inherit; font-weight: 900; font-size: 17px; color: #fff;
  padding: 18px; border-radius: 16px;
  background: linear-gradient(100deg, var(--a1), var(--a2));
  box-shadow: 0 12px 28px rgba(247,52,94,0.32);
}
.cam-primary:active { transform: translateY(1px); }
.cam-secondary {
  background: transparent; border: 1px solid var(--line-d); color: var(--on-dark);
  border-radius: 12px; padding: 12px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
}
.camera-card .dropzone { margin-top: 2px; }

/* Step 3 — icon-only post-type picker (runners) */
.post-type-grid.icons { display: flex; flex-wrap: wrap; gap: 8px; }
.post-type-grid.icons .post-type-opt {
  flex: 0 0 auto; min-width: 0; width: 54px; height: 54px; padding: 0; border-radius: 14px; position: relative;
}
.post-type-grid.icons .post-type-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.post-type-grid.icons .pt-text { display: none; }
.post-type-grid.icons .pt-ico { font-size: 24px; line-height: 1; }

/* Show the SELECTED photo (plain — no overlay mock) before posting. */
.chosen-thumb { max-width: 240px; max-height: 320px; width: auto; border-radius: 14px; object-fit: cover; border: 1px solid var(--line-d); background: var(--ink); display: block; }
#preview-img.hide { display: none; }            /* updatePreview hides it when there's no photo */
.preview-wrap.show { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.preview-wrap .preview-meta { font-size: 13px; }
