/**
 * Kiosk time wheel — touch-friendly HH:MM picker (shared across kiosks).
 * Two scroll-snap columns (hours + minutes). Theme-aware via dash tokens.
 * Paired with public/js/kiosk-shared/time-wheel.js.
 */

/* Tappable field that opens the wheel (replaces <input type="time">) */
.qk-time-field {
    text-align: left;
    cursor: pointer;
    position: relative;
    padding-right: 2.75rem;
}
.qk-time-field::after {
    content: "";
    position: absolute;
    right: 0.9rem;
    top: 50%;
    width: 1.25rem;
    height: 1.25rem;
    transform: translateY(-50%);
    background-color: var(--color-dash-text-muted, #9ca3af);
    -webkit-mask: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15 14'/%3E%3C/svg%3E");
    mask: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15 14'/%3E%3C/svg%3E");
}
.qk-time-field.tw-empty {
    color: var(--color-dash-text-muted, #9ca3af);
}

/* Overlay + dialog */
.tw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 13000; /* above the blocking work-day gate and activity dialogs */
    overflow-y: auto; /* landscape phones: the dialog scrolls instead of being cut */
    padding: 0.5rem;
}
.tw-dialog {
    margin: auto;     /* safe centring: never cut off at the top */
    background: var(--color-dash-card, #fff);
    border: 1px solid var(--color-dash-border, #e5e7eb);
    border-radius: 16px;
    padding: 20px;
    width: 340px;
    max-width: 92vw;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
}
.tw-title {
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    color: var(--color-dash-text-primary, #111827);
}

/* Wheels */
.tw-wheels {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
}
.tw-col {
    position: relative;
    flex: 1;
    max-width: 120px;
}
.tw-scroll {
    overflow-y: auto;
    overflow-x: hidden; /* the enlarged active row must not scroll sideways */
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
}
.tw-scroll::-webkit-scrollbar { display: none; }
.tw-item {
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-dash-text-muted, #9ca3af);
    transition: color 0.12s, transform 0.12s;
    cursor: pointer;
    user-select: none;
}
.tw-item.tw-active {
    color: var(--color-dash-text-primary, #111827);
    transform: scale(1.08);
}
.tw-sep {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-dash-text-primary, #111827);
    padding: 0 2px;
}
/* Center selection band */
.tw-highlight {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 56px;
    transform: translateY(-50%);
    border-top: 1px solid var(--color-dash-border, #e5e7eb);
    border-bottom: 1px solid var(--color-dash-border, #e5e7eb);
    background: var(--color-dash-card-hover, rgba(0, 0, 0, 0.04));
    pointer-events: none;
    z-index: 0;
}

/* Actions */
.tw-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.tw-btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
}
.tw-btn-cancel {
    background: var(--color-dash-bg, #f3f4f6);
    color: var(--color-dash-text-secondary, #4b5563);
    border: 1px solid var(--color-dash-border, #e5e7eb);
}
.tw-btn-ok {
    background: var(--color-primary, #2563eb);
    color: #fff;
}

/* Short screens (landscape phones): time-wheel.js shows 3 rows instead of 5;
   tighter spacing keeps title, wheels and buttons on one screen. */
@media (max-height: 520px) {
    .tw-dialog { padding: 12px 16px; }
    .tw-title { margin-bottom: 6px; }
    .tw-actions { margin-top: 10px; }
    .tw-btn { padding: 10px; }
}
