/* Shared combobox treatment for provider and booking-location pickers. */
.provider-combobox,
.maintenance-location-combobox {
    position: relative;
}

.provider-combobox-menu {
    position: absolute;
    z-index: 90;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    overflow: hidden;
    transform-origin: top;
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.provider-combobox-menu.hidden {
    display: block !important;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-0.25rem) scale(0.98);
}

.provider-combobox:not(.is-open) .provider-combobox-menu,
.maintenance-location-combobox:not(.is-open) .provider-combobox-menu {
    pointer-events: none;
    opacity: 0;
    transform: translateY(-0.25rem) scale(0.98);
}

.provider-combobox.is-open .provider-combobox-menu,
.maintenance-location-combobox.is-open .provider-combobox-menu {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.provider-combobox [data-provider-combobox-button],
.maintenance-location-combobox [data-booking-location-button] {
    display: flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-left: 1rem;
    padding-right: 0.75rem;
    background-image: none;
}

.provider-combobox [data-provider-combobox-label],
.maintenance-location-combobox [data-booking-location-label] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.provider-combobox-option {
    display: flex;
    width: 100%;
    min-height: 2.35rem;
    align-items: center;
    border-radius: 0.45rem;
    padding: 0.55rem 0.75rem;
    text-align: left;
    transition: background-color 0.14s ease, color 0.14s ease;
}

/* The component deliberately uses a flex display value, which would
   otherwise override Tailwind's generic hidden rule on filtered options. */
.provider-combobox-option[hidden] {
    display: none !important;
}

.provider-combobox-option:hover {
    background: #e5e7eb;
}

.provider-combobox-option:active,
.provider-combobox-option.is-active {
    background: #2f3846;
    color: #fff;
}

/* The booking picker stays below the trigger and may extend beyond its modal. */
.maintenance-location-combobox .provider-combobox-menu {
    top: calc(100% + 0.35rem);
    bottom: auto;
    transform-origin: top;
}

/* The shared picker portals this menu to the document body while open so it
   can remain below its trigger without being clipped by a dialog. */
.provider-combobox-menu.is-portal-open {
    position: absolute;
    z-index: 2000;
    right: auto;
    top: auto;
    bottom: auto;
    max-width: calc(100vw - 1rem);
    overflow: visible;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* The picker menu must be able to extend beyond the compact booking modal. */
.booking-task-modal {
    overflow: visible;
}

.booking-task-modal-box {
    position: relative;
    overflow: visible;
}

/* Empty end-date/time controls are valid optional values. Keep a stale
   client-validation state from making a cleared native date/time control look
   like a required field that is blocking save. */
.booking-task-modal input[data-validation-empty-is-valid="1"].booking-optional-empty.input-error,
.booking-task-modal input[data-validation-empty-is-valid="1"].booking-optional-empty[aria-invalid="true"] {
    --tw-border-opacity: 1;
    border-color: var(--fallback-bc, oklch(var(--bc) / 0.2)) !important;
    outline-color: var(--fallback-bc, oklch(var(--bc) / 0.2)) !important;
    box-shadow: none !important;
}
