:root {
    --united-blue: #0c2340;
    --united-globe-blue: #0c64d6;
    --united-gold: #FFC629;
    --light-gray: #f8fafc;
    --medium-gray: #e2e8f0;
    --dark-gray: #475569;
    --success-green: #10b981;
    --error-red: #ef4444;
    --border-radius: 12px;
    --box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'SF Pro Display', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: #f0f5fa url('https://images.unsplash.com/photo-1569154941061-e231b4725ef1?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80') no-repeat fixed center;
    background-size: cover;
    color: #1e293b;
    line-height: 1.6;
    padding: 30px 20px;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: -1;
}

.container {
    max-width: 950px;
    margin: 0 auto;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    position: relative;
}

header {
    background: var(--united-blue);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

h1 {
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    font-size: 2.4rem;
}

h1 i {
    margin-right: 10px;
    color: var(--united-gold);
}

.tagline {
    font-weight: 300;
    font-size: 1.2rem;
    opacity: 0.85;
}

.search-panel {
    padding: 40px 30px;
    background: var(--light-gray);
    border-bottom: 1px solid var(--medium-gray);
}

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

label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-gray);
    font-size: 1rem;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background-color: white;
}

input:focus {
    outline: none;
    border-color: var(--united-globe-blue);
    box-shadow: 0 0 0 3px rgba(12, 100, 214, 0.15);
}

.btn-search {
    background: var(--united-globe-blue);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(12, 100, 214, 0.25);
}

.btn-search i {
    margin-left: 12px;
}

.btn-search:hover {
    background: #0a56b8;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(12, 100, 214, 0.3);
}

.btn-search:active {
    transform: translateY(0);
}

.hidden {
    display: none;
}

.fade-transition {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s cubic-bezier(0.33, 1, 0.68, 1), 
                transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: opacity, transform;
}

.fade-out {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

#loading, #results, #error {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.33, 1, 0.68, 1), 
                transform 0.7s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: opacity, transform;
}

#loading.visible, #results.visible, #error.visible {
    opacity: 1;
    transform: translateY(0);
}

#loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(12, 100, 214, 0.1);
    border-radius: 50%;
    border-top-color: var(--united-globe-blue);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#results {
    padding: 10px 30px 40px;
}

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

.result-header h2 {
    font-weight: 700;
    color: var(--united-blue);
    font-size: 1.8rem;
}

.flight-status {
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.flight-status.on-time {
    background: #ecfdf5;
    color: #059669;
}

.flight-status.delayed {
    background: #fef3c7;
    color: #d97706;
}

.flight-status.cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.flight-status.scheduled {
    background: #e0f2fe;
    color: #0284c7;
}

.flight-details {
    background: white;
    border-radius: var(--border-radius);
    padding: 5px 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.route-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
    position: relative;
    padding: 20px;
}

.departure, .arrival {
    flex: 1;
    text-align: center;
}

h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    color: var(--united-blue);
}

.departure p, .arrival p {
    color: var(--dark-gray);
    font-size: 1.05rem;
}

.airport-details {
    margin-bottom: 10px;
    min-height: 80px;
}

.airport-name {
    font-weight: 600;
    font-size: 0.95rem !important;
    color: var(--united-globe-blue) !important;
    margin-bottom: 3px;
}

.airport-location {
    font-size: 0.9rem !important;
    margin-bottom: 2px;
}

.airport-timezone {
    font-size: 0.8rem !important;
    color: var(--dark-gray);
    opacity: 0.8;
}

.flight-path {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 30px; /* Increase horizontal padding to keep line further from data */
}

.flight-path::before {
    content: "";
    position: absolute;
    top: 30px; /* Position exactly at the center of the aircraft icon */
    left: 0;
    right: 0;
    height: 2px;
    background: var(--medium-gray);
    z-index: 1;
}

.aircraft-icon {
    background: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--united-globe-blue);
    margin-bottom: 14px;
    z-index: 2;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.aircraft-icon i {
    color: var(--united-globe-blue);
    font-size: 24px;
}

.flight-number {
    font-weight: 600;
    color: var(--dark-gray);
    background: white;
    padding: 3px 12px;
    z-index: 2;
    font-size: 1.1rem;
}

.aircraft-info {
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 20px 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

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

.interior-result {
    text-align: center;
    padding: 28px 24px;
    border-radius: var(--border-radius);
    margin-top: 30px;
    position: relative;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent; /* Default transparent border */
}

.interior-status {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.interior-status::after {
    content: "";
    display: inline-block;
    margin-left: 8px;
    opacity: 0;
    transition: var(--transition);
}

.interior-message {
    font-size: 17px;
    line-height: 1.7;
}

.next-interior {
    background: #e6faf1;
    border: 2px solid #16a34a;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.next-interior .interior-status {
    color: #16a34a;
}

.standard-interior {
    background: #f1f5f1;
    border: 2px solid #64748b;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.standard-interior .interior-status {
    color: #64748b;
}

.polaris-interior {
    background: #e3f3e6;
    border: 2px solid #15803d;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.polaris-interior .interior-status {
    color: #15803d;
}

.wifi-result {
    text-align: center;
    padding: 28px 24px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    position: relative;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.wifi-header {
    text-align: center;
    margin-top: 30px;
    margin-bottom: -20px;
    position: relative;
    z-index: 2;
}

.wifi-info {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wifi-icon {
    color: #16a34a;
    font-size: 20px;
    margin-right: 8px;
}

#wifi-status-text {
    color: #16a34a;
    font-weight: 600;
    font-size: 18px;
}

.wifi-status {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}

.wifi-message {
    font-size: 17px;
    line-height: 1.7;
}

.starlink-wifi {
    background: #e0f2ff;
    border: 2px solid #0284c7;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.starlink-wifi .wifi-status {
    color: #0284c7;
}

.standard-wifi {
    background: #f1f1f1;
    border: 2px solid #64748b;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.standard-wifi .wifi-status {
    color: #64748b;
}

#error {
    text-align: center;
    padding: 40px 30px;
    color: var(--error-red);
}

#error i {
    font-size: 46px;
    margin-bottom: 18px;
}

#error p {
    font-size: 17px;
    max-width: 400px;
    margin: 0 auto;
}

footer {
    padding: 18px 30px;
    background: var(--united-blue);
    color: white;
    text-align: center;
    font-size: 14px;
    opacity: 0.9;
}

.flight-tracking {
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 20px 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.tracking-title {
    color: var(--united-blue);
    font-size: 1.4rem;
    margin-bottom: 15px;
    text-align: center;
}

.tracking-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.tracking-info .info-item {
    flex: 1;
    min-width: 200px;
    background: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 0;
}

#flight-map-container {
    height: 350px;
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#flight-map {
    height: 100%;
    width: 100%;
    background-color: #e9eef2;
}

.staggered-fade {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.8s cubic-bezier(0.215, 0.61, 0.355, 1), 
                transform 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: opacity, transform;
    backface-visibility: hidden;
}

.results-visible .staggered-fade {
    opacity: 1;
    transform: translateY(0);
}

.results-visible .route-info {
    transition-delay: 0.15s;
}

.results-visible .aircraft-info {
    transition-delay: 0.3s;
}

.results-visible #wifi-info {
    transition-delay: 0.45s;
}

.results-visible #interior-result {
    transition-delay: 0.6s;
}

.results-visible #flight-tracking {
    transition-delay: 0.75s;
}

/* Add subtle entrance animation for form fields */
@keyframes subtle-entrance {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group:nth-child(1) {
    animation: subtle-entrance 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) 0.1s both;
}

.form-group:nth-child(2) {
    animation: subtle-entrance 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) 0.25s both;
}

.btn-search {
    animation: subtle-entrance 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) 0.4s both;
}

@media (max-width: 768px) {
    /* General container adjustments */
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: var(--border-radius);
    }
    
    /* Header adjustments */
    header {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    /* Form adjustments */
    .search-panel {
        padding: 25px 20px;
    }
    
    /* Results adjustments */
    #results {
        padding: 10px 20px 30px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .result-header h2 {
        font-size: 1.5rem;
    }
    
    /* Flight route display adjustments */
    .route-info {
        flex-direction: column;
        gap: 25px;
        padding: 15px 10px;
        position: relative;
    }
    
    .departure, .arrival {
        width: 100%;
        position: relative;
        z-index: 2;
    }
    
    .flight-path {
        order: 0;  /* Change from -1 to 0 to maintain proper order */
        margin: 20px 0;
        padding: 15px 0;
        position: relative;
        z-index: 1;
    }
    
    /* Remove the connecting line on mobile */
    .flight-path::before {
        display: none;  /* Hide the connecting line */
    }
    
    /* Custom order for mobile to ensure plane appears between airports */
    .route-info {
        display: flex;
        flex-direction: column;
    }
    
    .route-info .departure {
        order: 1;
    }
    
    .route-info .flight-path {
        order: 2;
    }
    
    .route-info .arrival {
        order: 3;
    }
    
    .airport-details {
        min-height: auto;
    }
    
    /* Interior and WiFi info adjustments */
    .interior-status, .wifi-status {
        font-size: 22px;
    }
    
    .interior-message {
        font-size: 15px;
    }
    
    /* Tracking information */
    .tracking-info {
        flex-direction: column;
    }
    
    .tracking-info .info-item {
        min-width: 100%;
    }
    
    #flight-map-container {
        height: 250px;
    }
    
    /* Info items adjustment */
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Button adjustment */
    .btn-search {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* Extra small devices adjustments */
    h1 {
        font-size: 1.6rem;
    }
    
    #loading {
        padding: 40px 15px;
    }
    
    .departure h3, .arrival h3 {
        font-size: 24px;
    }
    
    .interior-status, .wifi-status {
        font-size: 20px;
    }
    
    .interior-message {
        font-size: 14px;
    }
    
    /* Smaller spinner */
    .spinner {
        width: 50px;
        height: 50px;
    }
    
    /* Adjust wifi status text */
    #wifi-status-text {
        font-size: 16px;
    }
    
    /* Make flight status labels more compact */
    .flight-status {
        padding: 4px 12px;
        font-size: 0.8rem;
    }
    
    /* Fix map height */
    #flight-map-container {
        height: 200px;
    }
}