/* ─────────────────────────────────────────────────────────────────
   universal-time-picker.css — ushift-style scroll-wheel time picker
   ───────────────────────────────────────────────────────────────── */

@keyframes utpFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#universal-timepicker-portal {
  box-sizing: border-box;
}

/* HH:mm is a fixed left-to-right structure regardless of page language —
   main.css's `html.rtl * { direction: rtl; }` is a universal selector with
   higher specificity than a plain single-class rule would have, so it was
   silently winning over `.utp-popup { direction: ltr }` and flipping hours/
   minutes to the wrong sides on RTL pages. !important + matching the
   descendant coverage of that rule guarantees this wins instead. */
.utp-popup,
.utp-popup * {
  direction: ltr !important;
}

.utp-popup {
  background: var(--calendar-background);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
  padding: 10px;
  animation: utpFadeIn 0.14s ease forwards;
  user-select: none;
  font-family: inherit;
  box-sizing: border-box;
}

.utp-cols {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.utp-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.utp-col-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--text-color) 55%, transparent);
}

.utp-colon {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--button-bg);
  padding: 0 2px 14px;
  align-self: center;
}

/* ──── Drum column ──── */

.utp-drum {
  position: relative;
  width: 60px;
}

.utp-drum-scroller {
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.utp-drum-scroller:active {
  cursor: grabbing;
}
.utp-drum-scroller::-webkit-scrollbar {
  display: none;
}

.utp-drum-row {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--text-color) 45%, transparent);
  cursor: pointer;
  transition: color 0.08s, transform 0.08s;
}

.utp-drum-row-active {
  color: var(--button-bg);
  font-weight: 800;
  transform: scale(1.12);
}

/* Static highlight band — always the center row; the list scrolls under it */
.utp-drum-highlight {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 80px; /* ITEM_H * 2 */
  height: 40px; /* ITEM_H */
  border-radius: 10px;
  background: color-mix(in srgb, var(--button-bg) 12%, transparent);
  border-top: 1.5px solid color-mix(in srgb, var(--button-bg) 45%, transparent);
  border-bottom: 1.5px solid color-mix(in srgb, var(--button-bg) 45%, transparent);
  pointer-events: none;
  z-index: 0;
}

.utp-drum-scroller,
.utp-drum-fade {
  z-index: 1;
}

.utp-drum-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 80px; /* ITEM_H * 2 */
  pointer-events: none;
}
.utp-drum-fade-top {
  top: 0;
  background: linear-gradient(to bottom, var(--calendar-background) 0%, transparent 100%);
}
.utp-drum-fade-bottom {
  bottom: 0;
  background: linear-gradient(to top, var(--calendar-background) 0%, transparent 100%);
}

/* ──── Confirm button ──── */

.utp-confirm-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  background: var(--button-bg);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.1s;
}
.utp-confirm-btn:hover {
  opacity: 0.88;
}

/* ──── Mobile breakpoints ──── */

@media (max-width: 640px) {
  .utp-popup {
    padding: 8px;
    border-radius: 12px;
  }
  .utp-drum {
    width: 52px;
  }
  .utp-drum-row {
    font-size: 0.95rem;
  }
  .utp-confirm-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}
