/* Skybridge Flight Planner Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --warning-color: #eab308;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-modal {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-modal h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-modal .subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#login-form input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

#login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-color);
}

/* App Layout */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.location-settings {
    display: flex;
    gap: 0.5rem;
}

.location-settings select {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8rem;
    background: var(--card-bg);
    cursor: pointer;
}

#user-status {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Sections */
section {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.section-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Natural Language Search */
.nl-search {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.nl-search textarea {
    flex: 1;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.nl-search textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Single-line search row */
.search-inline-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.search-inline-row .si-origin,
.search-inline-row .si-dest {
    flex: 1;
    min-width: 120px;
}
.search-inline-row .si-date {
    width: 130px;
    padding: 0.35rem 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.82rem;
}
.search-inline-row .si-select {
    width: auto;
    padding: 0.35rem 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.78rem;
    background: white;
}
.search-inline-row .si-num {
    width: 52px;
    padding: 0.35rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.82rem;
    text-align: center;
}
.search-inline-row .si-search {
    padding: 0.35rem 0.8rem;
    white-space: nowrap;
}
.mc-options-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}
.mc-options-row .si-select,
.mc-options-row .si-num {
    padding: 0.35rem 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.78rem;
}
.mc-options-row .si-num { width: 52px; text-align: center; }

/* Custom Datepicker */
.dp-wrapper { position: relative; display: inline-block; }
.dp-display {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 5px;
    font-size: 0.82rem;
    background: white;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-muted, #94a3b8);
    min-width: 110px;
    text-align: left;
}
.dp-display.dp-has-value { color: var(--text-color, #1e293b); font-weight: 500; }
.dp-display:hover { border-color: var(--primary-color, #2563eb); }
.dp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: white;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 8px;
    width: 260px;
    margin-top: 4px;
}
.dp-dropdown.hidden { display: none; }
.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.dp-month-label { font-weight: 600; font-size: 0.85rem; }
.dp-nav {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-color);
}
.dp-nav:hover { background: var(--bg-color, #f1f5f9); }
.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    text-align: center;
}
.dp-dow {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    padding: 2px 0;
}
.dp-empty { padding: 4px; }
.dp-day {
    position: relative;
    padding: 4px 2px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1.4;
}
.dp-day:hover { background: var(--bg-color, #f1f5f9); }
.dp-today { font-weight: 700; color: var(--primary-color, #2563eb); }
.dp-selected { background: var(--primary-color, #2563eb) !important; color: white !important; }
.dp-selected .dp-holiday-dot { background: white; }
.dp-weekend { color: var(--text-muted, #94a3b8); }
.dp-holiday { background: #fef3c7; }
.dp-holiday:hover { background: #fde68a; }
.dp-holiday-dot {
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #f59e0b;
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-row-compact {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    color: var(--text-secondary, #64748b);
}

.form-group input,
.form-group select {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.85rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Must-Have Section */
.must-have-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.must-have-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

#must-have-list {
    margin-bottom: 1rem;
}

.must-have-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.must-have-item button {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1.25rem;
}

/* Results Section - Kayak Layout */
.results-section {
    border: none;
    padding: 0;
}

.results-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

/* ===== Filter Sidebar ===== */
.filters-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 1rem;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    font-size: 0.85rem;
}

.sidebar-section {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.sidebar-section:last-child { border-bottom: none; margin-bottom: 0; }

.sidebar-section h3 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
}

.sidebar-section h4 {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-cb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    cursor: pointer;
    font-size: 0.85rem;
}

.filter-cb input { margin: 0; }

.filter-cb span:first-of-type { flex: 1; }

.filter-scroll {
    max-height: 160px;
    overflow-y: auto;
}

.filter-count-badge {
    color: var(--text-muted, #94a3b8);
    font-size: 0.75rem;
}

.filter-count {
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
}

.range-slider {
    position: relative;
    height: 24px;
}

.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    top: 0;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: all;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.range-slider input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--border-color, #e2e8f0);
    border-radius: 2px;
}

.full-slider {
    width: 100%;
    accent-color: var(--primary-color, #2563eb);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin-top: 0.25rem;
}

/* ===== Sort Bar ===== */
.sort-bar {
    margin-bottom: 0.75rem;
}

.sort-toggles {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.sort-toggle {
    flex: 1;
    padding: 0.6rem 1rem;
    background: var(--card-bg, #fff);
    border: none;
    border-right: 1px solid var(--border-color, #e2e8f0);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.sort-toggle:last-child { border-right: none; }

.sort-toggle.active {
    background: var(--primary-color, #2563eb);
    color: white;
}

.sort-toggle .sort-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.sort-toggle .sort-hint {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

.sort-toggle.active .sort-hint { opacity: 0.9; }

/* ===== AR Tax Banner ===== */
.ar-tax-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #92400e;
    margin-bottom: 0.75rem;
}

.ar-tax-banner.hidden { display: none; }

/* ===== Results Main ===== */
.results-main {
    flex: 1;
    min-width: 0;
}

#results-container {
    min-height: 100px;
}

.results-count {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.5rem;
}
.load-more {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    text-align: center;
}

.flight-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.flight-info {
    flex: 1;
}

.flight-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--success-color);
}

.flight-source {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-color);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Trips List */
.trips-list {
    min-height: 100px;
}

.trip-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.trip-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.trip-status.planned {
    background: #dbeafe;
    color: #1d4ed8;
}

.trip-status.searched {
    background: #fef3c7;
    color: #b45309;
}

.trip-status.booked {
    background: #dcfce7;
    color: #16a34a;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Parsed Itinerary Display */
.parsed-summary {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.constraints {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.constraint-tag {
    background: #f1f5f9;
    color: var(--secondary-color);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.flight-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.parsed-flight {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.parsed-flight.skipped {
    opacity: 0.6;
    background: #f8fafc;
}

.flight-route {
    font-size: 1.1rem;
    min-width: 140px;
}

.flight-date {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.skip-badge {
    background: #dcfce7;
    color: #16a34a;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.flight-notes {
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.btn-search {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-left: auto;
    transition: background 0.2s;
}

.btn-search:hover {
    background: var(--primary-hover);
}

/* Cycle Trips */
.cycle-trips {
    margin-top: 1rem;
}

.cycle-year {
    margin-bottom: 1rem;
}

.cycle-year h4 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cycle-trip {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #fafafa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.cycle-date {
    font-weight: 500;
    min-width: 160px;
}

.cycle-route {
    color: var(--text-muted);
    flex: 1;
}

.btn-search-small {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-search-small:hover {
    background: var(--primary-color);
    color: white;
}

/* Search All Section */
.search-all-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Search Results */
.search-result-group {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.search-result-group:last-child {
    border-bottom: none;
}

.search-result-group h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.flight-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* (Old flight-option styles removed - using flight-card now) */

.more-results {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Loading State */
.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.loading::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Enhanced Flight Card */
.flight-card-detailed {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.flight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.flight-card-header:hover {
    background: #f5f5f5;
}

.flight-pricing {
    text-align: right;
}

.price-primary {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--success-color);
}

.price-secondary {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.flight-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flight-times {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flight-time {
    font-size: 1.1rem;
    font-weight: 500;
}

.flight-arrow {
    color: var(--text-muted);
}

.flight-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.flight-card-body {
    display: none;
    padding: 1.25rem;
}

.flight-card-detailed.expanded .flight-card-body {
    display: block;
}

/* Fare and baggage info */
.fare-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.fare-type {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.baggage-detail {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.baggage-info {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    background: #e8f4fd;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #1565c0;
}

.segment-list {
    margin-bottom: 1.5rem;
}

.segment-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: #fafafa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.segment-number {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.segment-details {
    flex: 1;
}

.segment-flight {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.segment-route {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.segment-aircraft {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.booking-options {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.booking-options h4 {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.booking-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.booking-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.booking-link:hover {
    background: var(--primary-hover);
}

.booking-link.despegar {
    background: #ff6600;
}

.booking-link.despegar:hover {
    background: #e55b00;
}

.booking-link.airline {
    background: #1a365d;
}

.booking-link.airline:hover {
    background: #132a4f;
}

.booking-tips {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}

.booking-tips strong {
    color: #b45309;
}

.expand-icon {
    transition: transform 0.2s;
    color: var(--text-muted);
}

.flight-card-detailed.expanded .expand-icon {
    transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .nl-search {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .parsed-flight {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-search {
        margin-left: 0;
        width: 100%;
    }

    .cycle-trip {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .flight-option {
        flex-wrap: wrap;
    }
}

/* Microsoft OAuth Button Styles */
.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-oauth:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    box-shadow: var(--shadow);
}

.btn-microsoft {
    margin-bottom: 1rem;
}

.btn-microsoft .ms-icon {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
}

.login-note {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 1rem;
}

/* ===== Kayak-Style Flight Cards ===== */
.flight-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.flight-card:hover {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.flight-card.expanded {
    border-color: var(--primary-color, #2563eb);
}

.card-main {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 1rem;
}

.card-legs {
    flex: 1;
    min-width: 0;
}

/* Leg Row - horizontal: airline | dep time | route bar | arr time */
.leg-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.leg-row + .leg-row {
    border-top: 1px dashed var(--border-color, #e2e8f0);
    margin-top: 0.35rem;
    padding-top: 0.5rem;
}

.leg-airline {
    width: 60px;
    flex-shrink: 0;
    text-align: center;
}

.airline-code {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-color, #1e293b);
}

.airline-name-small {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leg-times {
    text-align: center;
    width: 50px;
    flex-shrink: 0;
}

.dep-time, .arr-time {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color, #1e293b);
}

.dep-airport, .arr-airport {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
}

/* Holiday hints */
.holiday-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem 0;
}

.holiday-hint {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #92400e;
    white-space: nowrap;
}

.dep-date-small {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted, #94a3b8);
}

/* Route Bar - visual timeline */
.leg-route-bar {
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.route-duration {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 4px;
}

.route-line {
    position: relative;
    height: 12px;
    display: flex;
    align-items: center;
    margin: 0 8px;
}

.route-line-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color, #cbd5e1);
    transform: translateY(-50%);
}

.route-line-track::before,
.route-line-track::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted, #64748b);
    transform: translateY(-50%);
}

.route-line-track::before { left: -3px; }
.route-line-track::after { right: -3px; }

.route-line-dots {
    position: absolute;
    top: 50%;
    left: 20%;
    right: 20%;
    display: flex;
    justify-content: space-evenly;
    transform: translateY(-50%);
    z-index: 1;
}

.stop-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    border: 2px solid var(--card-bg, #fff);
}

.route-stops {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

.route-stops-text {
    font-size: 0.65rem;
    color: var(--text-muted, #94a3b8);
}

/* Price Column */
.card-price {
    text-align: right;
    min-width: 120px;
    flex-shrink: 0;
    border-left: 1px solid var(--border-color, #e2e8f0);
    padding-left: 1rem;
}

.card-price-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color, #1e293b);
}

.card-price-usd {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.ar-tax-price {
    font-size: 0.7rem;
    color: #b45309;
    margin-top: 2px;
}

.card-baggage {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

.card-bookable {
    display: inline-block;
    font-size: 0.65rem;
    color: var(--success-color, #16a34a);
    font-weight: 600;
    margin-top: 4px;
}

/* ===== Expanded Detail ===== */
.card-detail {
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding: 1rem;
}

.card-detail.hidden { display: none; }

.flight-detail { }

.detail-leg {
    margin-bottom: 1rem;
}

.detail-leg-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary-color, #2563eb);
    margin-bottom: 0.5rem;
}

/* Vertical Timeline */
.detail-timeline {
    padding-left: 1rem;
}

.timeline-segment {
    margin-bottom: 0.25rem;
}

.timeline-node {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    flex-shrink: 0;
}

.timeline-info {
    font-size: 0.85rem;
}

.tl-time {
    font-weight: 700;
    margin-right: 0.5rem;
}

.tl-airport {
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

.timeline-bar {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.25rem 0 0.25rem 4px;
    margin-left: 4px;
}

.timeline-line {
    width: 2px;
    background: var(--border-color, #cbd5e1);
    flex-shrink: 0;
}

.timeline-flight-info {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    padding: 0.25rem 0;
}

.tl-flight {
    font-weight: 600;
    color: var(--text-color, #1e293b);
    margin-right: 0.75rem;
}

.tl-duration {
    margin-right: 0.75rem;
}

.tl-aircraft {
    font-style: italic;
    font-size: 0.75rem;
}

.timeline-layover {
    padding: 0.4rem 0.5rem 0.4rem 1.5rem;
    background: #fef3c7;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #92400e;
    margin: 0.25rem 0 0.25rem 0;
}

.layover-icon { margin-right: 0.25rem; }

.detail-baggage {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    border-top: 1px dashed var(--border-color, #e2e8f0);
    margin-top: 0.5rem;
}

.bag-icon { margin-right: 0.25rem; }

.detail-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.btn-book-ext {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    background: var(--card-bg, #f1f5f9);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color, #1e293b);
    transition: all 0.2s;
}

.btn-book-ext:hover {
    border-color: var(--primary-color, #2563eb);
    color: var(--primary-color, #2563eb);
}

.detail-booking-links {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* Keep old price-block for grouped/multicity results */
.price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.price-block .airlines {
    font-size: 0.85em;
    color: var(--text-muted, #888);
    font-weight: 600;
    margin-bottom: 2px;
}

.price-block .price {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--success-color, #16a34a);
}

.price-usd {
    font-size: 0.7em;
    color: var(--text-muted, #888);
    font-weight: normal;
}

.btn-book-small {
    padding: 6px 12px;
    font-size: 0.8em;
    background: var(--primary-color, #2563eb);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-book-small:hover {
    background: #1d4ed8;
}

/* Search Tabs */
.search-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border, #333);
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-muted, #888);
    font-size: 1em;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text, #fff);
}

.tab-btn.active {
    color: var(--primary, #6366f1);
    border-bottom-color: var(--primary, #6366f1);
    font-weight: 600;
}

.tab-panel {
    padding: 10px 0;
}

.tab-panel.hidden {
    display: none;
}

/* Segment airline name */
.seg-airline-name {
    font-size: 0.85em;
    color: var(--text-muted, #64748b);
    margin-left: 8px;
}

/* (Old results controls removed - now using sidebar filters) */

/* Booking Modal */
.booking-modal {
    max-width: 500px;
}

.booking-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-color, #f8fafc);
    border-radius: 8px;
    margin-bottom: 24px;
}

.booking-total {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-color, #2563eb);
}

#booking-form h4 {
    margin-bottom: 16px;
    color: var(--text-color, #1e293b);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9em;
    color: var(--text-muted, #64748b);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    font-size: 1em;
}

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

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 1.1em;
}

.error-message {
    color: #dc2626;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 6px;
    background: #fef2f2;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* Book Now button */
.btn-book-direct {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
}

.btn-book-direct:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Booking success */
.booking-success {
    text-align: center;
    padding: 24px;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
}

.booking-success h3 {
    color: #10b981;
    margin-bottom: 16px;
}

.booking-success p {
    margin-bottom: 8px;
    color: var(--text-muted, #64748b);
}

.booking-success strong {
    font-size: 1.2em;
    color: var(--text-color, #1e293b);
}

/* Modal styles if not present */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg, white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted, #64748b);
}

.modal-close:hover {
    color: var(--text-color, #1e293b);
}

.modal-body {
    padding: 20px;
}

/* Price breakdown */
.price-breakdown {
    background: var(--bg-color, #f8fafc);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.price-breakdown h4 {
    margin: 0 0 12px 0;
    color: var(--text-color, #1e293b);
}

.price-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.price-line.price-total {
    border-bottom: none;
    border-top: 2px solid var(--border-color, #e2e8f0);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 1.2em;
    color: var(--primary-color, #2563eb);
}

/* Stripe Elements */
.stripe-element {
    padding: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    background: white;
}

#card-errors {
    color: #dc2626;
    margin-top: 8px;
    font-size: 0.9em;
}

/* Saved cards */
.saved-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-card:hover {
    border-color: var(--primary-color, #2563eb);
}

.saved-card.selected {
    border-color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.05);
}

.card-brand {
    font-weight: 600;
    text-transform: capitalize;
}

.card-last4 {
    font-family: monospace;
}

.card-exp {
    color: var(--text-muted, #64748b);
    font-size: 0.9em;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color, #2563eb);
    cursor: pointer;
    padding: 8px 0;
    font-size: 0.95em;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Payment actions */
.payment-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.payment-actions .btn {
    flex: 1;
}

.btn-secondary {
    background: var(--bg-color, #f1f5f9);
    color: var(--text-color, #1e293b);
    border: 1px solid var(--border-color, #e2e8f0);
}

.btn-secondary:hover {
    background: var(--border-color, #e2e8f0);
}

#payment-error {
    margin-top: 16px;
}

/* Trip Type Selector */
.trip-type-selector {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 5px;
    overflow: hidden;
    width: fit-content;
}

.trip-type-btn {
    padding: 4px 14px;
    border: none;
    background: var(--card-bg, white);
    color: var(--text-muted, #64748b);
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s;
    border-right: 1px solid var(--border-color, #e2e8f0);
}

.trip-type-btn:last-child {
    border-right: none;
}

.trip-type-btn.active {
    background: var(--primary-color, #2563eb);
    color: white;
    font-weight: 600;
}

.trip-type-btn:not(.active):hover {
    background: var(--bg-color, #f8fafc);
}

/* Multi-City Legs */
.multicity-leg {
    position: relative;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 12px;
}

.multicity-leg:last-child {
    border-bottom: none;
}

.leg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9em;
    color: var(--text-muted, #64748b);
}

.leg-remove {
    background: none;
    border: none;
    color: var(--error-color, #ef4444);
    cursor: pointer;
    font-size: 1.2em;
    padding: 2px 6px;
    border-radius: 4px;
}

.leg-remove:hover {
    background: #fef2f2;
}

.leg-fields {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.leg-fields .form-group {
    flex: 1;
    min-width: 0;
}

.leg-fields .form-group.leg-date-group {
    flex: 0 0 160px;
}

#add-leg-btn {
    margin-top: 8px;
    font-size: 0.9em;
    padding: 8px 16px;
}

.multicity-leg-results {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
}

.multicity-leg-results:last-child {
    border-bottom: none;
}

.multicity-leg-results h3 {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: var(--primary-color, #2563eb);
}

/* Airport Type-Ahead */
.airport-input-group {
    position: relative;
}

.airport-chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    background: white;
    min-height: 32px;
    cursor: text;
}

.airport-chips-wrapper:focus-within {
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.airport-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.airport-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--primary-color, #2563eb);
    color: white;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.chip-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1em;
    padding: 0 2px;
    opacity: 0.7;
    line-height: 1;
}

.chip-remove:hover {
    opacity: 1;
}

.airport-chips-wrapper .airport-input {
    border: none;
    outline: none;
    padding: 2px;
    flex: 1;
    min-width: 80px;
    font-size: 0.85em;
    background: transparent;
    box-shadow: none;
}

.airport-chips-wrapper .airport-input:focus {
    box-shadow: none;
}

.airport-input {
    width: 100%;
}

.airport-input.has-value {
    font-weight: 600;
}

.airport-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e2e8f0);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}

.airport-dropdown.hidden {
    display: none;
}

.airport-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    font-size: 0.9em;
}

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

.airport-dropdown-item:hover,
.airport-dropdown-item.active {
    background: var(--bg-color, #f8fafc);
}

.airport-dropdown-item .airport-iata {
    font-weight: 700;
    color: var(--primary-color, #2563eb);
    min-width: 36px;
}

.airport-dropdown-item .airport-detail {
    flex: 1;
    margin-left: 8px;
    color: var(--text-color, #1e293b);
}

.airport-dropdown-item .airport-country {
    font-size: 0.8em;
    color: var(--text-muted, #64748b);
    margin-left: 8px;
}

/* Airport row: From [swap] To on one line */
.airport-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 0.4rem;
}

.airport-row .form-group {
    flex: 1;
    min-width: 0;
}

/* Swap button */
.swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 50%;
    background: var(--card-bg, white);
    color: var(--primary-color, #2563eb);
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.swap-btn:hover {
    background: var(--primary-color, #2563eb);
    color: white;
    border-color: var(--primary-color, #2563eb);
}

.airport-dropdown-header {
    padding: 6px 12px;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-color, #f8fafc);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

/* Route Cards (grouped multi-airport results) */
.route-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.route-card-header {
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.route-card-header .route-count {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.85;
}

.route-card-body {
    padding: 1rem;
}

/* ==================== Calendar Prices ==================== */

.calendar-controls {
    margin-bottom: 1.5rem;
}

.calendar-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.calendar-month-nav button {
    padding: 0.4rem 0.8rem;
    font-size: 1rem;
}

.price-calendar {
    margin-bottom: 1rem;
}

.cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.cal-day-name {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    padding: 4px;
    min-height: 60px;
}

.cal-cell:hover:not(.empty) {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.cal-cell.empty {
    border: none;
    cursor: default;
}

.cal-day-num {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.cal-price {
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 2px;
}

.cal-no-data {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cal-cheap {
    background: #dcfce7;
}
.cal-cheap .cal-price {
    color: #16a34a;
}

.cal-mid {
    background: #fef9c3;
}
.cal-mid .cal-price {
    color: #a16207;
}

.cal-expensive {
    background: #fee2e2;
}
.cal-expensive .cal-price {
    color: #dc2626;
}

.calendar-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

.legend-dot.cal-cheap { background: #dcfce7; border: 1px solid #16a34a; }
.legend-dot.cal-mid { background: #fef9c3; border: 1px solid #a16207; }
.legend-dot.cal-expensive { background: #fee2e2; border: 1px solid #dc2626; }

/* ==================== Route Insights ==================== */

.insights-panel {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.insights-title {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
}

.insights-panel.collapsed .insights-body {
    display: none;
}

.insights-body {
    padding: 0 1rem 1rem;
}

.insight-tips {
    margin-bottom: 1rem;
}

.insight-tip {
    padding: 0.4rem 0.75rem;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    border-left: 3px solid var(--primary-color);
}

.insight-chart {
    margin-bottom: 1rem;
}

.insight-chart h4 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.insight-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.insight-bar-label {
    width: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: right;
}

.insight-bar-track {
    flex: 1;
    height: 16px;
    background: white;
    border-radius: 3px;
    overflow: hidden;
}

.insight-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    min-width: 4px;
    transition: width 0.3s;
}

.insight-bar-value {
    font-size: 0.8rem;
    font-weight: 600;
    width: 50px;
}

.insight-airlines {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.insight-airlines h4 {
    width: 100%;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--text-muted);
}

.airline-badge {
    padding: 0.3rem 0.6rem;
    background: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ==================== Exchange Rate ==================== */

.exchange-rate {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

/* ==================== Saved Trips Collapsible ==================== */

.trips-section.collapsed .trips-list {
    display: none;
}

.trips-section.collapsed .expand-icon {
    display: inline;
}

.trips-section:not(.collapsed) .expand-icon::after {
    content: '▼';
}

.trips-section.collapsed .expand-icon::after {
    content: '▶';
}

.trips-section .expand-icon {
    font-size: 0.7em;
    margin-left: 0.3rem;
}

.trips-section h2 {
    font-size: 1rem;
    margin: 0.5rem 0;
}

/* (Old airline checkboxes removed - now in sidebar) */

/* ==================== Multi-City Cards ==================== */

.mc-card .card-legs {
    border-right: 1px solid var(--border-color, #e2e8f0);
    padding-right: 0.75rem;
}

.mc-leg-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color, #2563eb);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0 0;
}

.mc-leg-label:first-child { padding-top: 0; }

.card-price-label {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mc-price-breakdown {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}

.mc-leg-price {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
}

/* ==================== Scatter Charts ==================== */

.scatter-charts {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.scatter-charts h4 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.scatter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.scatter-wrap {
    flex: 1;
    min-width: 280px;
}

.scatter-chart {
    background: var(--bg-color, #1a1a2e);
    border-radius: 6px;
    width: 100%;
    height: auto;
}

/* ==================== Deals ==================== */

.deals-section {
    border: 2px solid var(--success-color);
}

.deal-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: #f0fdf4;
}

.deal-route {
    font-weight: 600;
    min-width: 100px;
}

.deal-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.deal-prices {
    flex: 1;
    text-align: right;
}

.deal-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--success-color);
}

.deal-avg {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.deal-discount {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
}

.deal-badge {
    display: inline-block;
    background: #dcfce7;
    color: #16a34a;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ==================== Booking UX (Feature 4) ==================== */

.btn-book-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-book-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-book-more {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-book-more:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.booking-options-expanded {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-color);
    border-radius: 6px;
}

.booking-options-expanded.hidden {
    display: none;
}

@media (max-width: 768px) {
    .cal-cell {
        min-height: 45px;
        padding: 2px;
    }
    .cal-price {
        font-size: 0.7rem;
    }
    .deal-card {
        flex-wrap: wrap;
    }
    .insights-panel .insight-bar-row {
        font-size: 0.75rem;
    }
    .results-layout {
        flex-direction: column;
    }
    .filters-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
    .leg-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .leg-route-bar {
        min-width: 80px;
    }
    .card-main {
        flex-direction: column;
        align-items: stretch;
    }
    .card-price {
        border-left: none;
        border-top: 1px solid var(--border-color, #e2e8f0);
        padding-left: 0;
        padding-top: 0.5rem;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 1rem;
    }
}
