/* Import Open Sans font */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');

/* Global Styles */
body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 20px;
    background: #f0f8ff; /* Light blue background */
    color: #333; /* Dark text color for readability */
}

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

/* Header Styles */
.header {
    position: relative;
    text-align: center;
    padding: 20px 0;
    margin-bottom: 40px;
}

.logo {
    width: 300px;
    margin: 0 auto 20px;
    display: block;
}

.header::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2c3e50, transparent);
    margin-top: 20px;
}

/* Title Styles */
h1 {
    text-align: center;
    color: #2c3e50;
    margin: 20px 0;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Airport Grid */
.airport-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Airport Card */
.airport-card {
    position: relative;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.airport-card:hover {
    transform: translateY(-5px);
    background-color: #f8f9fa;
}

/* Airport Icon */
.airport-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
}

/* Statistics */
.stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    font-size: 0.9em;
    color: #666;
}

.stat-row {
    display: flex;
    align-items: center;
    margin: 8px 0;
    gap: 10px;
}

.stat-icon {
    width: 20px;
    height: 20px;
    fill: #2c3e50;
    flex-shrink: 0;
}

.stat-row span:first-of-type {
    font-weight: bold;
    color: #2c3e50;
    min-width: 100px;
}

.stat-row span:last-of-type {
    color: #34495e;
}

/* Flying Plane Animation */
.animate-plane {
    animation: fly 20s linear infinite;
    position: absolute;
    top: 50px;
    left: 0;
}

@keyframes fly {
    0% {
        transform: translateX(-100%) translateY(0);
    }
    100% {
        transform: translateX(400%) translateY(-100px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .airport-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .logo {
        width: 200px;
    }
}

/* Filter Styles */
.filters {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-group {
    margin: 10px 0;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: bold;
    min-width: 100px;
}

.filter-group select, .filter-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
}

/* Search and Results Info */
#search {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.results-info {
    margin: 10px 0;
    font-style: italic;
    color: #666;
}

/* IATA Code Tag */
.iata-code {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #2c3e50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
    font-size: 1.1em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Sources styling */
.sources-row {
    position: relative;
    cursor: pointer;
}

.sources-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-right: 4px;
    position: relative;
    top: -1px;
}

.sources-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 200px;
    max-width: 300px;
}

.sources-row:hover .sources-popup {
    display: block;
}

.sources-popup span {
    color: #666;
    font-style: italic;
    padding: 4px 0;
    font-size: 0.9em;
    display: block;
}

.sources-popup a {
    display: block;
    color: #0066cc;
    text-decoration: none;
    padding: 4px 0;
    font-size: 0.9em;
    word-break: break-all;
}

.sources-popup a:hover {
    text-decoration: underline;
}

.sources-row:hover .sources-icon {
    color: #2c3e50;
}

/* Lazy loading styles */
.airport-card.lazy {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.airport-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not([disabled]) {
    background: #f0f0f0;
}

.pagination button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    color: #666;
}

#svg-sprites {
    position: absolute;
    width: 0;
    height: 0;
    visibility: hidden;
}