/* Landing page scroll override */
body.landing-page, body.landing-page html { overflow-y: auto; overflow-x: hidden; }

/* Header */
.page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: 100;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.header-brand i {
    color: var(--accent-blue);
    font-size: 1.1rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.header-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Language Selector */
.lang-selector {
    position: relative;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.lang-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-xs);
    min-width: 140px;
    z-index: 100;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-height: 300px;
    overflow-y: auto;
}

.lang-dropdown.active {
    display: flex;
}

.lang-form {
    display: contents;
}

.lang-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.lang-option:hover {
    background: rgba(88, 166, 255, 0.1);
    color: var(--text-primary);
}

.lang-option.active {
    color: var(--accent-blue);
    font-weight: 600;
}

.lang-code {
    display: inline-block;
    width: 24px;
    font-weight: 600;
    opacity: 0.7;
}

.header-demo-link {
    display: none;
}

.header-demo-link.visible {
    display: inline-flex;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Demo CTA fade */
.demo-cta {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.demo-cta.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Background */
.bg-arcs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(88, 166, 255, 0.10) 0%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

/* Landing Layout */
.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 48px 48px;
    position: relative;
    z-index: 1;
}

.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    width: 100%;
}

.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Left Column: Hero Text + Upload Card */
.hero-title {
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero-tagline {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 480px;
    margin-bottom: 32px;
}

.upload-card {
    padding: var(--space-lg);
    width: 100%;
    max-width: 480px;
    transition: max-width 0.3s ease;
}

/* Widen card on desktop when manual tab is active */
@media (min-width: 900px) {
    .upload-card.manual-active {
        max-width: 800px;
    }
}

/* Staggered Reveal Animations */
[data-reveal] { opacity: 0; transform: translateY(24px); }
[data-reveal].revealed { animation: revealUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes revealUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

[data-reveal="1"].revealed { animation-delay: 0.05s; }
[data-reveal="2"].revealed { animation-delay: 0.20s; }
[data-reveal="3"].revealed { animation-delay: 0.35s; }
[data-reveal="4"].revealed { animation-delay: 0.50s; }

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: var(--space-lg);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 4px;
}

.tab {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab.active {
    background: var(--accent-blue);
    color: var(--bg-primary);
}

.tab:hover:not(.active) {
    color: var(--text-primary);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Upload Tab */
.upload-area {
    margin-bottom: var(--space-md);
}

.file-label {
    width: 100%;
    padding: var(--space-xl) var(--space-lg);
    flex-direction: column;
    gap: var(--space-sm);
}

.file-label i {
    font-size: 1.75rem;
    color: var(--text-secondary);
}

.file-label .upload-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.file-label .upload-formats {
    color: var(--text-secondary);
    font-size: 0.7rem;
    opacity: 0.6;
}

.file-label:hover i,
.file-label:hover .upload-text {
    color: var(--accent-blue);
}

.file-label.has-file i,
.file-label.has-file .upload-text {
    color: var(--accent-green);
}

.file-name {
    color: var(--accent-green);
    margin-top: var(--space-sm);
    font-size: 0.875rem;
    min-height: 1.25rem;
    text-align: center;
}

.submit-btn {
    width: 100%;
    margin-top: var(--space-md);
    display: none;
}

.submit-btn.visible {
    display: inline-flex;
}

/* Sample link */
.sample-link-row {
    text-align: center;
    margin-top: var(--space-sm);
    position: relative;
}

.sample-link {
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    background: none;
    border: none;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.sample-link:hover {
    color: var(--accent-blue);
}

.sample-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 50;
    overflow: hidden;
    min-width: 160px;
}

.sample-dropdown.active {
    display: block;
}

.sample-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: background var(--transition-fast);
}

.sample-dropdown-item:hover {
    background: var(--bg-elevated);
}

.sample-dropdown-item i {
    color: var(--text-secondary);
    width: 16px;
    text-align: center;
}

/* CSV Example */
.csv-example {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
}

.csv-example-label {
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.csv-example pre {
    margin: 0;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: var(--text-secondary);
    line-height: 1.4;
}

.csv-example code .header {
    color: var(--accent-blue);
}

.format-compat-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.65rem;
    margin-top: var(--space-xs);
    opacity: 0.6;
    letter-spacing: 0.3px;
}

.format-compat-note i {
    color: var(--accent-blue);
    margin-right: 4px;
}

/* Manual Entry Tab — Desktop two-column */
@media (min-width: 900px) {
    .manual-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-lg);
        align-items: start;
    }

    .manual-layout .manual-right {
        border-left: 1px solid var(--border);
        padding-left: var(--space-lg);
    }

    .manual-layout .manual-right .flights-list {
        max-height: 260px;
        overflow-y: scroll;
    }

    .manual-layout .flight-form {
        margin-bottom: var(--space-md);
    }
}

.flight-form {
    margin-bottom: var(--space-lg);
}

.form-row {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.form-group {
    flex: 1;
}


.form-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25);
}

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

.form-input.iata {
    text-transform: uppercase;
}

.add-flight-btn {
    width: 100%;
    margin-top: var(--space-sm);
}

/* Explainer */
.explainer {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.explainer i {
    color: var(--accent-blue);
    margin-right: var(--space-xs);
}

/* Autocomplete */
.input-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

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

.autocomplete-item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: background var(--transition-fast);
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--bg-elevated);
}

.autocomplete-code {
    font-weight: 600;
    color: var(--accent-blue);
    min-width: 40px;
}

.autocomplete-name {
    color: var(--text-primary);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-country {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-left: auto;
}

/* Flight List */
.flights-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: var(--space-lg);
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) var(--bg-elevated);
}

.flights-list::-webkit-scrollbar {
    width: 8px;
}

.flights-list::-webkit-scrollbar-track {
    background: var(--bg-elevated);
    border-radius: 4px;
}

.flights-list::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}

.flights-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}

.flight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

.flight-route {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.flight-route i {
    color: var(--accent-blue);
    font-size: 0.75rem;
}

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

.flight-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.flight-remove:hover {
    color: var(--accent-red);
}

.flights-empty {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.flights-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--space-sm);
}

.action-buttons .btn {
    flex: 1;
}

/* Demo CTA */
.demo-cta {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.demo-btn {
    position: relative;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
}

.demo-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-full);
    background: var(--accent-blue);
    opacity: 0;
    filter: blur(16px);
    animation: glowPulse 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0; transform: scale(0.95); }
    50% { opacity: 0.35; transform: scale(1.05); }
}


/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-plane {
    font-size: 2rem;
    color: var(--accent-blue);
    animation: flyAcross 1.8s ease-in-out infinite;
}

.loading-text {
    margin-top: var(--space-md);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes flyAcross {
    0% { transform: translateX(-30px) translateY(4px); opacity: 0.4; }
    50% { transform: translateX(30px) translateY(-4px); opacity: 1; }
    100% { transform: translateX(-30px) translateY(4px); opacity: 0.4; }
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

@media (prefers-reduced-motion: reduce) {
    .loading-plane { animation: none; opacity: 1; }
}

/* Mobile */
@media (max-width: 640px) {
    .landing { padding: 68px 16px 24px; }
    .hero-title { font-size: 2rem; }
    .hero-tagline { font-size: 1rem; margin-bottom: 24px; }
    .upload-card { padding: var(--space-md); }
    .demo-cta { flex-direction: column; gap: 8px; }
}

/* Small phone */
@media (max-width: 480px) {
    .page-header { padding: 0 var(--space-sm); }
    .hero-title { font-size: 1.75rem; }
    .form-row { flex-direction: column; gap: var(--space-xs); }
    .hide-mobile { display: none; }
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 10;
    padding: var(--space-lg) var(--space-xl);
    margin-top: var(--space-xl);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.footer-copy {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    gap: var(--space-md);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

@media (max-width: 640px) {
    .footer-content {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
}
