/* ════════════════════════════════════════════════
   FLIGHT SEARCH FORM — search-form.css
   Airline Tickets Services
════════════════════════════════════════════════ */

/* ── Reset & Base ── */
.fsp-search-widget *,
.fsp-search-widget *::before,
.fsp-search-widget *::after {
    box-sizing: border-box;
}

/* ── Loading Bar ── */
.fsp-loading-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 4px;
    z-index: 99999;
    background: rgba(15,118,110,0.15);
    display: none;
}
.fsp-loading-bar.active { display: block; }
.fsp-loading-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #e81e1d, #14b8a6, #e81e1d);
    background-size: 200% 100%;
    animation: fspBarMove 1.4s ease-in-out infinite;
    width: 100%;
}
@keyframes fspBarMove {
    0%   { background-position: 0% 0%; }
    100% { background-position: -200% 0%; }
}

/* ── Loading Overlay ── */
.fsp-loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}
.fsp-loading-overlay.active { display: flex; }
.fsp-loading-plane {
    animation: fspPlaneBob 1.2s ease-in-out infinite;
}
.fsp-loading-plane svg { width: 72px; height: 72px; }
@keyframes fspPlaneBob {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50%       { transform: translateY(-12px) rotate(5deg); }
}
.fsp-loading-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 18px;
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* ── Widget Wrapper ── */
.fsp-search-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 100%;
    position: relative;
}

/* ── Trip Toggle ── */
.fsp-trip-toggle {
    display: inline-flex;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.fsp-trip-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border-radius: 50px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}
.fsp-trip-btn.active {
    background: #000000;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.fsp-trip-btn:hover {background: #e81e1d;}
/* ── Form Bar ── */
.fsp-form-bar {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.09);
    overflow: visible;
    position: relative;
}

/* ── Individual Field ── */
.fsp-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-right: 1px solid #f0f0f0;
    position: relative;
    flex: 1;
    min-width: 0;
}
.fsp-field:last-of-type { border-right: none; }

.fsp-field--from { flex: 2; }
.fsp-field--to   { flex: 2; }
.fsp-field--date { flex: 1.2; min-width: 130px; }
.fsp-field--pax  { flex: 1.5; min-width: 180px; }

.fsp-field-icon {
    color: #e81e1d;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.fsp-field-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* ── Inputs ── */
.fsp-field-wrap input[type="text"],
.fsp-field-wrap input[type="date"],
.fsp-pax-trigger {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    font-weight: 500;
    color: #000000;
    background: transparent;
    padding: 0;
    font-family: inherit;
}

.fsp-field-wrap input::placeholder { color: #9ca3af; font-weight: 400; }

.fsp-date-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 3px;
}

input[type="date"] {
    color-scheme: light;
    cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.5;
}

.fsp-pax-trigger { cursor: pointer; }

/* ── Swap Button ── */
.fsp-swap-btn {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    background: #fff;
    color: #e81e1d;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    z-index: 2;
    margin: auto -4px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0;
}
.fsp-swap-btn:hover {
    background: #f0fdf9;
    border-color: #e81e1d;
    transform: rotate(180deg);
}

/* ── Autocomplete ── */
.fsp-ac-list {
    position: absolute;
    top: calc(100% + 10px);
    left: -16px;
    min-width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
    z-index: 9999;
    display: none;
    overflow: hidden;
}
.fsp-ac-list.open { display: block; }
.fsp-ac-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid #f9fafb;
}
.fsp-ac-item:last-child { border-bottom: none; }
.fsp-ac-item:hover { background: #f0fdf9; }
.fsp-ac-code {
    font-size: 16px;
    font-weight: 700;
    color: #e81e1d;
    min-width: 40px;
}
.fsp-ac-name  { font-size: 13px; color: #000000; font-weight: 500; }
.fsp-ac-sub   { font-size: 11px; color: #9ca3af; }

/* ── Passenger Popover ── */
.fsp-pax-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: -16px;
    width: 320px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.14);
    z-index: 9999;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap:5px;
}
.fsp-pax-popover.open { display: flex; }
.fsp-pax-row { display: flex; justify-content: space-between; align-items: center; }
.fsp-pax-info { display: flex; flex-direction: column; }
.fsp-pax-info strong { font-size: 14px; color: #000000; }
.fsp-pax-info span   { font-size: 11px; color: #9ca3af; margin-top: 1px; }
.fsp-pax-counter { display: flex; align-items: center; gap: 12px; }
.fsp-pax-btn {
    width: 30px; height: 35px;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #374151;
    transition: all 0.15s;
}
.fsp-pax-btn:hover { border-color: #e81e1d; color: #e81e1d; background: #f0fdf9; }
.fsp-pax-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.fsp-pax-num { font-size: 16px; font-weight: 600; color: #000000; min-width: 18px; text-align: center; }
.fsp-pax-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 12px;
}

.fsp-pax-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 15px 0 5px;
}

/* Cabin Class 2×2 grid */
.fsp-cabin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.fsp-cabin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding:10px 5px;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
    line-height: 1.2;
    user-select: none;
}

.fsp-cabin-btn:hover {
    border-color: #e81e1d;
    color: #e81e1d;
    background: #f0fdf9;
}

.fsp-cabin-btn.active {
    border-color: #e81e1d;
    border-width: 2px;
    color: #e81e1d;
    background: #fff;
    font-weight: 600;
}

.fsp-pax-done {
    background: #e02020;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    width: 100%;
    letter-spacing: 0.01em;
}
.fsp-pax-done:hover { background: #c01a1a; }

/* ── Search Button ── */
.fsp-search-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #000000;
    color: #fff;
    border: none;
    border-radius: 0 14px 14px 0;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.fsp-search-btn:hover { background: #e81e1d; }

/* ── Terms ── */
.fsp-terms {
    font-size: 12px;
    color: #a6a6a6;
    margin-top: 10px;
}
.fsp-terms a { color: #a6a6a6; text-decoration: none; }
.fsp-terms a:hover { text-decoration: underline;color:#000000 !important; }

/* ── Return field hidden state ── */
.fsp-field--date.hidden {
    opacity: 0.35;
    pointer-events: none;
}

/* ── Validation error ── */
.fsp-field.error .fsp-field-icon { color: #ef4444; }
.fsp-error-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 99999;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.fsp-error-toast.show { transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .fsp-form-bar {
        flex-wrap: wrap;
        border-radius: 14px;
    }
    .fsp-field { border-right: none; border-bottom: 1px solid #f0f0f0; flex: 1 1 calc(50% - 4px); }
    .fsp-field--from, .fsp-field--to { flex: 1 1 calc(50% - 4px); }
    .fsp-search-btn { border-radius: 0 0 14px 14px; width: 100%; justify-content: center; }
    .fsp-swap-btn { display: none; }
}

@media (max-width: 600px) {
    .fsp-field { flex: 1 1 100%; }
    .fsp-trip-toggle { width: 100%; }
    .fsp-trip-btn { flex: 1; justify-content: center; }
}
