/* NX barrel time — 24h quiet-hours / clock picker (Midnight CRM) */
.nx-barrel-time {
  --nx-bt-item-h: 36px;
  --nx-bt-vis-h: 36px;
  --nx-bt-face-h: 126px;
  --nx-bt-fg: rgba(236, 241, 243, 0.92);
  --nx-bt-fg-muted: rgba(215, 222, 234, 0.42);
  --nx-bt-visor: rgba(255, 255, 255, 0.08);
  --nx-bt-visor-border: rgba(255, 255, 255, 0.14);
  --nx-bt-surface: rgba(255, 255, 255, 0.03);
  --nx-bt-border: rgba(255, 255, 255, 0.10);
  --nx-bt-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  width: 100%;
  max-width: 280px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

html:not(.midnight):not([data-bs-theme="midnight"]) .nx-barrel-time {
  --nx-bt-fg: rgba(31, 42, 56, 0.92);
  --nx-bt-fg-muted: rgba(31, 42, 56, 0.35);
  --nx-bt-visor: rgba(0, 0, 0, 0.06);
  --nx-bt-visor-border: rgba(0, 0, 0, 0.10);
  --nx-bt-surface: rgba(0, 0, 0, 0.03);
  --nx-bt-border: rgba(0, 0, 0, 0.10);
  --nx-bt-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.nx-barrel-time__input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.nx-barrel-time__face {
  position: relative;
  height: var(--nx-bt-face-h);
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  border-radius: 14px;
  border: 1px solid var(--nx-bt-border);
  background: var(--nx-bt-surface);
  box-shadow: var(--nx-bt-shadow);
  overflow: hidden !important;
  -webkit-mask-image: linear-gradient(#0000, #000 18%, #000 82%, #0000);
  mask-image: linear-gradient(#0000, #000 18%, #000 82%, #0000);
}

.nx-barrel-time__visor {
  pointer-events: none;
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: var(--nx-bt-vis-h);
  transform: translateY(-50%);
  border-radius: 10px;
  background: var(--nx-bt-visor);
  border: 1px solid var(--nx-bt-visor-border);
  z-index: 2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nx-barrel-time__col {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: 110px;
  z-index: 1;
}

/* Class must NOT contain "scroll" — midnight CSS forces bars on [class*="scroll"] */
.nx-barrel-time__drum {
  height: 100%;
  width: 100%;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 0;
  margin: 0;
  list-style: none;
  outline: none;
  cursor: grab;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.nx-barrel-time__drum:active,
.nx-barrel-time.is-dragging .nx-barrel-time__drum {
  cursor: grabbing;
}

.nx-barrel-time__drum::-webkit-scrollbar,
.nx-barrel-time__drum::-webkit-scrollbar-track,
.nx-barrel-time__drum::-webkit-scrollbar-thumb,
:is(html.midnight, html[data-bs-theme="midnight"]) .nx-barrel-time__drum::-webkit-scrollbar,
:is(html.midnight, html[data-bs-theme="midnight"]) .nx-barrel-time__drum::-webkit-scrollbar-track,
:is(html.midnight, html[data-bs-theme="midnight"]) .nx-barrel-time__drum::-webkit-scrollbar-thumb {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.nx-barrel-time__pad {
  height: calc((var(--nx-bt-face-h) - var(--nx-bt-item-h)) / 2);
  flex-shrink: 0;
  scroll-snap-align: none;
  pointer-events: none;
}

.nx-barrel-time__item {
  height: var(--nx-bt-item-h);
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  font-size: 1.25rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--nx-bt-fg-muted);
  transition: color 0.12s ease, transform 0.12s ease;
  pointer-events: none;
}

.nx-barrel-time__item.is-active {
  color: var(--nx-bt-fg);
  transform: scale(1.06);
}

.nx-barrel-time__colon {
  flex: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--nx-bt-fg);
  z-index: 3;
  pointer-events: none;
  opacity: 0.85;
}

.nx-barrel-time__hint {
  display: none !important;
}

.nx-barrel-time.is-focus .nx-barrel-time__face {
  border-color: rgba(64, 153, 255, 0.55);
  box-shadow: var(--nx-bt-shadow), 0 0 0 2px rgba(64, 153, 255, 0.25);
}

@media (max-width: 767.98px) {
  .nx-barrel-time {
    max-width: none;
    --nx-bt-item-h: 48px;
    --nx-bt-vis-h: 48px;
    --nx-bt-face-h: 168px;
  }
  .nx-barrel-time__item {
    font-size: 1.45rem;
  }
  .nx-barrel-time__colon {
    flex: 0 0 18px;
    font-size: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .nx-barrel-time {
    --nx-bt-item-h: 52px;
    --nx-bt-vis-h: 52px;
    --nx-bt-face-h: 176px;
  }
  .nx-barrel-time__item {
    font-size: 1.5rem;
  }
}

@media (pointer: coarse) {
  .nx-barrel-time__drum {
    scroll-snap-type: y mandatory;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .nx-barrel-time {
    max-width: 240px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .nx-barrel-time__col:hover .nx-barrel-time__drum {
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(255, 255, 255, 0.02) 50%,
      transparent 100%
    );
  }
}
