/* ═══════════════════════════════════════
   Time Stepper — futuristic glassmorphic wheels
   ═══════════════════════════════════════ */

/* Glass card container */
.time-stepper {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
}

/* Start + End + Break in a row */
.time-stepper__times {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--space-lg);
}

/* Each field: label → wheels */
.time-stepper__field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

/* Label */
.time-stepper__label {
  font-size: var(--text-2xs);
  font-weight: var(--font-semibold);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
}

/* Hours : Minutes side by side */
.time-stepper__wheel-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── Wheel container — recessed well ── */
.time-stepper__wheel-container {
  height: 56px;
  overflow: hidden;
  position: relative;
  width: 3.5rem;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.time-stepper .time-stepper__wheel-container--break {
  width: 4.5rem;
}

/* Fade mask: smooth gradient edges */
.time-stepper__wheel-container::before,
.time-stepper__wheel-container::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}

.time-stepper__wheel-container::before {
  top: 0;
  height: 6px;
  background: linear-gradient(to bottom, var(--surface-2), transparent);
}

.time-stepper__wheel-container::after {
  bottom: 0;
  height: 6px;
  background: linear-gradient(to top, var(--surface-2), transparent);
}

/* Active item highlight — soft glow strip */
.time-stepper__wheel-highlight {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 44px;
  background: linear-gradient(180deg,
    rgba(167, 139, 250, 0.06) 0%,
    rgba(167, 139, 250, 0.10) 50%,
    rgba(167, 139, 250, 0.06) 100%
  );
  z-index: 0;
  pointer-events: none;
}

/* ── Scrollable wheel ── */
.time-stepper__wheel {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
  touch-action: pan-y;
}

.time-stepper__wheel::-webkit-scrollbar {
  display: none;
}

/* Spacer elements */
.time-stepper__wheel-spacer {
  height: 6px;
  flex-shrink: 0;
}

/* Each item — faded ghosts */
.time-stepper__wheel-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  opacity: 0.5;
  transition: all 0.1s ease;
  user-select: none;
  cursor: grab;
}

/* Active item — bright, glowing */
.time-stepper__wheel-item--active {
  color: var(--text);
  opacity: 1;
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  text-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
}

/* ── Separator : ── */
.time-stepper__separator {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text-faint);
  opacity: 0.4;
  align-self: center;
}

/* ── Duration badge — next to break wheel ── */
.time-stepper__duration {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
}

.time-stepper__duration--danger {
  color: var(--danger);
}

/* ── Break row — label/wheel + duration ── */
.time-stepper__break-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2xl);
  margin-top: var(--space-md);
}

.time-stepper__break-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Hidden selects ── */
.time-stepper__hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

/* ═══════════════════════════════════════
   Light theme
   ═══════════════════════════════════════ */
[data-theme="light"] .time-stepper {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .time-stepper__wheel-container {
  background: var(--surface);
}

[data-theme="light"] .time-stepper__wheel-container::before {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.6) 0%, transparent 100%);
}

[data-theme="light"] .time-stepper__wheel-container::after {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.6) 0%, transparent 100%);
}

[data-theme="light"] .time-stepper__wheel-highlight {
  background: linear-gradient(180deg,
    rgba(139, 92, 246, 0.03) 0%,
    rgba(139, 92, 246, 0.06) 50%,
    rgba(139, 92, 246, 0.03) 100%
  );
}

[data-theme="light"] .time-stepper__wheel-item--active {
  text-shadow: 0 0 8px rgba(139, 92, 246, 0.15);
}

/* ═══════════════════════════════════════
   Responsive
   ═══════════════════════════════════════ */
@media (max-width: 380px) {
  .time-stepper__times {
    gap: var(--space-md);
  }

  .time-stepper__wheel-container {
    width: 3rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .time-stepper__wheel {
    scroll-behavior: auto;
  }

  .time-stepper__wheel-item {
    transition: none;
  }
}
