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

:root {
    --sky-blue: #87CEEB;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --medium-gray: #CCCCCC;
    --dark-gray: #666666;
    --text-dark: #333333;
    --accent-orange: #FF6347;
    --error-red: #CC2200;
    /* Accessible error color - 4.52:1 contrast */
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);

    /* Contact Form Variables */
    --primary-color: #3B82F6;
    --primary-dark: #2563EB;
    --card-background: #FFFFFF;
    --border-color: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --hover-background: #F3F4F6;
    --secondary-background: #F9FAFB;
    --input-background: #FFFFFF;

    /* Accessibility Colors */
    --focus-color: #2563eb;
}

/* Dark Mode Color Palette */
[data-theme="dark"] {
    --sky-blue: #4A9FD8;
    --white: #1E1E1E;
    --light-gray: #2A2A2A;
    --medium-gray: #404040;
    --dark-gray: #C0C0C0;
    --text-dark: #E0E0E0;
    --accent-orange: #FF8566;
    --shadow: rgba(0, 0, 0, 0.5);
    --shadow-hover: rgba(0, 0, 0, 0.7);

    /* Contact Form Dark Mode Variables */
    --primary-color: #60A5FA;
    --primary-dark: #3B82F6;
    --card-background: #1F2937;
    --border-color: #374151;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --hover-background: #374151;
    --secondary-background: #111827;
    --input-background: #111827;

    /* Accessibility Colors */
    --focus-color: #60a5fa;
}

/* ====================================
   ACCESSIBILITY UTILITIES
   ==================================== */

/* Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focusable version (for skip links) */
.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Skip navigation link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--sky-blue);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    font-weight: 500;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

/* Keyboard-accessible tooltips */
.share-btn:hover::after,
.share-btn:focus-visible::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 13px;
    white-space: nowrap;
    border-radius: 4px;
    margin-bottom: 8px;
    pointer-events: none;
    z-index: 1000;
}

[data-theme="dark"] .share-btn:hover::after,
[data-theme="dark"] .share-btn:focus-visible::after {
    background: rgba(255, 255, 255, 0.95);
    color: #1E1E1E;
}

/* Enhanced Focus Indicators for Keyboard Navigation */
/* Only show focus outline when navigating with keyboard (not mouse clicks) */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Specific focus styles for interactive elements */
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 0px;
    border-color: var(--focus-color);
}

/* High contrast focus for important actions */
.calculate-btn:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.share-btn:focus-visible,
.history-btn:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

/* Focus for dropdown items */
.autocomplete-item:focus,
.history-item:focus {
    outline: 2px solid var(--focus-color);
    outline-offset: -2px;
}

/* Focus for theme toggle */
.theme-toggle-btn:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.15);
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Keep essential animations but make them instant */
    .toast,
    .contact-modal,
    .history-dropdown {
        transition-duration: 0.01ms !important;
    }

    /* Disable globe rotation and animations */
    .spinner {
        animation: none !important;
    }
}

[data-theme="dark"] body {
    background-color: #1A1A1A;
    background-image: url('assets/background-pattern-dark.svg');
}

[data-theme="dark"] .card {
    background: #252525;
    border: 1px solid #3A3A3A;
}

[data-theme="dark"] .header {
    background: linear-gradient(135deg, #1A3A4A 0%, #2C5A6F 100%);
}

[data-theme="dark"] .title {
    color: #FFFFFF;
}

[data-theme="dark"] .subtitle {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .airport-input {
    background: #2A2A2A;
    border-color: #404040;
    color: #E0E0E0;
}

[data-theme="dark"] .airport-input:focus {
    border-color: #4A9FD8;
    box-shadow: 0 0 0 3px rgba(74, 159, 216, 0.2);
}

[data-theme="dark"] .autocomplete-dropdown {
    background: #2A2A2A;
    border-color: #4A9FD8;
}

[data-theme="dark"] .autocomplete-item {
    border-bottom-color: #3A3A3A;
}

[data-theme="dark"] .autocomplete-item:hover {
    background-color: #353535;
}

[data-theme="dark"] .autocomplete-item.selected {
    background-color: #3585C0;
}

[data-theme="dark"] .airport-location {
    color: #FFFFFF;
}

[data-theme="dark"] .add-connection-btn {
    background: rgba(95, 184, 227, 0.1);
    border-color: #5FB8E3;
    color: #5FB8E3;
}

[data-theme="dark"] .add-connection-btn:hover {
    background: #4A9FD8;
    color: #1E1E1E;
}

[data-theme="dark"] .total-distance-container {
    background: linear-gradient(135deg, #4A8FB8 0%, #3A7090 100%);
    box-shadow: 0 4px 16px rgba(74, 143, 184, 0.4);
}

[data-theme="dark"] .section-heading {
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .total-distance-row {
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .distance-value-oneway {
    color: #FFD700;
}

[data-theme="dark"] .distance-value-roundtrip {
    color: #5FFBFF;
}

[data-theme="dark"] .airport-code {
    color: #6FC8F3;
}

[data-theme="dark"] .total-row .segment-distance {
    color: #5FFBFF;
}

[data-theme="dark"] .total-row .segment-distance.oneway-column {
    color: #FFD700;
}

[data-theme="dark"] .segments-table {
    background: #252525;
}

[data-theme="dark"] .segments-table thead {
    background: #2C5A6F;
}

[data-theme="dark"] .segments-table td {
    border-bottom-color: #3A3A3A;
}

[data-theme="dark"] .segments-table tbody tr:hover {
    background: #2F2F2F;
}

[data-theme="dark"] .total-row {
    background: linear-gradient(135deg, #2A3A3A 0%, #252F2F 100%);
}

[data-theme="dark"] .history-dropdown {
    background: #252525;
    border-color: #404040;
}

[data-theme="dark"] .history-header {
    background: linear-gradient(135deg, #2C5A6F 0%, #1A3A4A 100%);
}

[data-theme="dark"] .history-item {
    border-bottom-color: #3A3A3A;
}

[data-theme="dark"] .history-item:hover {
    background-color: #2F2F2F;
}

[data-theme="dark"] .history-footer {
    background: #2A2A2A;
    border-top-color: #3A3A3A;
}

[data-theme="dark"] .footer {
    background: #0F0F0F;
    border-top: 1px solid #2A2A2A;
}

[data-theme="dark"] .footer-section p,
[data-theme="dark"] .footer-copyright p {
    color: #B0B0B0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
    color: var(--text-dark);
    background-color: var(--light-gray);
    background-image: url('assets/background-pattern-light.svg');
    background-size: cover;
    background-attachment: fixed;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    min-width: 540px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(135deg, var(--sky-blue) 0%, #5FB8E3 100%);
    color: var(--white);
    padding: 24px 0;
    box-shadow: 0 4px 6px var(--shadow);
    text-align: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-text {
    flex: 1;
    text-align: center;
}

.theme-toggle-btn {
    background: rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(0, 0, 0, 0.3);
    color: #333333;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(0, 0, 0, 0.4);
    transform: rotate(180deg);
}

.theme-toggle-btn .sun-icon {
    display: block;
}

.theme-toggle-btn .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #FFFFFF;
}

[data-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .moon-icon {
    display: block;
}

.title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.airplane-icon {
    width: 40px;
    height: 40px;
}

.subtitle {
    font-size: 16px;
    font-weight: 300;
    opacity: 0.9;
}

.main-content {
    padding: 24px 0;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    transition: box-shadow 0.3s ease;
    overflow: visible;
}

.card:hover {
    box-shadow: 0 6px 16px var(--shadow-hover);
}

.input-section {
    padding: 40px 40px 24px 40px;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.multi-airport-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
    position: relative;
}

.airport-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    margin-bottom: 12px;
}

.multi-airport-container .input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
    max-width: 650px;
}

.multi-airport-container .input-label {
    min-width: 60px;
    width: 60px;
    flex-shrink: 0;
    text-align: right;
    margin-bottom: 0;
}

.multi-airport-container .autocomplete-wrapper {
    width: 500px;
    flex-shrink: 0;
}

.add-connection-row {
    display: flex;
    justify-content: flex-start;
    padding-left: 75px;
    margin: 8px 0 20px 0;
}

.add-connection-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(135, 206, 235, 0.1);
    border: 1px dashed #5FB8E3;
    color: #3B8BB8;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(135, 206, 235, 0.2);
    will-change: transform;
}

.add-connection-btn:hover {
    background: var(--sky-blue);
    color: var(--white);
    border-style: solid;
    box-shadow: 0 4px 8px rgba(135, 206, 235, 0.3);
    transform: translateY(-1px);
    will-change: auto;
}

.plus-icon-small {
    width: 16px;
    height: 16px;
}

.remove-connection-btn {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    margin-right: 6px;
    order: -1;
    /* Always show on the left */
}

.remove-connection-btn:hover {
    background: #dc3545;
    color: white;
}

.remove-connection-btn svg {
    width: 18px;
    height: 18px;
}

.button-spacer {
    width: 38px;
    flex-shrink: 0;
}

.swap-button-wrapper {
    display: flex;
    align-items: center;
    margin-left: 8px;
    position: relative;
    transform: translateY(24px);
    width: 40px;
    flex-shrink: 0;
}

.swap-airports-btn {
    background: transparent;
    border: 1px solid var(--sky-blue);
    color: var(--sky-blue);
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}

.swap-airports-btn:hover {
    background: var(--sky-blue);
    color: white;
}

.swap-airports-btn svg {
    width: 20px;
    height: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.input-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.autocomplete-wrapper {
    position: relative;
}

.input-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--dark-gray);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10;
}

.input-clear-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

.input-clear-btn svg {
    width: 20px;
    height: 20px;
}

[data-theme="dark"] .input-clear-btn {
    color: #999999;
}

[data-theme="dark"] .input-clear-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #CCCCCC;
}

.airport-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--white);
}

.airport-input:focus {
    outline: none;
    border-color: var(--sky-blue);
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.1);
}

.airport-input::placeholder {
    color: var(--dark-gray);
    opacity: 0.6;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid var(--sky-blue);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px var(--shadow);
    display: none;
}

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

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid var(--light-gray);
}

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

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

.autocomplete-item.selected {
    background-color: var(--sky-blue);
    color: var(--white);
}

.airport-name {
    font-weight: 500;
    display: block;
}

.airport-location {
    font-size: 14px;
    color: var(--dark-gray);
    display: block;
}

.error-message {
    color: var(--error-red);
    font-size: 14px;
    margin: 0;
    padding: 0;
    min-height: 0;
    height: 0;
    overflow: hidden;
    font-weight: 400;
}

.error-message:not(:empty) {
    height: auto;
    margin-top: 4px;
    overflow: visible;
}

.button-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.calculate-btn {
    flex: 1;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    color: var(--white);
    background: var(--accent-orange);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 8px rgba(255, 99, 71, 0.3);
    will-change: transform;
    min-height: 56px;
}

.calculate-btn:hover:not(:disabled) {
    background: #FF4500;
    box-shadow: 0 6px 12px rgba(255, 99, 71, 0.4);
    transform: translateY(-2px);
}

.calculate-btn:active:not(:disabled) {
    transform: translateY(0);
    will-change: auto;
}

.calculate-btn:disabled {
    background: var(--medium-gray);
    cursor: not-allowed;
    box-shadow: none;
    will-change: auto;
}

.share-btn {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    color: var(--white);
    background: var(--sky-blue);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(135, 206, 235, 0.3);
    white-space: nowrap;
    will-change: transform;
}

.share-btn:hover:not(:disabled) {
    background: #5FB8E3;
    box-shadow: 0 6px 12px rgba(135, 206, 235, 0.4);
    transform: translateY(-2px);
}

.share-btn:active:not(:disabled) {
    transform: translateY(0);
    will-change: auto;
}

.share-btn:disabled {
    background: var(--medium-gray);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
    will-change: auto;
}

.share-btn svg {
    flex-shrink: 0;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.9);
    color: var(--white);
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.history-container {
    position: relative;
}

.history-btn {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    color: var(--white);
    background: #6c757d;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
    white-space: nowrap;
    will-change: transform;
}

.history-btn:hover {
    background: #5a6268;
    box-shadow: 0 6px 12px rgba(108, 117, 125, 0.4);
    transform: translateY(-2px);
}

.history-btn:active {
    transform: translateY(0);
    will-change: auto;
}

.history-btn svg {
    flex-shrink: 0;
}

.history-dropdown {
    position: fixed;
    background: var(--white);
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 350px;
    max-width: 450px;
    max-height: 60vh;
    overflow-y: auto;
    display: none;
}

.history-dropdown.show {
    display: block;
}

.history-header {
    padding: 16px;
    border-bottom: 2px solid var(--light-gray);
    background: linear-gradient(135deg, var(--sky-blue) 0%, #5FB8E3 100%);
    color: var(--white);
    font-weight: 500;
    font-size: 16px;
    border-radius: 6px 6px 0 0;
}

.history-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--dark-gray);
    font-size: 15px;
}

.history-item {
    padding: 16px;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item:hover {
    background-color: var(--light-gray);
}

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

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-route {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-dark);
    font-family: 'Courier New', monospace;
}

.history-delete {
    background: transparent;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-size: 18px;
    line-height: 1;
}

.history-delete:hover {
    background: rgba(220, 53, 69, 0.1);
}

[data-theme="dark"] .history-delete {
    color: #ff6b6b;
}

[data-theme="dark"] .history-delete:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff8888;
}

.history-details {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--dark-gray);
}

.history-distance {
    font-weight: 500;
    color: var(--accent-orange);
}

.history-timestamp {
    color: var(--dark-gray);
}

.history-cities {
    font-size: 12px;
    color: var(--dark-gray);
    margin-top: 2px;
}

.history-footer {
    padding: 12px 16px;
    border-top: 2px solid var(--light-gray);
    background: var(--light-gray);
    display: flex;
    justify-content: center;
}

.clear-history-btn {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.clear-history-btn:hover {
    background: #dc3545;
    color: var(--white);
}

[data-theme="dark"] .clear-history-btn {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
}

[data-theme="dark"] .clear-history-btn:hover {
    background: #ff6b6b;
    color: #1E1E1E;
}

/* Export History Button - Match Clear Button Style */
.export-history-btn {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.export-history-btn:hover {
    background: #dc3545;
    color: var(--white);
}

[data-theme="dark"] .export-history-btn {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
}

[data-theme="dark"] .export-history-btn:hover {
    background: #ff6b6b;
    color: #1E1E1E;
}

.loading-spinner {
    display: none;
}

.calculate-btn.loading .loading-spinner {
    display: inline-block;
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 24px;
    height: 24px;
}

.spinner-path {
    stroke: var(--white);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.map-section {
    padding: 0;
    overflow: hidden;
}

.map-container {
    width: 100%;
    height: 500px;
    border-radius: 12px;
}

.results-section {
    animation: fadeIn 0.5s ease;
    scroll-margin-top: 20px;
}

/* ===== ANIMATION KEYFRAMES ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===== AIRPORT INFORMATION MODAL ===== */

/* Info Icon Button */
.airport-info-icon {
    margin-left: 6px;
    padding: 2px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    transition: background 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    vertical-align: middle;
}

.airport-info-icon:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.1);
}

.airport-info-icon:active {
    transform: scale(0.95);
}

.airport-info-icon svg {
    width: 16px;
    height: 16px;
}

/* Airport Modal */
.airport-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.airport-modal.show {
    opacity: 1;
}

.airport-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.airport-modal-content {
    position: relative;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    z-index: 1;
}

.airport-modal.show .airport-modal-content {
    transform: translateY(0);
}

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

.airport-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.airport-modal-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.airport-modal-close:hover {
    background: var(--hover-background);
    color: var(--text-primary);
}

.airport-modal-tabs {
    display: flex;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-background);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 52px;
    align-items: flex-end;
}

.airport-tab {
    padding: 16px 20px 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease, background 0.2s ease, border-bottom-color 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.5;
}

.airport-tab:hover {
    color: var(--text-primary);
    background: var(--hover-background);
}

.airport-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.airport-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Airport Modal Footer */
.airport-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--secondary-background);
    text-align: center;
}

.airport-disclaimer {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.airport-disclaimer em {
    font-style: italic;
}

.report-airport-issue-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-style: normal;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-left: 4px;
}

.report-airport-issue-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

[data-theme="dark"] .report-airport-issue-link {
    color: #60A5FA;
}

[data-theme="dark"] .report-airport-issue-link:hover {
    color: #93C5FD;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===== AIRLINES TAB STYLES ===== */

.airlines-content {
    color: var(--text-primary);
}

/* Total Airlines Scoreboard */
.airlines-total-scoreboard {
    padding: 16px 20px;
    margin-bottom: 28px;
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.scoreboard-heading {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.scoreboard-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.scoreboard-value {
    font-size: 36px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    line-height: 1;
}

.scoreboard-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.scoreboard-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.airlines-section-header {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Add spacing after each section */
.airlines-section {
    margin-bottom: 32px;
}

.airlines-section:last-of-type {
    margin-bottom: 0;
}

/* Hub Carrier Cards */
.hub-carrier-card {
    background: var(--secondary-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

/* Subtle left border to indicate hub type */
.hub-carrier-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 8px 0 0 8px;
}

.hub-carrier-card.hub-primary::before {
    background-color: #3498DB;
}

.hub-carrier-card.hub-secondary::before {
    background-color: #27AE60;
}

.hub-carrier-card.hub-focus::before {
    background-color: #E67E22;
}

.hub-carrier-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .hub-carrier-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hub-carrier-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.airline-code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--card-background);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    min-width: 48px;
    text-align: center;
    flex-shrink: 0;
}

.airline-info {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.airline-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    flex: 1;
}

.hub-carrier-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.hub-notes {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 200px;
    line-height: 1.5;
}

/* Hub type label - subtle text only */
.hub-type-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Alliance Badges - refined pills */
.alliance-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Star Alliance - Gold/Yellow tones */
.alliance-badge.star-alliance {
    background-color: rgba(255, 193, 7, 0.2);
    color: #CC8800;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

[data-theme="dark"] .alliance-badge.star-alliance {
    background-color: rgba(218, 165, 32, 0.2);
    color: #E0B856;
    border: 1px solid rgba(218, 165, 32, 0.4);
}

/* SkyTeam - Sky Blue tones */
.alliance-badge.skyteam {
    background-color: rgba(33, 150, 243, 0.2);
    color: #1565C0;
    border: 1px solid rgba(33, 150, 243, 0.4);
}

[data-theme="dark"] .alliance-badge.skyteam {
    background-color: rgba(33, 150, 243, 0.25);
    color: #64B5F6;
    border: 1px solid rgba(33, 150, 243, 0.5);
}

/* oneworld - Coral/Salmon tones (distinct from blue) */
.alliance-badge.oneworld {
    background-color: rgba(233, 84, 85, 0.2);
    color: #C62828;
    border: 1px solid rgba(233, 84, 85, 0.4);
}

[data-theme="dark"] .alliance-badge.oneworld {
    background-color: rgba(233, 84, 85, 0.25);
    color: #EF9A9A;
    border: 1px solid rgba(233, 84, 85, 0.5);
}

.alliance-badge.no-alliance {
    background-color: rgba(149, 165, 166, 0.15);
    color: #7F8C8D;
    border: 1px solid rgba(149, 165, 166, 0.3);
}

[data-theme="dark"] .alliance-badge.no-alliance {
    background-color: rgba(149, 165, 166, 0.2);
    color: #95A5A6;
    border: 1px solid rgba(149, 165, 166, 0.4);
}

/* Major Carriers Grid */
.major-carriers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.major-carrier-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.major-carrier-card:hover {
    background: var(--hover-background);
    border-color: var(--primary-color);
}

.major-carrier-card .airline-code {
    font-size: 14px;
    padding: 4px 8px;
    min-width: 40px;
}

.major-carrier-card .airline-name {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    margin: 0;
}

.major-carrier-card .alliance-badge {
    flex-shrink: 0;
}

/* Airlines Notes */
.airlines-notes {
    margin-top: 32px;
    padding: 12px 16px;
    background: var(--secondary-background);
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Empty State */
.airlines-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.airlines-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.airlines-empty-state p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 16px 0;
    color: var(--text-secondary);
}

.airlines-empty-state .report-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.airlines-empty-state .report-link:hover {
    text-decoration: underline;
}

/* Responsive Breakpoints */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .major-carriers-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .hub-carrier-card {
        padding: 14px;
    }

    .airlines-section-header {
        font-size: 17px;
    }
}

/* Mobile (<768px) */
@media (max-width: 767px) {
    .major-carriers-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .hub-carrier-card {
        padding: 12px;
    }

    .hub-carrier-header {
        gap: 10px;
    }

    .airline-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .airline-code {
        font-size: 14px;
        padding: 4px 8px;
        min-width: 42px;
    }

    .airline-name {
        font-size: 15px;
    }

    .hub-notes {
        font-size: 12px;
        min-width: 150px;
    }

    .major-carrier-card {
        flex-wrap: wrap;
    }

    .major-carrier-card .airline-code {
        order: 1;
    }

    .major-carrier-card .airline-name {
        order: 2;
        flex: 1 0 auto;
    }

    .major-carrier-card .alliance-badge {
        order: 3;
        flex: 1 0 100%;
        text-align: center;
        margin-top: 6px;
    }

    .airlines-section-header {
        font-size: 16px;
    }

    .airlines-empty-state {
        padding: 40px 16px;
    }

    .empty-state-icon {
        font-size: 48px;
    }
}

/* ===== END AIRLINES TAB STYLES ===== */

/* Airport Info Content */
.airport-info-content {
    color: var(--text-primary);
}

.info-notice {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #e8f4fd;
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
}

.info-notice p {
    margin: 0;
    font-size: 14px;
    color: #1e40af;
    line-height: 1.5;
}

[data-theme="dark"] .info-notice {
    background: rgba(59, 130, 246, 0.15);
    border-left-color: var(--primary-color);
}

[data-theme="dark"] .info-notice p {
    color: #93c5fd;
}

.info-section {
    margin-bottom: 28px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.info-item label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 80px;
}

.info-item span {
    color: var(--text-primary);
}

.info-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

/* Social media icons */
.social-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
}

.info-note {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--hover-background);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.link-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.link-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.transport-option {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--hover-background);
    border-radius: 8px;
}

.transport-option:last-child {
    margin-bottom: 0;
}

.transport-option h4 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.transport-option ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.transport-option li {
    padding: 4px 0;
    color: var(--text-secondary);
}

.transport-option li strong {
    color: var(--text-primary);
}

.no-data {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading-spinner::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.airport-modal .error-message {
    padding: 40px 20px;
    text-align: center;
    color: var(--error-color);
}

.airport-modal .error-message p {
    margin: 0 0 20px;
    font-size: 16px;
}

.airport-modal .error-message button {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.airport-modal .error-message button:hover {
    background: #2563eb;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .airport-modal-content {
        width: 95%;
        max-height: 90dvh; /* Use dynamic viewport height to account for mobile browser UI */
        border-radius: 12px 12px 0 0;
        position: fixed;
        bottom: 0;
        transform: translateY(100%);
    }

    .airport-modal.show .airport-modal-content {
        transform: translateY(0);
    }

    .airport-modal-header {
        padding: 20px 16px 12px;
    }

    .airport-modal-header h2 {
        font-size: 20px;
    }

    .airport-modal-tabs {
        padding: 0 16px;
        overflow-x: auto;
    }

    .airport-tab {
        padding: 14px 16px 8px 16px;
        font-size: 14px;
        white-space: nowrap;
        line-height: 1.5;
    }

    .airport-modal-body {
        padding: 16px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .link-buttons {
        flex-direction: column;
    }

    .link-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode adjustments */
[data-theme="dark"] .airport-modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .transport-option {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .info-note {
    background: rgba(255, 255, 255, 0.05);
}

/* ===== END AIRPORT INFORMATION MODAL ===== */

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-gray);
}

.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--sky-blue);
    transition: 0.4s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: var(--white);
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-orange);
}

input:checked+.slider:before {
    transform: translateX(28px);
}

.unit-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light-gray);
}

.results-title {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-dark);
}

.results-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

.airport-details,
.distance-details {
    padding: 20px;
    background: var(--light-gray);
    border-radius: 8px;
}

.airport-heading,
.distance-heading {
    font-size: 18px;
    font-weight: 500;
    color: var(--sky-blue);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sky-blue);
}

.detail-row,
.distance-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--medium-gray);
}

.detail-row:last-child,
.distance-row:last-child {
    border-bottom: none;
}

.detail-label,
.distance-label {
    font-weight: 500;
    color: var(--text-dark);
}

.detail-value,
.distance-value {
    font-weight: 400;
    color: var(--dark-gray);
    text-align: right;
}

.distance-value {
    font-size: 18px;
    font-weight: 500;
    color: var(--accent-orange);
}

.total-distance-container {
    background: linear-gradient(135deg, #2E5A7D 0%, #1E3A52 100%);
    color: var(--white);
    padding: 12px 32px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(59, 139, 184, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0;
}

.summary-heading {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    padding: 0 100px 0 0;
    white-space: nowrap;
}

.summary-metric {
    flex: 1;
    text-align: left;
    padding: 0 16px 0 16px;
}

.summary-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
}

.summary-divider {
    width: 1px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    margin: 0;
}

/* Loyalty metrics styling */
.loyalty-metric .summary-value {
    color: #F5B342;
}

.section-heading {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
}

.segments-table-container {
    margin-top: 20px;
}

.table-legend-row {
    background: transparent;
}

.table-legend-row td {
    padding: 0 !important;
    border: none !important;
}

.table-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--primary-color);
    border-radius: 6px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.table-legend svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

.table-legend strong {
    color: var(--primary-color);
    font-weight: 600;
}

[data-theme="dark"] .table-legend {
    background: rgba(74, 159, 216, 0.12);
}

.segments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.segments-table thead {
    background: linear-gradient(135deg, #5FB8E3 0%, #4A9FD8 100%);
    color: var(--white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.segments-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
}

/* Ensure loyalty columns have consistent font sizes */
.segments-table th:nth-child(5),
.segments-table th:nth-child(6) {
    font-size: 14px;
}

.segments-table th:nth-child(3),
.segments-table th:nth-child(4) {
    text-align: center;
}

.segments-table th:nth-child(5),
.segments-table th:nth-child(6) {
    text-align: right;
}

.segments-table th:nth-child(7) {
    text-align: center;
}

.segments-table th.oneway-column {
    font-weight: 600;
    font-size: 15px;
    background: rgba(95, 184, 227, 0.3) !important;
}

.segments-table td.oneway-column {
    background: rgba(95, 184, 227, 0.1);
}

.segments-table th.flight-time-column {
    text-align: center;
}

.segments-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--light-gray);
    font-size: 14px;
}

.segments-table td.oneway-column {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
}

.segments-table tbody tr:last-child td {
    border-bottom: none;
}

.segments-table tbody tr:hover {
    background: #f8f9fa;
}

.segment-number {
    text-align: center;
    font-weight: 500;
    color: var(--accent-orange);
    width: 80px;
}

.segment-route {
    font-weight: 500;
}

.airport-code {
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    color: #2c5f7a;
    font-weight: 500;
    width: 100px;
    letter-spacing: 0.5px;
}

.clickable-city {
    text-decoration: none;
    transition: all 0.2s ease;
}

.clickable-city:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

.clickable-airport-code {
    text-decoration: none;
    transition: all 0.2s ease;
}

.clickable-airport-code:hover {
    text-decoration: underline;
    color: var(--primary-color);
    font-weight: 600;
}

.segment-distance {
    text-align: right;
    font-weight: 500;
    color: var(--accent-orange);
    width: 120px;
}

.flight-time {
    text-align: center;
    font-weight: 500;
    color: var(--sky-blue);
    width: 100px;
}

.total-row {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    font-weight: 600;
    border-top: 2px solid var(--sky-blue);
}

.total-row .total-cell {
    padding: 16px;
    color: var(--dark-gray);
}

.total-row .segment-number {
    color: var(--sky-blue);
    font-size: 14px;
}

.total-row .segment-distance {
    color: var(--accent-orange);
    font-size: 14px;
    line-height: 1.6;
}

.total-row .segment-distance.oneway-column {
    font-size: 16px;
    font-weight: 700;
    color: #FF4500;
}

/* Airport markers on globe */
.airport-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FF6347;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* Hover state for airport markers */
.airport-marker:hover .marker-circle {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(255, 99, 71, 0.6);
    background: #FF4500;
}

/* Focus state for accessibility */
.airport-marker:focus {
    outline: 3px solid #4A90E2;
    outline-offset: 4px;
    border-radius: 50%;
}

.airport-marker:focus .marker-circle {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.6);
}

/* Active/pressed state */
.airport-marker:active .marker-circle {
    transform: scale(1.05);
}

.airport-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    pointer-events: none;
    z-index: 10000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
}

.airport-tooltip strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

@media (max-width: 768px) {
    .segments-table {
        font-size: 12px;
    }

    .segments-table th,
    .segments-table td {
        padding: 8px 10px;
    }

    .segment-route {
        font-size: 13px;
    }
}

.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--sky-blue);
}

.footer-section p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--medium-gray);
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--dark-gray);
}

.footer-copyright p {
    font-size: 14px;
    color: var(--medium-gray);
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
}

@media (max-width: 1024px) {
    .results-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 836px) {

    /* Multi-airport layout - switch to mobile style earlier */
    .multi-airport-container .input-group {
        max-width: 100% !important;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex: 1 1 auto;
    }

    .multi-airport-container .input-label {
        text-align: left;
        width: auto !important;
        min-width: 50px;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .multi-airport-container .autocomplete-wrapper {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: none !important;
    }

    .airport-input-row {
        width: 100%;
    }

    .add-connection-row {
        padding-left: 0;
        justify-content: center;
    }

    .swap-button-wrapper {
        display: flex;
        transform: none;
        margin-left: 0;
        margin-top: 8px;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 28px;
    }

    .airplane-icon {
        width: 32px;
        height: 32px;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .map-container {
        height: 400px;
    }
}

@media (max-width: 480px) {

    /* Prevent horizontal overflow */
    html,
    body {
        overflow-x: hidden;
    }

    body {
        max-width: 100vw;
    }

    .container {
        padding: 0 15px;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .card {
        padding: 20px 15px;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .input-section {
        padding: 16px 12px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .title {
        font-size: 24px;
    }

    /* Header adjustments */
    .header {
        padding: 16px 0;
        position: relative;
    }

    .header-content {
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    .header-text {
        width: 100%;
        text-align: center;
    }

    /* Move theme toggle to top-right on mobile */
    .theme-toggle-btn {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }

    .subtitle {
        font-size: 15px;
    }

    /* Airport input containers - reduce spacing */
    .multi-airport-container {
        gap: 0;
        margin-bottom: 16px;
    }

    .airport-input-row {
        margin-bottom: 8px;
    }

    .multi-airport-container .input-group {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        width: 100%;
    }

    .multi-airport-container .input-label {
        font-size: 13px;
        margin-bottom: 0;
        font-weight: 600;
        min-width: 50px;
        flex-shrink: 0;
    }

    .multi-airport-container .autocomplete-wrapper {
        flex: 1;
        width: auto;
        max-width: none;
    }

    .add-connection-row {
        margin: 6px 0 12px 0;
    }

    .airport-group {
        max-width: 100%;
        width: 100%;
    }

    .airport-input {
        width: 100%;
        font-size: 16px;
        /* Prevents iOS zoom */
        padding: 10px 40px 10px 12px;
        /* Account for clear button */
    }

    .error-message {
        font-size: 12px;
        margin-top: 4px;
        min-height: 16px;
    }

    /* Buttons */
    .button-group {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .calculate-btn,
    .share-btn,
    .history-btn {
        width: 100%;
        font-size: 17px;
        padding: 15px 20px;
    }

    /* Add Segment button - make more compact */
    .add-connection-btn {
        font-size: 13px;
        padding: 8px 12px;
        width: auto;
        white-space: nowrap;
    }

    .add-connection-btn .btn-text {
        display: inline;
    }

    .remove-connection-btn,
    .swap-airports-btn {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    /* Unit toggle */
    .unit-toggle {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .toggle-label {
        font-size: 14px;
    }

    /* Results section */
    .total-distance-container {
        padding: 15px;
    }

    .total-distances {
        flex-direction: column;
        gap: 12px;
    }

    .distance-divider {
        display: none;
    }

    .distance-item {
        justify-content: center;
    }

    /* Table responsiveness */
    .segments-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .segments-table {
        font-size: 11px;
        min-width: 500px;
        /* Allow horizontal scroll for table */
    }

    .segments-table th,
    .segments-table td {
        padding: 6px 4px;
    }

    /* Hide less important columns on very small screens */
    .segments-table .oneway-column {
        display: table-cell;
        /* Keep it visible but small */
    }

    /* Map container */
    .map-container {
        height: 300px;
        max-width: 100%;
    }

    /* History dropdown - better mobile positioning */
    .history-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 70vh;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
        border: none;
        border-top: 3px solid var(--sky-blue);
    }

    .history-item {
        padding: 14px;
    }

    .history-item-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }

    .history-route {
        font-size: 13px;
        flex: 1;
    }

    .history-delete {
        font-size: 24px;
        padding: 6px 10px;
        min-width: 36px;
        min-height: 36px;
        background: rgba(220, 53, 69, 0.1);
        border: 1px solid rgba(220, 53, 69, 0.3);
        border-radius: 6px;
        flex-shrink: 0;
    }

    .history-delete:hover {
        background: rgba(220, 53, 69, 0.2);
        border-color: #dc3545;
    }

    [data-theme="dark"] .history-delete {
        background: rgba(255, 107, 107, 0.15);
        border-color: rgba(255, 107, 107, 0.3);
    }

    [data-theme="dark"] .history-delete:hover {
        background: rgba(255, 107, 107, 0.25);
        border-color: #ff6b6b;
    }

    /* Toast */
    .toast {
        left: 15px;
        right: 15px;
        width: auto;
        max-width: calc(100vw - 30px);
        font-size: 14px;
    }

    /* Footer */
    .footer {
        padding: 30px 0 15px;
    }

    .footer-section h4 {
        font-size: 16px;
    }

    .footer-section p {
        font-size: 13px;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

/* ===================================
   CONTACT FORM
   =================================== */

/* Floating Contact Button */
.floating-contact-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 900;
    will-change: transform;
}

.floating-contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.15);
}

.floating-contact-btn:active {
    transform: scale(1.05);
    will-change: auto;
}

.floating-contact-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.floating-contact-btn:hover svg {
    transform: rotate(15deg);
}

/* Footer Contact Button */
.footer-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 12px;
}

.footer-contact-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.footer-contact-btn svg {
    width: 18px;
    height: 18px;
}

/* Footer text links */
.footer-text-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.footer-text-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

[data-theme="dark"] .footer-text-link {
    color: #60A5FA;
}

[data-theme="dark"] .footer-text-link:hover {
    color: #93C5FD;
}

/* Contact Modal */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-modal.show {
    opacity: 1;
}

.contact-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.contact-modal-content {
    position: relative;
    background: var(--card-background);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

.contact-modal.show .contact-modal-content {
    transform: scale(1);
}

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

.contact-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
    color: var(--text-secondary);
}

.contact-modal-close:hover {
    background: var(--hover-background);
    color: var(--text-primary);
}

.contact-modal-close svg {
    width: 24px;
    height: 24px;
}

.contact-modal-description {
    padding: 0 24px 16px 24px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Contact Form */
.contact-form {
    padding: 0 24px 24px 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group .required {
    color: #e74c3c;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: var(--input-background);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    max-height: 60vh;
    font-family: inherit;
}

/* Increase textarea height on taller screens */
@media (min-height: 800px) {
    .form-group textarea {
        min-height: 200px;
    }
}

.char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-buttons .submit-btn,
.form-buttons .cancel-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.form-buttons .submit-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.form-buttons .submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-buttons .cancel-btn {
    background: var(--secondary-background);
    color: var(--text-primary);
}

.form-buttons .cancel-btn:hover {
    background: var(--hover-background);
}

/* Spinner for submit button */
.form-buttons .submit-btn .loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
}

.form-buttons .submit-btn.loading .btn-text {
    display: none;
}

.form-buttons .submit-btn.loading .loading-spinner {
    display: block;
}

.form-buttons .submit-btn .spinner {
    animation: rotate 1s linear infinite;
}

.form-buttons .submit-btn .spinner-path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Data Sources Modal Styles */
.data-sources-content {
    padding: 20px 24px;
}

.data-sources-intro {
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.data-source-item {
    margin-bottom: 28px;
    padding: 20px;
    background: var(--hover-background);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.data-source-item h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.data-source-item h3 svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.source-description {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.source-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.source-link svg {
    flex-shrink: 0;
}

.data-sources-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.data-sources-footer p {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 14px;
}

.data-sources-footer p:last-child {
    margin-bottom: 0;
}

.data-sources-footer strong {
    color: var(--text-primary);
}

/* Mobile Full-Screen Modal */
@media (max-width: 768px) {
    .contact-modal {
        align-items: flex-end;
    }

    .contact-modal-content {
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        transform: translateY(100%);
        margin: 0 8px;
    }

    .contact-modal.show .contact-modal-content {
        transform: translateY(0);
    }

    .floating-contact-btn {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }

    .form-buttons {
        flex-direction: column;
    }

    .form-buttons .submit-btn,
    .form-buttons .cancel-btn {
        width: 100%;
    }

    .data-sources-content {
        padding: 20px 20px;
    }
}

/* Dark Mode Adjustments */
body.dark-mode .contact-modal-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    border-color: var(--border-color);
    background: var(--input-background);
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ============================================
   LOYALTY CALCULATOR STYLES
   ============================================ */

/* Toolbar */
.card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #e5e5e5;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
    gap: 16px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 70%;
}

.toolbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 30%;
}

.toolbar-left .section-icon {
    font-size: 20px;
}

.toolbar-left h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}

/* Grid Layout */
.input-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
    gap: 16px;
    align-items: start;
}

.input-layout-grid.loyalty-hidden {
    grid-template-columns: 1fr 0fr;
    gap: 0;
}

.airports-section {
    border-right: 2px solid #e5e5e5;
    padding-right: 60px;
    overflow: visible;
}

.input-layout-grid.loyalty-hidden .airports-section {
    border-right-color: transparent;
    padding-right: 60px;
}

.loyalty-section {
    padding-left: 0px;
    overflow: visible;
}

.input-layout-grid.loyalty-hidden .loyalty-section {
    padding-left: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Toggle Button */
.toggle-loyalty-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: white;
    border: 2px solid #5FB8E3;
    border-radius: 6px;
    color: #3B8BB8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-loyalty-btn:hover {
    background: #5FB8E3;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(95, 184, 227, 0.3);
}

.toggle-loyalty-btn .icon {
    font-size: 14px;
}

/* Loyalty Toggle Compact (in toolbar) */
.loyalty-toggle-compact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.loyalty-toggle-compact .loyalty-icon {
    font-size: 18px;
    line-height: 1;
}

.loyalty-toggle-compact .loyalty-toggle-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* Custom Toggle Switch */
.loyalty-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.loyalty-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.loyalty-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #999;
    transition: 0.3s;
    border-radius: 26px;
}

.loyalty-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.loyalty-switch input:checked+.loyalty-slider {
    background-color: #5FB8E3;
}

.loyalty-switch input:focus-visible+.loyalty-slider {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

.loyalty-switch input:checked+.loyalty-slider:before {
    transform: translateX(24px);
}

/* Dark mode for toggle */
[data-theme="dark"] .loyalty-toggle-compact .loyalty-toggle-label {
    color: #e0e0e0;
}

[data-theme="dark"] .loyalty-slider {
    background-color: #555;
}

[data-theme="dark"] .loyalty-switch input:checked+.loyalty-slider {
    background-color: #4A9FD8;
}

/* Reset Button (inside panel) */
.reset-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
}

#resetLoyaltyBtn {
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

#resetLoyaltyBtn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

#resetLoyaltyBtn:active {
    transform: scale(0.95);
}

[data-theme="dark"] .reset-row {
    border-bottom-color: #3a3a3a;
}

[data-theme="dark"] #resetLoyaltyBtn {
    background: #2a2a2a;
    border-color: #404040;
    color: #c0c0c0;
}

[data-theme="dark"] #resetLoyaltyBtn:hover {
    background: #353535;
    border-color: #4a4a4a;
    color: #e0e0e0;
}

.loyalty-fields {
    max-height: 0;
    overflow: hidden;
    padding: 0 4px 0 0px;
}

.loyalty-fields.active {
    max-height: 800px;
}

.loyalty-form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 4px;
    min-height: 36px;
}

.loyalty-form-row label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    min-width: 100px;
    width: 100px;
    text-align: right;
    flex-shrink: 0;
    padding-right: 8px;
}

.loyalty-form-row input,
.loyalty-form-row select {
    flex: 1;
    padding: 6px 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.loyalty-form-row input:focus,
.loyalty-form-row select:focus {
    outline: none;
    border-color: #5FB8E3;
}

.loyalty-form-row input[type="number"] {
    width: 85px;
    min-width: 85px;
    max-width: 85px;
    text-align: right;
    padding: 6px 8px;
    flex-shrink: 0;
}

/* Add space between number text and spinner arrows */
.loyalty-form-row input[type="number"]::-webkit-inner-spin-button,
.loyalty-form-row input[type="number"]::-webkit-outer-spin-button {
    margin-left: 8px;
}

.loyalty-form-row select {
    font-size: 14px;
}

.loyalty-form-row.checkbox {
    padding-left: 60px;
}

.loyalty-form-row.checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-right: 6px;
}

.loyalty-form-row.checkbox label {
    min-width: auto;
    width: auto;
    text-align: left;
    font-weight: normal;
    font-size: 14px;
}

.reset-loyalty-btn {
    padding: 4px 12px;
    margin-left: 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-loyalty-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.reset-loyalty-btn:active {
    transform: scale(0.95);
}

.unit-suffix {
    font-size: 14px;
    color: #595959;
    margin-left: 6px;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* Program Type Selector */
.program-type-row {
    margin-bottom: 12px;
}

.program-type-selector {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.program-type-btn {
    flex: 1;
    padding: 5px 8px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.program-type-btn:hover {
    border-color: #5FB8E3;
    background: #f0f8ff;
}

.program-type-btn.active {
    border-color: #5FB8E3;
    background: linear-gradient(135deg, #5FB8E3 0%, #4A9FD8 100%);
    color: white;
}

/* Conditional Fields */
.conditional-fields {
    display: none;
}

.conditional-fields.active {
    display: block;
}

.conditional-fields .loyalty-form-row {
    margin-left: 0;
}

/* Results Table Loyalty Columns */
.loyalty-col {
    background: rgba(95, 184, 227, 0.1);
}

.loyalty-miles-col {
    width: 90px;
    text-align: right;
}

.loyalty-eqm-col {
    width: 80px;
    text-align: center;
}

/* Loyalty Summary Row */
.loyalty-summary-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.distance-value-loyalty {
    font-size: 20px;
    font-weight: 700;
    color: #FFE5B4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.loyalty-icon {
    font-size: 18px;
    margin-right: 4px;
}

/* Dark Mode Styles for Loyalty Calculator */
[data-theme="dark"] .card-toolbar {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-bottom-color: #3a3a3a;
}

[data-theme="dark"] .toolbar-left h3 {
    color: #e0e0e0;
}

[data-theme="dark"] .toolbar-right {
    border-top-color: #3a3a3a;
}

[data-theme="dark"] .toggle-loyalty-btn {
    background: #2a2a2a;
    border-color: #4a9fd8;
    color: #4a9fd8;
}

[data-theme="dark"] .toggle-loyalty-btn:hover {
    background: #4a9fd8;
    color: white;
}

[data-theme="dark"] .airports-section {
    border-right-color: #3a3a3a;
}

[data-theme="dark"] .loyalty-enable-prominent label {
    color: #e0e0e0;
}

[data-theme="dark"] .loyalty-form-row label {
    color: #c0c0c0;
}

[data-theme="dark"] .loyalty-form-row input,
[data-theme="dark"] .loyalty-form-row select {
    background: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
}

[data-theme="dark"] .loyalty-form-row input:focus,
[data-theme="dark"] .loyalty-form-row select:focus {
    border-color: #4a9fd8;
}

[data-theme="dark"] .program-type-btn {
    background: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
}

[data-theme="dark"] .program-type-btn:hover {
    border-color: #4a9fd8;
    background: #353535;
}

[data-theme="dark"] .program-type-btn.active {
    border-color: #4a9fd8;
    background: linear-gradient(135deg, #4a9fd8 0%, #3b8bb8 100%);
    color: white;
}

[data-theme="dark"] .unit-suffix {
    color: #9ca3af;
}

[data-theme="dark"] .loyalty-col {
    background: rgba(74, 159, 216, 0.1);
}

/* Responsive Mobile Styles for Loyalty Calculator */
@media (max-width: 1180px) { /* Breakpoint for stacked layout */

    /* Hide toggle in toolbar on mobile, move it below airports section */
    .toolbar-right {
        display: none;
    }

    /* Toolbar - only show left side */
    .card-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .toolbar-left {
        flex: 1 0 100%;
        justify-content: center;
    }

    .input-layout-grid,
    .input-layout-grid.loyalty-hidden {
        grid-template-columns: 1fr;
    }

    .airports-section {
        border-right: none;
        border-bottom: none;
        padding-right: 0;
        padding-bottom: 0;
        position: relative;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Override desktop padding when loyalty is hidden on mobile */
    .input-layout-grid.loyalty-hidden .airports-section {
        padding-right: 0;
    }

    [data-theme="dark"] .airports-section {
        border-bottom-color: #3a3a3a;
    }

    /* Mobile toggle container - shown via JavaScript */
    .loyalty-toggle-mobile {
        justify-content: center;
        align-items: center;
        padding: 16px 0 0 0;
        margin-top: 12px;
        border-top: 2px solid #e5e5e5;
    }

    [data-theme="dark"] .loyalty-toggle-mobile {
        border-top-color: #3a3a3a;
    }

    /* Increase mobile toggle label font size to match header */
    .loyalty-toggle-mobile .loyalty-toggle-label {
        font-size: 16px;
    }

    .loyalty-section {
        padding-left: 0;
        padding-top: 4px;
        width: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Reduce spacing in loyalty fields on mobile */
    .loyalty-section .reset-row {
        margin-bottom: 6px;
        padding-bottom: 6px;
        margin-top: 0;
        justify-content: center;
    }

    .loyalty-section .program-type-row {
        margin-bottom: 8px;
    }

    .loyalty-section .loyalty-form-row {
        margin-bottom: 8px;
    }

    .input-layout-grid.loyalty-hidden .loyalty-section {
        display: none;
    }
}

/* Tablet and Mobile: Trip Total Card Responsive */
@media (max-width: 768px) {
    .total-distance-container {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
        gap: 12px;
    }

    .summary-heading {
        padding: 0;
        margin-bottom: 12px;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding-bottom: 8px;
    }

    .summary-metric {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .summary-metric:last-child,
    .summary-metric.last-visible-metric {
        border-bottom: none;
    }

    .summary-label {
        font-size: 12px;
        margin-bottom: 0;
        text-align: left;
        line-height: 1.5;
    }

    .summary-value {
        font-size: 20px;
        text-align: right;
        line-height: 1.5;
    }

    .loyalty-metric {
        display: flex;
        padding: 12px 0;
    }

    .loyalty-metric .summary-label {
        font-size: 12px;
        margin-bottom: 0;
        line-height: 1.5;
    }

    .loyalty-metric .summary-value {
        font-size: 20px;
        line-height: 1.5;
    }

    .summary-divider {
        display: none;
    }

    .loyalty-divider {
        display: none !important;
    }
}

/* Mobile: Enhanced Loyalty Form Responsiveness */
@media (max-width: 480px) {

    /* Trip Total Card - Further Optimization */
    .total-distance-container {
        padding: 12px 16px;
    }

    .summary-heading {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .summary-value {
        font-size: 18px;
    }

    .summary-label {
        font-size: 11px;
    }

    /* Loyalty Form - Two Column Grid for Mobile */

    /* Keep inactive conditional fields hidden */
    .conditional-fields {
        display: none;
    }

    /* Distance and Revenue fields - Two columns when active */
    .conditional-fields.active {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .conditional-fields .loyalty-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-bottom: 0;
    }

    .conditional-fields .loyalty-form-row label {
        text-align: left;
        min-width: auto;
        font-size: 13px;
        font-weight: 600;
    }

    .conditional-fields .loyalty-form-row input[type="number"] {
        max-width: 100%;
        font-size: 16px;
        padding: 8px;
    }

    /* Bonus fields grid - Two columns */
    .bonus-fields-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .bonus-fields-grid .loyalty-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-bottom: 0;
    }

    .bonus-fields-grid .loyalty-form-row label {
        text-align: left;
        min-width: auto;
        font-size: 13px;
        font-weight: 600;
    }

    .bonus-fields-grid .loyalty-form-row input[type="number"] {
        max-width: 100%;
        font-size: 16px;
        padding: 8px;
    }

    /* General loyalty form rows */
    .loyalty-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-bottom: 12px;
    }

    .loyalty-form-row label {
        text-align: left;
        min-width: auto;
        font-size: 13px;
        font-weight: 600;
    }

    .loyalty-form-row input[type="number"] {
        max-width: 100%;
        font-size: 16px;
        /* Prevent iOS zoom */
        padding: 8px;
    }

    .loyalty-form-row select {
        font-size: 16px;
        /* Prevent iOS zoom */
    }

    .loyalty-form-row.checkbox {
        flex-direction: row;
        padding-left: 0;
    }

    .loyalty-form-row.checkbox label {
        font-size: 14px;
    }

    /* Program Type Buttons - Larger Touch Targets */
    .program-type-btn {
        font-size: 14px;
        padding: 10px 8px;
        min-height: 44px;
        /* iOS recommended touch target */
    }

    /* Reset Button */
    .loyalty-enable-prominent .reset-loyalty-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    /* Unit Suffix */
    .unit-suffix {
        font-size: 14px;
    }

    /* Toolbar - More Compact */
    .card-toolbar {
        padding: 10px 12px;
        margin-bottom: 16px;
    }

    .toolbar-left h3 {
        font-size: 14px;
    }

    .toggle-loyalty-btn {
        font-size: 11px;
        padding: 5px 10px;
    }

    .toggle-loyalty-btn .icon {
        font-size: 12px;
    }

    /* Results Table with Loyalty Columns */
    .segments-table {
        min-width: 700px;
        /* Wider to accommodate loyalty columns when enabled */
    }

    .segments-table .loyalty-col {
        font-size: 10px;
        padding: 6px 3px;
        white-space: nowrap;
    }

    .loyalty-miles-col,
    .loyalty-eqm-col {
        min-width: 60px;
    }
}

/* ============================================
   Cookie Consent Banner
   ============================================ */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideUp 0.3s ease-out;
    font-size: 13px;
}

.cookie-consent-banner.hidden {
    display: none;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-consent-text {
    flex: 1;
    line-height: 1.4;
    color: #ecf0f1;
}

.cookie-consent-text a {
    color: #3498db;
    text-decoration: none;
    margin-left: 4px;
}

.cookie-consent-text a:hover {
    text-decoration: underline;
}

.cookie-consent-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    white-space: nowrap;
}

.cookie-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-btn-accept {
    background: #27ae60;
    color: white;
}

.cookie-btn-accept:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.cookie-btn-decline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-decline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Body padding when banner is visible */
body {
    padding-bottom: 0;
    transition: padding-bottom 0.3s ease-out;
}

body.cookie-banner-visible {
    padding-bottom: 60px;
}

/* Floating contact button adjustment */
.floating-contact-btn {
    transition: bottom 0.3s ease-out;
}

.floating-contact-btn.banner-visible {
    bottom: 80px;
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(100%);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 10px 15px;
    }

    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cookie-consent-text {
        text-align: center;
        font-size: 12px;
    }

    .cookie-consent-buttons {
        justify-content: center;
    }

    .cookie-btn {
        flex: 0 0 auto;
        min-width: 90px;
        max-width: 120px;
        min-height: 36px;
        font-size: 12px;
        padding: 6px 12px;
    }

    body.cookie-banner-visible {
        padding-bottom: 80px;
    }

    .floating-contact-btn.banner-visible {
        bottom: 100px;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    .cookie-consent-text {
        font-size: 11px;
    }
}
