/* Reusable Time Picker / TimePicker component / (typeable field + hour/minute/AM-PM wheel) */

.tp-wrap {
    position: relative;
    display: inline-block;
}

/* Clock affordance */
.tp-ico {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6b7280;
    opacity: 0.75;
    pointer-events: none;
    z-index: 1;
}
.tp-wrap:has(.tp-trigger:focus) .tp-ico,
.tp-wrap:has(.tp-trigger.has-val) .tp-ico { color: #16a34a; opacity: 1; }

/* The typeable field */
.tp-trigger {
    display: block;
    box-sizing: border-box;
    padding: 6px 12px 6px 30px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: text;
    line-height: 1.2;
    transition: border-color 0.12s, background 0.12s, color 0.12s, box-shadow 0.12s;
}
.tp-trigger::placeholder { color: #9ca3af; font-weight: 500; }
.tp-trigger:hover:not([disabled]):not(:focus) { border-color: #16a34a; background: #f0fdf4; }
.tp-trigger.has-val { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.tp-trigger:focus {
    outline: none;
    border-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}
.tp-trigger[disabled] { opacity: 0.6; cursor: not-allowed; background: #f3f4f6; }

/* Form-style field: matches standard form inputs so it lines up with siblings */
.tp-trigger.form-input,
.tp-trigger.doctor-form-input,
.tp-trigger.mgmt-form-input,
.tp-trigger.hrc-field-input,
.tp-trigger.hrc-date-input,
.tp-trigger.db-pay-input {
    width: 100%;
    background: #fff;
    padding: 8px 10px 8px 30px;
    border-color: #d1d5db;
    border-radius: 6px;
    min-height: 36px;
}
.tp-trigger.form-input.has-val,
.tp-trigger.doctor-form-input.has-val,
.tp-trigger.mgmt-form-input.has-val,
.tp-trigger.hrc-field-input.has-val,
.tp-trigger.hrc-date-input.has-val,
.tp-trigger.db-pay-input.has-val { background: #fff; }

.tp-wrap:has(.tp-trigger.form-input),
.tp-wrap:has(.tp-trigger.doctor-form-input),
.tp-wrap:has(.tp-trigger.mgmt-form-input),
.tp-wrap:has(.tp-trigger.hrc-field-input),
.tp-wrap:has(.tp-trigger.hrc-date-input),
.tp-wrap:has(.tp-trigger.db-pay-input) { display: block; width: 100%; }

/* Validation feedback mirrored from the hidden input onto the field */
.tp-wrap:has(input.is-invalid) .tp-trigger {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Panel (dropdown wheel) */
.tp-panel {
    position: fixed;
    width: 210px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    z-index: 9999;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}
.tp-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Three scroll columns: hour | minute | AM-PM */
.tp-cols {
    display: flex;
    gap: 6px;
}
.tp-col {
    flex: 1;
    max-height: 160px;
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 2px;
}
.tp-col::-webkit-scrollbar { width: 5px; }
.tp-col::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }
.tp-col::-webkit-scrollbar-thumb:hover { background: #d1d5db; }

.tp-opt {
    flex-shrink: 0;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
}
.tp-opt:hover { background: #f0fdf4; color: #16a34a; }
.tp-opt.active { background: #16a34a; color: #fff; font-weight: 700; }

/* Footer: Now shortcut */
.tp-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}
.tp-foot-now {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    background: #f0fdf4;
    cursor: pointer;
    transition: all 0.12s;
}
.tp-foot-now:hover { background: #16a34a; color: #fff; border-color: #16a34a; }
.tp-foot-now > i { font-size: 11px; margin-right: 4px; }
