/* WheelTimePicker - seletor de hora em roda (ver /js/wheel-time-picker.js) */

.wtp-overlay {
  --wtp-item-height: 52px;

  position: fixed;
  inset: 0;
  /* acima do modal do Bootstrap (1055) e do backdrop (1050) */
  z-index: 2000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(17, 24, 39, 0.5);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.wtp-overlay.is-open {
  opacity: 1;
}

/* trava a rolagem do fundo enquanto a roda esta aberta */
body.wtp-open {
  overflow: hidden;
}

.wtp-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #ffffff;
  color: var(--theme-text, #374151);
  padding-bottom: env(safe-area-inset-bottom, 0);
  transform: translateY(14px);
  transition: transform 0.22s ease;
}

.wtp-overlay.is-open .wtp-sheet {
  transform: translateY(0);
}

.wtp-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 1.1rem 1rem 0.9rem;
  border-bottom: 1px solid var(--theme-border, #e5e7eb);
  text-align: center;
}

.wtp-title {
  font-size: 1rem;
  font-weight: 600;
}

.wtp-subtitle {
  font-size: 0.82rem;
  color: var(--theme-text-muted, #6b7280);
}

.wtp-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wtp-wheels {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: calc(var(--wtp-item-height) * 5);
  width: 100%;
  max-width: 320px;
}

.wtp-highlight {
  position: absolute;
  top: calc(var(--wtp-item-height) * 2);
  left: 0;
  right: 0;
  height: var(--wtp-item-height);
  border-radius: 14px;
  background: rgba(var(--theme-primary-rgb, 31, 85, 103), 0.08);
  pointer-events: none;
}

.wtp-column {
  position: relative;
  height: 100%;
  width: 5rem;
}

/* Fica invisivel sobre o numero do meio ate o usuario tocar nele; enquanto
   isso nao intercepta o arrasto da roda (pointer-events: none). */
.wtp-typed {
  position: absolute;
  top: calc(var(--wtp-item-height) * 2);
  left: 0;
  width: 100%;
  height: var(--wtp-item-height);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--theme-primary, #1f5567);
  caret-color: var(--theme-primary, #1f5567);
  transform: scale(1.14);
  opacity: 0;
  pointer-events: none;
  outline: none;
}

.wtp-column.is-typing .wtp-typed {
  opacity: 1;
  pointer-events: auto;
}

/* enquanto digita, o numero da roda sai de cena para nao duplicar */
.wtp-column.is-typing .wtp-item.is-selected {
  opacity: 0;
}

.wtp-colon {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--theme-primary, #1f5567);
  padding-bottom: 0.15rem;
}

.wtp-wheel {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  outline: none;
  /* apaga as extremidades, deixando o centro em evidencia */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 80%, transparent 100%);
}

.wtp-wheel::-webkit-scrollbar {
  display: none;
}

.wtp-spacer {
  height: calc(var(--wtp-item-height) * 2);
}

.wtp-item {
  height: var(--wtp-item-height);
  line-height: var(--wtp-item-height);
  scroll-snap-align: center;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--theme-text-muted, #6b7280);
  opacity: 0.5;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.wtp-item.is-selected {
  opacity: 1;
  color: var(--theme-primary, #1f5567);
  font-weight: 700;
  transform: scale(1.14);
}

.wtp-footer {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.25rem 1rem 1.1rem;
}

/* Acoes de apoio (digitar / limpar) acima dos dois botoes principais. */
.wtp-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.wtp-keyboard,
.wtp-clear {
  border: 0;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
}

.wtp-keyboard {
  color: var(--theme-primary, #1f5567);
}

.wtp-keyboard:hover {
  background-color: rgba(var(--theme-primary-rgb, 31, 85, 103), 0.09);
}

.wtp-clear {
  color: #b91c1c;
}

.wtp-clear:hover {
  background-color: rgba(185, 28, 28, 0.08);
}

.wtp-actions {
  display: flex;
  gap: 0.6rem;
}

.wtp-btn {
  flex: 1 1 0;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, filter 0.15s ease;
}

.wtp-cancel {
  border: 1px solid var(--theme-border, #e5e7eb);
  background-color: #fff;
  color: var(--theme-text, #374151);
}

.wtp-cancel:hover {
  background-color: #f3f4f6;
}

/* mesma linguagem do botao Salvar do app: cor do tema com texto branco */
.wtp-confirm {
  border: 1px solid var(--theme-primary, #1f5567);
  background-color: var(--theme-primary, #1f5567);
  color: #fff;
}

.wtp-confirm:hover {
  filter: brightness(0.94);
}

/* No desktop vira um card centralizado em vez de ocupar a tela toda. */
@media (min-width: 576px) {
  .wtp-overlay {
    align-items: center;
    padding: 1rem;
  }

  .wtp-sheet {
    max-width: 380px;
    border-radius: 18px;
    box-shadow: 0 20px 45px rgba(17, 24, 39, 0.25);
    overflow: hidden;
  }

  .wtp-body {
    padding: 1.25rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wtp-overlay,
  .wtp-sheet,
  .wtp-item {
    transition: none;
  }
}
