/*
 * Custom Time Picker
 * Replaces native input[type="time"] with a text input + recent-times popup.
 * Relies on project design tokens from colors.css.
 */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.tp-wrapper {
    position: relative;
    display: block;
}

/* When inside a .times row, fix a compact width so both fields sit side by side */
.times .tp-wrapper {
    width: 100px;
}

.times .tp-text-input {
    width: 100px;
}

/* ── Visible text input ──────────────────────────────────────────────────── */

.tp-text-input {
    /* Clock icon matching the native-datetime.css style */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' 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");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 1rem 1rem;
    padding-inline-end: 2.1rem;
    box-sizing: border-box;
    width: 100%;
    min-width: 90px;
    cursor: text;
}

.tp-text-input.tp-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* ── Popup ───────────────────────────────────────────────────────────────── */

.tp-popup {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 1055;
    background: #fff;
    border: 1px solid #c5d5e8;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(21, 96, 189, 0.12);
    padding: 6px;
    min-width: 120px; /* fallback als JS niet actief is */
    flex-wrap: wrap;
    gap: 5px;
}

.tp-popup--open {
    display: flex !important;
}

/* ── Recent-time chips ───────────────────────────────────────────────────── */

.tp-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid var(--color-blue, #4B92DB);
    background: var(--color-blue-tint, #eaf3ff);
    color: var(--color-blue-dark, #1560BD);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    /* Reset button defaults */
    -webkit-appearance: none;
    appearance: none;
}

.tp-chip:hover,
.tp-chip:focus {
    background: var(--color-blue, #4B92DB);
    color: #fff;
    outline: none;
    border-color: var(--color-blue-dark, #1560BD);
}
