:root {
    /* Professional Corporate Palette */
    --primary-color: #0f172a;
    /* Slate 900 */
    --accent-color: #2563eb;
    /* Blue 600 */
    --bg-color: #f1f5f9;
    /* Slate 100 */
    --panel-bg: #ffffff;
    --text-primary: #1e293b;
    /* Slate 800 */
    --text-secondary: #64748b;
    /* Slate 500 */
    --border-color: #e2e8f0;
    /* Slate 200 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --font-heading: 'Roboto', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   SEARCH CONTAINER
   ======================================== */

.search-container {
    max-width: 900px;
    margin: 0 auto 80px auto;
    background: var(--panel-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

/* ========================================
   FLIGHT SEARCH FORM
   ======================================== */

.flight-search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 140px;
    position: relative;
}

.form-group.location-group {
    flex: 2;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background: white;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

/* ========================================
   TRIP TYPE TOGGLE
   ======================================== */

.trip-type-row {
    justify-content: flex-start;
}

.trip-type-toggle {
    display: inline-flex;
    gap: 0;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 4px;
}

.trip-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 2px);
    transition: all 0.2s;
    font-family: var(--font-body);
}

.trip-btn:hover {
    color: var(--text-primary);
}

.trip-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   LOCATION ROW
   ======================================== */

.location-row {
    align-items: flex-end;
}

.swap-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.swap-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* ========================================
   AUTOCOMPLETE DROPDOWN
   ======================================== */

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.autocomplete-dropdown.visible {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--bg-color);
}

.airport-code {
    font-weight: 700;
    font-size: 16px;
    color: var(--accent-color);
    min-width: 45px;
    font-family: var(--font-heading);
}

.airport-info {
    flex: 1;
}

.airport-city {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.airport-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========================================
   DATES ROW
   ======================================== */

.dates-row .form-group {
    min-width: 180px;
}

.form-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.form-group.disabled input {
    background: var(--bg-color);
}

/* ========================================
   SEARCH BUTTON
   ======================================== */

.submit-row {
    margin-top: 8px;
}

.search-btn {
    width: 100%;
    padding: 16px 32px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.search-btn:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   FLIGHT RESULTS PANEL
   ======================================== */

.flight-results-panel {
    margin-top: 32px;
    margin-bottom: 80px;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.results-header h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 18px;
}

.close-results {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-results:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.flight-results {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
    background: #f8fafc;
}

/* ========================================
   FLIGHT CARD
   ======================================== */

.flight-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    position: relative;
}

.flight-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.flight-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-color);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
    opacity: 0.8;
}

.flight-route {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.flight-route .arrow {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.flight-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.flight-detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
}

.flight-detail-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.flight-price {
    font-family: var(--font-heading);
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 700;
}

.book-button {
    width: 100%;
    padding: 12px;
    background: white;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: var(--font-body);
}

.book-button:hover {
    background: var(--accent-color);
    color: white;
}

/* ========================================
   NO RESULTS / ERROR MESSAGES
   ======================================== */

.no-results,
.error-message {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.no-results-icon,
.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-results h3 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 8px;
}

.no-results p,
.error-message p {
    font-size: 14px;
}

.error-message {
    color: #dc2626;
}

/* ========================================
   HELPERS
   ======================================== */

.hidden {
    display: none !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .search-container {
        padding: 20px;
        border-radius: var(--radius-md);
        margin: 0 10px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .form-group,
    .form-group.location-group {
        min-width: 100%;
    }

    .location-row {
        flex-direction: column;
    }

    .swap-btn {
        align-self: center;
        transform: rotate(90deg);
    }

    .dates-row,
    .travelers-row,
    .options-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .dates-row .form-group,
    .travelers-row .form-group,
    .options-row .form-group {
        flex: 1;
        min-width: calc(50% - 8px);
    }

    .flight-details {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .flight-results {
        padding: 16px;
    }

    .flight-card {
        padding: 16px;
    }

    .trip-type-toggle {
        width: 100%;
    }

    .trip-btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .dates-row .form-group,
    .travelers-row .form-group,
    .options-row .form-group {
        min-width: 100%;
    }

    .flight-details {
        grid-template-columns: 1fr;
    }

    .search-container {
        padding: 16px;
    }
}
