/* 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: rgba(15,15,18,0.4);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
}
.runner:hover { background: rgba(217,106,58,0.18); }
.runner.selected { border-color: var(--coral); background: rgba(217,106,58,0.25); }
.runner img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #1a1a1d;
}
.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(--coral);
  color: var(--cream);
  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(--cream);
}

/* 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: rgba(15,15,18,0.4);
  border-radius: 12px;
  border-left: 4px solid var(--coral);
}
.runner-config img {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--coral);
}
.runner-config input[type=text] {
  background: rgba(245,226,199,0.08);
  border: 1px solid rgba(245,226,199,0.2);
  color: var(--cream);
  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(245,226,199,0.1);
  border: none;
  color: var(--cream);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}
.runner-config .remove:hover { background: rgba(217,106,58,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(245,226,199,0.08);
  border: 1px solid rgba(245,226,199,0.2);
  color: var(--cream);
  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(--coral); }

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

/* Option pills (post-type / gpx-mode / fit / output-mode). Base style only —
   the selected coral border is applied as inline borderColor by the JS
   updaters (updatePostType / updateGpxMode / updateFit / updateOutputMode),
   which overrides the default border below. */
.post-type-opt, .gpx-mode-opt, .fit-opt {
  border: 2px solid rgba(245,226,199,0.15);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  justify-content: center;
  flex: 1 1 calc(33% - 8px);
  min-width: 120px;
}
.fit-opt { flex-basis: calc(50% - 8px); min-width: 140px; }
.output-opt {
  border: 2px solid rgba(245,226,199,0.15);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
}

/* 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(13,16,28,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245,226,199,0.15);
  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: rgba(217,106,58,0.95);
  border: 2px solid var(--cream);
  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(245,226,199,0.3);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.dropzone:hover,
.dropzone.drag { background: rgba(217,106,58,0.18); border-color: var(--coral); }
.dropzone p { margin: 6px 0; opacity: 0.85; }
.dropzone strong { color: var(--coral); }

.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(--coral);
  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(--cream);
  background: var(--coral);
  color: var(--cream);
  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: #c75d2f; }

/* Buttons */
.actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
button.primary,
button.secondary {
  border: none;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
}
button.primary { background: var(--coral); color: var(--cream); }
button.primary:hover { background: #c75d2f; }
button.secondary {
  background: rgba(245,226,199,0.12);
  color: var(--cream);
  border: 1px solid rgba(245,226,199,0.25);
}
button.secondary:hover { background: rgba(245,226,199,0.2); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* JSON debug preview */
.json-preview {
  background: rgba(15,15,18,0.7);
  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(--cream);
  border: 1px solid rgba(245,226,199,0.15);
}

/* 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(245,226,199,0.15);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-card { text-align: center; padding: 4px; }
.result-card img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
  border: 2px solid rgba(245,226,199,0.2);
}

/* Step indicator pills */
.step {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(245,226,199,0.08);
  border: 1px solid rgba(245,226,199,0.15);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
  color: rgba(245,226,199,0.6);
}
.step.active {
  background: rgba(217,106,58,0.25);
  border-color: var(--coral);
  color: var(--cream);
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(217,106,58,0.3);
}
.step.done {
  background: rgba(127,169,104,0.25);
  border-color: rgba(127,169,104,0.5);
  color: var(--cream);
}
.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; }
