/* ═══════════════════════════════════════════════════════════════════════════
   PACE SLIDER  —  native <input type="range"> styled with vendor prefixes.
   Precyzja na mobile: JS przechwytuje touchmove i oblicza wartość z pikseli.
   ═══════════════════════════════════════════════════════════════════════════ */

.slider-wrap {
  padding: 8px 0 4px;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
.pace-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 52px;        /* desktop — duży obszar dotykowy */
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
  border: none;
  --fill: 58.8%;
}

@media (max-width: 767px) {
  .pace-slider {
    height: 30px;
  }

  .nudge-row {
    gap: 6px;
    margin-top: 5px;
  }

  .nudge-btn {
    min-height: 32px;
    min-width: 0;
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: 9px;
  }
}

/* ── TRACK — WebKit (Chrome, Safari, iOS) ────────────────────────────────── */
.pace-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    #ff4500  0%,
    #ff7340  var(--fill),
    #2e2e48  var(--fill),
    #2e2e48  100%
  );
}

/* ── THUMB — WebKit ──────────────────────────────────────────────────────── */
.pace-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #ff4500;
  /* center thumb on the 8px track: (8 - 34) / 2 = -13 */
  margin-top: -13px;
  box-shadow:
    0 0 0 6px rgba(255, 69, 0, 0.22),
    0 3px 12px rgba(0, 0, 0, 0.55);
  cursor: grab;
  transition: box-shadow 0.18s, transform 0.12s, border-color 0.15s;
}

.pace-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.2);
  border-color: #ff7340;
  box-shadow:
    0 0 0 13px rgba(255, 69, 0, 0.18),
    0 5px 18px rgba(0, 0, 0, 0.65);
}

/* ── TRACK — Firefox ─────────────────────────────────────────────────────── */
.pace-slider::-moz-range-track {
  height: 8px;
  border-radius: 99px;
  background: #2e2e48;
}

.pace-slider::-moz-range-progress {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(to right, #ff4500, #ff7340);
}

/* ── THUMB — Firefox ─────────────────────────────────────────────────────── */
.pace-slider::-moz-range-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #ff4500;
  box-shadow:
    0 0 0 6px rgba(255, 69, 0, 0.22),
    0 3px 12px rgba(0, 0, 0, 0.55);
  cursor: grab;
}

/* ── Range endpoint labels ───────────────────────────────────────────────── */
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 2px 0;
  font-variant-numeric: tabular-nums;
}

.slider-labels span:last-child {
  color: #ff7340;
}

/* ── Nudge ±0:01 buttons ─────────────────────────────────────────────────── */
.nudge-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.nudge-btn {
  /* Reset browser/iOS defaults */
  -webkit-appearance: none;
  appearance: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  flex: 1;
  max-width: 180px;
  padding: 11px 16px;
  border-radius: 12px;

  background: var(--bg-elevated);
  border: 2px solid rgba(255, 69, 0, 0.5);
  color: var(--text);

  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;

  min-height: 48px;
  min-width: 100px;

  box-shadow:
    0 0 0 1px rgba(255, 69, 0, 0.12),
    0 4px 16px rgba(0, 0, 0, 0.45);

  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;   /* blokuje iOS "Dodaj do kalendarza" */
  cursor: pointer;

  transition: background 0.13s, border-color 0.15s, color 0.13s,
              box-shadow 0.15s, transform 0.1s;
}

.nudge-btn:hover {
  background: var(--bg-elevated);
  border-color: rgba(255, 69, 0, 0.8);
  box-shadow:
    0 0 0 1px rgba(255, 69, 0, 0.25),
    0 6px 20px rgba(0, 0, 0, 0.25);
}

html.dark .nudge-btn:hover {
  background: #1e1e38;
  box-shadow:
    0 0 0 1px rgba(255, 69, 0, 0.25),
    0 6px 20px rgba(0, 0, 0, 0.5);
}

.nudge-btn:active,
.nudge-btn.pressing {
  background: rgba(255, 69, 0, 0.2);
  border-color: #ff4500;
  color: #ff7340;
  transform: scale(0.95);
  box-shadow:
    0 0 0 3px rgba(255, 69, 0, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.4);
}

.nudge-label {
  font-variant-numeric: tabular-nums;
}
