/* ============================================================
   flights-search-form.css
   Unified styles for the reusable flight search form partial.
   Used on: homepage (index.php), results page (Flights.php),
   and any future page that includes FlightSearchForm.php.
   ============================================================ */

/* ── Design Tokens ────────────────────────────────────────── */
.att-home-flight {
    --att-accent: #ff3d2e;
    --att-ink: #09244b;
    --att-muted: #68758d;
    --att-border: #dfe6f2;
    background: #fff;
    border: 1px solid #edf1f7;
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(9, 36, 75, 0.13);
    padding: 18px;
}

/* ── Controls Bar (Trip Type + Class) ─────────────────────── */
.att-flight-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.att-trip-toggle {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.att-trip-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--att-ink);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.att-trip-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--att-accent);
    margin: 0;
}

.att-trip-option input:checked + span {
    color: var(--att-accent);
}

.att-class-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--att-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.att-class-control select {
    min-width: 180px;
    height: 38px;
    border: 1px solid var(--att-border);
    border-radius: 8px;
    color: var(--att-ink);
    font-weight: 700;
    background: #fff;
    padding: 0 12px;
}

/* ── Flight Row Grid (Default – Round Trip) ───────────────── */
.att-flight-row {
    display: grid;
    grid-template-columns: minmax(210px, 1.35fr) 44px minmax(210px, 1.35fr) minmax(145px, .9fr) minmax(145px, .9fr) minmax(190px, 1fr) 70px;
    align-items: stretch;
    gap: 8px;
}

.att-home-flight.att-oneway .att-flight-row {
    grid-template-columns: minmax(230px, 1.4fr) 44px minmax(230px, 1.4fr) minmax(160px, .9fr) minmax(205px, 1fr) 70px;
}

/* ── Field Shared Base ────────────────────────────────────── */
.att-flight-field {
    position: relative;
    min-width: 0;
    min-height: 64px;
    border: 1px solid var(--att-border);
    border-radius: 10px;
    background: #fff;
    color: var(--att-ink);
    font-family: inherit;
    padding: 10px 12px 8px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.att-flight-field:hover,
.att-flight-field:focus-within,
.att-traveller-field[aria-expanded="true"] {
    border-color: var(--att-accent);
    box-shadow: 0 8px 20px rgba(255, 61, 46, 0.12);
    background: #fffdfc;
}

.att-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--att-ink);
    font-size: 17px;
    line-height: 1;
}

.att-field-label {
    color: var(--att-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1;
    text-transform: uppercase;
    margin-bottom: 5px;
}

/* ── Date & Traveller Values ──────────────────────────────── */
.att-date-input,
.att-traveller-value {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--att-ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 24px;
    width: 100%;
    padding: 0;
}

.att-date-input {
    cursor: pointer;
}

.att-return-field.is-hidden {
    display: none;
}

/* ── Swap & Search Buttons ────────────────────────────────── */
.att-swap-btn,
.att-search-btn {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.att-swap-btn {
    align-self: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--att-border);
    border-radius: 50%;
    background: #fff;
    color: var(--att-ink);
    box-shadow: 0 6px 16px rgba(9, 36, 75, 0.10);
}

.att-swap-btn:hover {
    transform: rotate(180deg);
    border-color: var(--att-accent);
    color: var(--att-accent);
}

.att-search-btn {
    min-height: 64px;
    border-radius: 10px;
    background: var(--att-accent);
    color: #fff;
    font-size: 21px;
    box-shadow: 0 12px 22px rgba(255, 61, 46, 0.28);
}

.att-search-btn:hover {
    background: #e62f22;
    transform: translateY(-1px);
}

/* ── Multi-City Layout ────────────────────────────────────── */
.att-multicity-container { display: none; flex-direction: column; gap: 8px; }
.att-home-flight.att-multicity .att-multicity-container { display: flex; }
.att-home-flight.att-multicity #default-flight-row { display: none; }

.att-multicity-leg {
    display: grid;
    grid-template-columns: minmax(230px, 1.4fr) 44px minmax(230px, 1.4fr) minmax(160px, .9fr) 44px;
    align-items: stretch;
    gap: 8px;
}

.att-multicity-footer {
    display: none;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(190px, 1fr) 70px;
    align-items: stretch;
    gap: 8px;
    margin-top: 4px;
}

.att-home-flight.att-multicity .att-multicity-footer {
    display: grid;
}

.att-remove-leg-btn {
    align-self: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--att-border);
    border-radius: 50%;
    background: #fff;
    color: var(--att-accent);
    box-shadow: 0 6px 16px rgba(9, 36, 75, 0.10);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.att-remove-leg-btn:hover {
    transform: scale(1.1);
}

.att-add-leg-btn {
    min-height: 64px;
    border-radius: 10px;
    background: #fff;
    border: 1px dashed var(--att-border);
    color: var(--att-ink);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color .18s ease, color .18s ease;
}

.att-add-leg-btn:hover {
    border-color: var(--att-accent);
    color: var(--att-accent);
}

.att-multicity-toggle {
    min-height: 64px;
    border-radius: 10px;
    border: 1px solid var(--att-border);
    background: #fff;
    color: var(--att-ink);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    white-space: nowrap;
}

.att-multicity-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--att-accent);
    margin: 0;
}

/* ── Traveller Dropdown ───────────────────────────────────── */
.att-traveller-wrap {
    position: relative;
    min-width: 0;
}

.att-traveller-field {
    width: 100%;
    height: 100%;
    text-align: left;
    cursor: pointer;
}

.att-traveller-summary {
    color: var(--att-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 1px;
}

.att-traveller-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-width: 88vw;
    background: #fff;
    border: 1px solid var(--att-border);
    border-radius: 12px;
    box-shadow: 0 18px 36px rgba(9, 36, 75, .18);
    padding: 12px;
    z-index: 80;
    display: none;
}

.att-traveller-menu.is-open {
    display: block;
}

.att-pax-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 2px;
    border-bottom: 1px solid #eef2f8;
}

.att-pax-row:last-of-type {
    border-bottom: 0;
}

.att-pax-title {
    color: var(--att-ink);
    font-size: 14px;
    font-weight: 800;
}

.att-pax-note {
    display: block;
    color: var(--att-muted);
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
}

.att-pax-counter {
    display: inline-grid;
    grid-template-columns: 32px 34px 32px;
    align-items: center;
    gap: 6px;
}

.att-pax-counter button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--att-border);
    background: #fff;
    color: var(--att-ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.att-pax-counter button:hover {
    border-color: var(--att-accent);
    color: var(--att-accent);
}

.att-pax-counter output {
    color: var(--att-ink);
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.att-traveller-done {
    width: 100%;
    height: 38px;
    margin-top: 10px;
    border: 0;
    border-radius: 9px;
    background: var(--att-ink);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

/* ── Select2 Overrides ────────────────────────────────────── */
.att-home-flight .select2-container {
    width: 100% !important;
}

.att-home-flight .select2-container--default .select2-selection--single {
    height: 26px;
    border: 0;
    background: transparent;
    outline: 0;
}

.att-home-flight .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--att-ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 26px;
    padding-left: 0;
    padding-right: 18px;
}

.att-home-flight .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #a0a8b7;
}

.att-home-flight .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 26px;
    right: 0;
}

.att-home-airport-dropdown {
    border-color: var(--att-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 16px 34px rgba(9, 36, 75, .16);
    overflow: hidden;
}

.att-home-airport-dropdown .select2-search__field {
    border: 1px solid #dfe6f2 !important;
    border-radius: 8px;
    min-height: 38px;
    padding: 6px 10px !important;
    outline: 0;
}

.att-home-airport-dropdown .select2-results__option {
    padding: 8px 10px;
}

.att-home-airport-dropdown .select2-results__option--highlighted[aria-selected] {
    background: rgba(255, 61, 46, 0.08) !important;
    color: var(--att-ink) !important;
}

/* ── Airport Template (shared by dropdown) ────────────────── */
.att-airport-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    line-height: 1.2;
}

.att-airport-code {
    min-width: 52px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: var(--att-accent);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.att-airport-name {
    color: var(--att-ink);
    font-size: 13px;
    font-weight: 800;
}

.att-airport-sub {
    display: block;
    color: var(--att-muted);
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    max-width: 270px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Responsive – Tablet ──────────────────────────────────── */
@media (max-width: 1180px) {
    .att-flight-row,
    .att-home-flight.att-oneway .att-flight-row,
    .att-multicity-leg,
    .att-multicity-footer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .att-swap-btn {
        width: 100%;
        border-radius: 10px;
    }

    .att-search-btn {
        min-height: 56px;
    }
}

/* ── Responsive – Mobile ──────────────────────────────────── */
@media (max-width: 720px) {
    .search-form-wrapper {
        padding: 18px 14px !important;
    }

    .att-home-flight {
        padding: 14px;
    }

    .att-flight-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .att-class-control {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .att-class-control select {
        width: 100%;
    }

    .att-flight-row,
    .att-home-flight.att-oneway .att-flight-row,
    .att-multicity-leg,
    .att-multicity-footer {
        grid-template-columns: 1fr;
    }

    .att-traveller-menu {
        left: 0;
        right: auto;
        width: 100%;
    }
}

/* ── Results Page Context ─────────────────────────────────── */
.att-search-shell {
    padding: 25px 0 0;
}

@media (min-width: 993px) {
    .att-search-shell {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: rgba(245, 246, 248, 0.85);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 15px 0;
        border-bottom: 1px solid rgba(224, 230, 241, 0.8);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
    }
}


.att-search-shell .att-home-flight {
    box-shadow: 0 10px 28px rgba(9, 36, 75, 0.10);
}

/* ── Mobile Search Summary Bar & Collapse Behavior ────────── */
@media (max-width: 992px) {
    .att-mobile-search-summary-bar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        background: #ffffff;
        padding: 12px 16px;
        border-radius: 12px;
        border: 1px solid var(--att-line, #e5e7eb);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
        cursor: pointer;
        margin-bottom: 12px;
    }
    
    .att-mobile-summary-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
        text-align: left;
    }
    
    .att-mobile-summary-route {
        font-weight: 700;
        font-size: 15px;
        color: var(--att-ink, #212529);
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .att-mobile-summary-route i {
        font-size: 12px;
        color: var(--att-red, #ff3d2e);
    }
    
    .att-mobile-summary-meta {
        font-size: 12px;
        color: var(--att-muted, #6c757d);
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .att-mobile-summary-meta .dot-separator {
        opacity: 0.5;
    }
    
    .att-mobile-edit-btn {
        background: var(--att-red, #ff3d2e);
        color: #ffffff;
        border: none;
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        outline: none;
    }
    
    .att-search-shell.is-collapsed #home-flight-search {
        display: none !important;
    }
    
    .att-search-shell.is-expanded #home-flight-search {
        display: block !important;
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (min-width: 993px) {
    .att-mobile-search-summary-bar {
        display: none !important;
    }
}
