/* ============================================================
   ClickToBook homepage — bespoke search-widget styling.
   Scoped, no Bootstrap. Loaded only on the (Tailwind) homepage to
   style transitional Flight Search widgets whose markup must stay intact:
     - select2 airport pickers (#from/#to, .searchable)
     - mc-calendar flight date picker
     - JS-generated multi-city segments (.multicity-segment, Bootstrap cols)
   Brand colour recoloured from the legacy maroon to teal (#22B5BC).
   ============================================================ */

/* ---------- select2 airport pickers — modern & clean ---------- */
.select2-container--default .select2-selection--single {
    height: 52px !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 12px !important;
    background: #f9fafb !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 0.4rem 0 0.9rem !important;
    transition: border-color .15s, box-shadow .15s, background .15s !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.4 !important;
    color: #1f2937 !important;
    font-size: .95rem !important;
    padding: 0 !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #9ca3af !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 50px !important; right: 10px !important; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    width: 8px !important; height: 8px !important; margin: -5px 0 0 -5px !important;
    border: 0 !important; border-right: 1.5px solid #64748b !important;
    border-bottom: 1.5px solid #64748b !important; transform: rotate(45deg);
    transition: transform .2s, border-color .2s;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    transform: rotate(225deg); border-color: #22B5BC !important;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #22B5BC !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(34, 181, 188, 0.12) !important;
}
/* dropdown */
.select2-dropdown {
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16) !important;
    overflow: hidden !important;
    padding: 6px !important;
    margin-top: 6px !important;
}
.select2-search--dropdown { padding: 6px !important; }
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1.5px solid #e5e7eb !important;
    border-radius: 9px !important;
    padding: .55rem .75rem !important;
    outline: none !important;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #22B5BC !important;
    box-shadow: 0 0 0 3px rgba(34, 181, 188, 0.12) !important;
}
.select2-results__options { max-height: 280px !important; }
.select2-container--default .select2-results__option {
    border-radius: 9px !important;
    padding: .6rem .7rem !important;
    color: #374151 !important;
    font-size: .9rem !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #E7F7F8 !important;
    color: #157A80 !important;
}
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #E7F7F8 !important; color: #157A80 !important; font-weight: 600;
}

/* ---------- mc-calendar (flight datepicker) — modern teal restyle ---------- */
#calendar-container { z-index: 1100 !important; }

/* Dimming + blur backdrop. The base plugin CSS never styles .calendar-overlay,
   so without this it has no size/background (no dimming, and the existing
   "click overlay → close" handler never fires). Default hidden; the JS toggles
   inline display:block/none (inline beats this non-!important display). */
.calendar-overlay {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(13, 20, 33, 0.55) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 1090 !important;
}

.mc-calendar--modal {
    border: none !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35) !important;
    overflow: hidden !important;
}
.mc-display {
    background: linear-gradient(135deg, #22B5BC 0%, #1A9AA0 100%) !important;
    color: #fff !important;
}
.mc-display__day, .mc-display__date, .mc-display__month, .mc-display__year { color: #fff !important; }
.mc-picker { background: #fff !important; }
.mc-picker__header { padding-top: 1em !important; padding-bottom: .5em !important; }
.mc-select__nav { color: #22B5BC !important; }
.mc-select__data { color: #1f2937 !important; font-weight: 600 !important; }
.mc-table__weekday { color: #9ca3af !important; font-weight: 600 !important; font-size: 13px !important; }

/* Day cells — bigger & clearer */
.mc-date {
    border-radius: 10px !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    transition: background-color .12s, color .12s, box-shadow .12s !important;
}
/* hover only on real, selectable days */
.mc-date:not(.mc-date--disabled):not(.mc-date--inactive):not(.mc-date--picked):not(.mc-date--departure):not(.mc-date--range-start):not(.mc-date--range-end):hover {
    background-color: #E7F7F8 !important;
    color: #157A80 !important;
}
/* "today" = teal ring + teal text (no grey box), unless it's the chosen date */
.mc-date--today:not(.mc-date--picked):not(.mc-date--departure):not(.mc-date--range-start):not(.mc-date--range-end) {
    background-color: transparent !important;
    color: #22B5BC !important;
    font-weight: 700 !important;
    box-shadow: inset 0 0 0 1.5px #22B5BC !important;
}
/* ONLY the chosen date(s) are filled teal — not every selectable day */
.mc-date--picked, .mc-date--departure, .mc-date--marked, .mc-date--range-start, .mc-date--range-end {
    background-color: #22B5BC !important;
    color: #fff !important;
    box-shadow: none !important;
}

/* footer buttons — bigger & clearer */
.mc-picker__footer { padding: 16px 20px !important; border-top: 1px solid #f1f5f9 !important; align-items: center !important; }
.mc-footer__section--secondary { display: flex !important; gap: 10px !important; }
.mc-btn {
    padding: 11px 22px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    min-width: 108px !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    text-transform: none !important;
    transition: background-color .15s, color .15s !important;
}
#btn-ok { background: #22B5BC !important; color: #fff !important; }
#btn-ok:hover { background: #1A9AA0 !important; }
#btn-cancel { background: #f1f5f9 !important; color: #475569 !important; }
#btn-cancel:hover { background: #e2e8f0 !important; }
#btn-clear { background: transparent !important; color: #ef4444 !important; min-width: auto !important; padding: 11px 8px !important; font-weight: 600 !important; }
#btn-clear:hover { color: #dc2626 !important; }

/* ---------- Hotel date-range picker ---------- */
#hotel-search-date-calendar {
    width: 650px;
    background-color: #fff;
    box-shadow: 0 2px 16px rgba(26, 26, 26, 0.24);
    margin-top: 6px;
    position: absolute;
    z-index: 1050;
    border-radius: 12px;
    flex-direction: row;
    display: flex;
    padding: 16px;
    gap: 16px;
}
.day-picker-panel { flex: 1; }
.day-picker-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 4px 12px; min-height: 36px;
}
#day-picker-left .day-picker-header  { justify-content: flex-start; gap: 8px; }
#day-picker-right .day-picker-header { justify-content: flex-end; gap: 8px; }
.day-picker-header span { font-weight: 600; font-size: 15px; color: #1a1a1a; user-select: none; }
.day-picker-nav {
    background: none; border: 1px solid #e5e7eb; border-radius: 6px;
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #374151; font-size: 12px;
    transition: background-color 0.15s, border-color 0.15s;
}
.day-picker-nav:hover { background-color: #f3f4f6; border-color: #d1d5db; }
.day-picker-body table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.day-picker-body th {
    padding: 6px 0; font-size: 12px; font-weight: 600; color: #9ca3af;
    text-align: center; text-transform: uppercase;
}
.day-picker-body td { padding: 0; text-align: center; vertical-align: middle; }
.day-picker-body td > span {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; margin: 1px auto; border-radius: 50%;
    font-size: 14px; cursor: pointer; transition: background-color 0.12s, color 0.12s;
}
.day-picker-body td > span:hover { background-color: #e0f7f8; }
.day-picker-body td.dp-inactive > span { color: #d1d5db; cursor: default; }
.day-picker-body td.dp-inactive > span:hover { background-color: transparent; }
.day-picker-body td.dp-today > span { border: 2px solid #22B5BC; }
.day-picker-body td.dp-selected > span { background-color: #22B5BC; color: #fff; font-weight: 600; }
.day-picker-body td.dp-in-range > span { background-color: #d5f2f4; border-radius: 0; width: 100%; margin: 1px 0; }
.day-picker-body td.dp-range-start > span { background-color: #22B5BC; color: #fff; font-weight: 600; border-radius: 50% 0 0 50%; width: 100%; margin: 1px 0; }
.day-picker-body td.dp-range-end > span { background-color: #22B5BC; color: #fff; font-weight: 600; border-radius: 0 50% 50% 0; width: 100%; margin: 1px 0; }
.day-picker-body td.dp-range-start.dp-range-end > span { border-radius: 50%; width: 36px; margin: 1px auto; }
@media (max-width: 768px) {
    #hotel-search-date-calendar { width: 100%; flex-direction: column; gap: 8px; padding: 12px; }
}

/* ---------- Hotel guests dropdown ---------- */
.hotel-guests-dropdown {
    display: none; position: absolute; top: 100%; left: 0; z-index: 1050;
    width: 280px; max-width: calc(100vw - 2rem); background: #fff; border-radius: 12px;
    box-shadow: 0 2px 16px rgba(26, 26, 26, 0.24); padding: 20px; margin-top: 4px;
}
.guest-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid #f3f4f6;
}
.guest-row:last-of-type { border-bottom: none; }
.guest-label { font-size: 14px; font-weight: 600; color: #1a1a1a; }
.guest-age { font-size: 12px; color: #9ca3af; font-weight: 400; margin-top: 1px; }
.guest-counter { display: flex; align-items: center; gap: 12px; }
.guest-counter span { min-width: 20px; text-align: center; font-size: 15px; font-weight: 600; color: #1a1a1a; }
.guest-btn {
    width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid #d1d5db;
    background: #fff; color: #22B5BC; font-size: 16px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, opacity 0.15s; padding: 0; line-height: 1;
}
.guest-btn:hover:not(:disabled) { background-color: #e0f7f8; border-color: #22B5BC; }
.guest-btn:disabled { opacity: 0.3; cursor: default; }
.guest-done { padding-top: 12px; }
.guest-done button {
    width: 100%; padding: 8px; border: 1.5px solid #22B5BC; border-radius: 8px;
    background: #fff; color: #22B5BC; font-weight: 600; font-size: 14px; cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.guest-done button:hover { background-color: #22B5BC; color: #fff; }

/* ---------- Main flight fields: wider From/To airport + roomy date columns ----------
   The From/To airport pickers stay wide (2fr); the extra width from the wider
   search box goes to the date fields, which are bumped to 1.5fr.
     Round-trip          = From · To · Departure · Return  → 2fr 2fr 1.5fr 1.5fr
     One-way / Multi-city (Flight 1) = From · To · Departure → 2fr 2fr 1.5fr
   These ratios match the multi-city segment rows below so the columns line up.
   Driven by the checked trip_type radio so it never depends on the JS
   show/hide side-effects. The round-trip rule also overrides the
   .flight-fields-grid `md:grid-cols-4` utility on the markup. */
@media (min-width: 768px) {
    #flightSearchForm:has(input[name="trip_type"][value="roundtrip"]:checked) .flight-fields-grid {
        grid-template-columns: 2fr 2fr 1.5fr 1.5fr;
    }
    #flightSearchForm:has(input[name="trip_type"][value="oneway"]:checked) .flight-fields-grid,
    #flightSearchForm:has(input[name="trip_type"][value="multicity"]:checked) .flight-fields-grid {
        grid-template-columns: 2fr 2fr 1.5fr;
    }
}
/* One-way: the JS only sets visibility:hidden on Return (keeps its column), so
   force it out of the grid to let From/To/Departure fill as equal thirds. */
#flightSearchForm:has(input[name="trip_type"][value="oneway"]:checked) .return-date-container {
    display: none !important;
}

/* ---------- Multi-city segments (JS-generated Bootstrap-grid markup) ----------
   The markup uses a fixed Bootstrap grid (col-md-5 > [col-md-6 x2], col-md-3,
   col-md-4). We override it with CSS grid so the fields get natural widths that
   match the main search form, instead of the cramped Bootstrap columns. */
.multicity-segment {
    border: 1px solid #e5e7eb; border-radius: 14px; padding: 18px 20px; margin-bottom: 14px;
    background: #fff;
}
.multicity-segment-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.multicity-segment-header .segment-number { font-weight: 700; color: #1f2937; font-size: .95rem; }
.multicity-segment .remove-segment {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid #fecaca;
    background: #fef2f2; color: #ef4444; cursor: pointer; transition: background 0.15s;
}
.multicity-segment .remove-segment:hover { background: #fee2e2; }

/* outer row → [From|To group] [Departure]; hide the empty trailing column.
   4fr (= 2fr + 2fr) : 1.5fr keeps the From/To pair and Departure aligned
   with the main search form's airport + roomy date columns above. */
.multicity-segment > .row {
    display: grid; grid-template-columns: 4fr 1.5fr; gap: 16px; align-items: end; margin: 0;
}
.multicity-segment > .row > .col-md-4 { display: none; }
/* From / To pair (relative so the swap button can sit on the divider) */
.multicity-segment .col-md-5 > .row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; position: relative;
}
/* Swap From / To button — centred on the gap between the two selects, aligned
   with the inputs (below the labels). Mirrors the main search form's swap. */
.multicity-segment .mc-swap-btn {
    position: absolute; left: 50%; top: 30px; transform: translateX(-50%);
    z-index: 10; display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid #e5e7eb; background: #fff; color: #22B5BC;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); cursor: pointer; font-size: 12px;
    transition: background .15s, color .15s, border-color .15s;
}
.multicity-segment .mc-swap-btn:hover {
    background: #22B5BC; border-color: #22B5BC; color: #fff;
}
.multicity-segment [class*="col-"] { padding: 0; min-width: 0; max-width: none; flex: none; }
.multicity-segment .newpadding { padding: 0; }
.multicity-segment .form-group { margin: 0; }
.multicity-segment .form-group label {
    display: block; margin-bottom: 0.45rem; font-size: 0.8rem; font-weight: 500; color: #374151;
    white-space: nowrap;
}
.multicity-segment .form-control {
    width: 100%; height: 52px; border: 1.5px solid #e5e7eb; border-radius: 12px;
    padding: 0 0.9rem; background: #f9fafb; color: #1f2937; font-size: 0.9375rem;
}
.multicity-segment .form-control:focus {
    outline: none; border-color: #22B5BC; background: #fff;
    box-shadow: 0 0 0 4px rgba(34, 181, 188, 0.12);
}

/* ============================================================
   Homepage search box — "Spacious Cards" redesign (homepage only).
   Container/tabs/hero/chips use .ctb-* classes so the compact
   modify-search bar on the results page (no search-widgets.css) is
   untouched. Field IDs + .flight-fields-grid :has rules stay intact.
   ============================================================ */
.ctb-sb { width: 100%; max-width: 82rem; margin: 0 auto; }

/* Flights / Hotels tabs */
.ctb-sb-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ctb-sb-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px; border-radius: 12px; border: none;
    background: #fff; color: #6b7280; font-size: 14px; font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08); cursor: pointer;
    transition: color .15s, background .15s, box-shadow .15s;
}
.ctb-sb-tab:hover { color: #22B5BC; }
.ctb-sb-tab--active { background: #22B5BC; color: #fff; box-shadow: 0 8px 18px rgba(34, 181, 188, .30); }
.ctb-sb-tab--active:hover { color: #fff; }

/* The card — soft white→teal tint + decorative corner glows (breaks the flat
   white) without touching the field layout. */
.ctb-sb-card {
    position: relative;
    overflow: visible;
    border-radius: 22px;
    padding: 26px 30px;
    border: 1px solid rgba(34, 181, 188, .10);
    background: linear-gradient(135deg, #ffffff 0%, #f5fbfb 52%, #eaf7f8 100%);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .10), 0 2px 8px rgba(15, 23, 42, .05);
}
/* Decorative soft glows in opposite corners */
.ctb-sb-card::before {
    content: ""; position: absolute; top: 0; right: 0;
    width: 220px; height: 220px; border-radius: 0 22px 0 100%; z-index: 0; pointer-events: none;
    background: radial-gradient(circle, rgba(34, 181, 188, .14), rgba(34, 181, 188, 0) 70%);
}
.ctb-sb-card::after {
    content: ""; position: absolute; bottom: 0; left: 0;
    width: 240px; height: 240px; border-radius: 0 100% 0 22px; z-index: 0; pointer-events: none;
    background: radial-gradient(circle, rgba(34, 181, 188, .10), rgba(34, 181, 188, 0) 70%);
}
/* Keep all real content above the decorative glows */
.ctb-sb-card > * { position: relative; z-index: 1; }
.ctb-sb-card > [role="tabpanel"] { z-index: 2; }

/* Trust badges strip (bottom of the card) */
.ctb-trust {
    display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px;
    padding-top: 16px; border-top: 1px solid rgba(15, 23, 42, .07);
}
.ctb-trust__item {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: #64748b;
}
.ctb-trust__item i { color: #22B5BC; font-size: 16px; }

/* Hero heading */
.ctb-hero { margin-bottom: 6px; }
.ctb-hero__kicker {
    display: inline-block; margin-bottom: 6px; font-size: 12px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: #22B5BC;
}
.ctb-hero__title { margin: 0 0 14px; font-size: 26px; line-height: 1.2; font-weight: 800; color: #0f172a; }

/* Popular-destination chips */
.ctb-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ctb-chips__label {
    margin-right: 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: #9ca3af;
}
.ctb-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
    border: 1px solid #e5e7eb; border-radius: 999px; background: #fff; color: #374151;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.ctb-chip i { color: #22B5BC; font-size: 14px; }
.ctb-chip:hover { border-color: #22B5BC; background: #E7F7F8; color: #157A80; }

/* ---------- Crisp, unified form controls inside the homepage card ----------
   The default widgets use a muted gray fill that looks washed-out on the tinted
   card. Force them all to a clean white field with a clear border + teal focus
   so From / To / Departure / Return / Travellers read as one consistent set. */

/* Date inputs (Departure / Return) */
.ctb-sb-card .field,
.ctb-sb-card input.datepicker,
.ctb-sb-card input.datepicker2 {
    height: 52px !important;
    background: #fff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
    transition: border-color .15s, box-shadow .15s !important;
}
.ctb-sb-card .field:hover,
.ctb-sb-card input.datepicker:hover,
.ctb-sb-card input.datepicker2:hover { border-color: #cbd5e1 !important; }
.ctb-sb-card .field:focus,
.ctb-sb-card input.datepicker:focus,
.ctb-sb-card input.datepicker2:focus {
    border-color: #22B5BC !important;
    box-shadow: 0 0 0 4px rgba(34, 181, 188, .14) !important;
    outline: none !important;
}

/* select2 airport pickers (From / To) → match the white crisp look */
.ctb-sb-card .select2-container--default .select2-selection--single {
    background: #fff !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
}
.ctb-sb-card .select2-container--default .select2-selection--single:hover { border-color: #cbd5e1 !important; }

/* Travellers & Class trigger → align with the fields */
.ctb-sb-card .tv-trigger {
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
}

/* Labels — a touch clearer */
.ctb-sb-card .field-label { font-weight: 600 !important; color: #334155 !important; }

/* Trip-type segmented control → crisp white container + bolder active pill */
.ctb-sb-card #trip-type-container {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05) !important;
}
.ctb-sb-card #trip-type-container input:checked + span {
    box-shadow: 0 6px 14px rgba(34, 181, 188, .32) !important;
}

/* Search button — crisp teal gradient CTA */
.ctb-sb-card .search-btn {
    border-radius: 12px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #22B5BC 0%, #1A9AA0 100%) !important;
    box-shadow: 0 10px 22px rgba(34, 181, 188, .30) !important;
    transition: filter .15s, box-shadow .15s !important;
}
.ctb-sb-card .search-btn:hover {
    filter: brightness(1.05) !important;
    box-shadow: 0 12px 26px rgba(34, 181, 188, .38) !important;
}

@media (max-width: 640px) {
    .ctb-sb-card { padding: 20px 18px; border-radius: 18px; }
    .ctb-hero__title { font-size: 21px; }
}
