/*
 * Styling for the native <input type="range"> sliders that replace
 * holiday_planner.html.twig's old jQuery UI slider widgets (jQuery UI was
 * never ported to AssetMapper and isn't being reintroduced as a dependency —
 * see assets/controllers/holiday_planner_controller.js).
 *
 * All sliders (single and dual) share the same custom track/thumb here
 * rather than the browser's built-in accent-color rendering, because the
 * dual (min/max) slider needs one — accent-color always fills from the
 * track's start up to the thumb, so each of its two overlaid inputs would
 * paint blue from the left edge to its own value, coloring the segment
 * before the min thumb too. Once the dual slider draws its own track/thumb,
 * the single sliders have to match it explicitly instead of falling back to
 * the (differently rendered) native accent-color look.
 *
 * Chrome/Safari have no equivalent of Firefox's ::-moz-range-progress, so
 * the filled portion there is a background gradient driven by the --fill
 * custom property, which the controller updates from the input's value.
 */

.holiday-planner-range {
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.holiday-planner-range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #00489a var(--fill, 0%), #d8d8d8 var(--fill, 0%));
}

.holiday-planner-range::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: #d8d8d8;
    border: none;
}

.holiday-planner-range::-moz-range-progress {
    height: 4px;
    border-radius: 2px 0 0 2px;
    background: #00489a;
}

.holiday-planner-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -7px;
    border-radius: 50%;
    background: #00489a;
    cursor: pointer;
}

.holiday-planner-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00489a;
    border: none;
    cursor: pointer;
}

.holiday-planner-range-dual {
    position: relative;
    height: 28px;
    cursor: pointer;
    touch-action: none;
}

.holiday-planner-range-dual .holiday-planner-range-track,
.holiday-planner-range-dual .holiday-planner-range-fill {
    position: absolute;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 2px;
    pointer-events: none;
}

.holiday-planner-range-dual .holiday-planner-range-track {
    left: 0;
    right: 0;
    background: #d8d8d8;
}

.holiday-planner-range-dual .holiday-planner-range-fill {
    background: #00489a;
}

.holiday-planner-range-dual .holiday-planner-range {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* The dual slider's own track/fill bars (above) provide the coloring, so
   each overlaid input's native track rendering is switched off. */
.holiday-planner-range-dual .holiday-planner-range::-webkit-slider-runnable-track {
    background: transparent;
}

.holiday-planner-range-dual .holiday-planner-range::-moz-range-track,
.holiday-planner-range-dual .holiday-planner-range::-moz-range-progress {
    background: transparent;
}

/*
 * Tab 1's filter content (headings + sliders) is visible server-side by
 * default, so it'd otherwise show raw checkboxes and unbuilt slider
 * placeholders for a moment before the controller connects and builds them.
 * A spinner covers that gap instead; holiday_planner_controller.js reveals
 * the real content and removes the spinner once ready.
 */
.holiday-planner-content {
    display: none;
}

[data-controller~="holiday-planner"].is-ready .holiday-planner-content {
    display: block;
}

.holiday-planner-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

[data-controller~="holiday-planner"].is-ready .holiday-planner-loading {
    display: none;
}
