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

html {
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

h1 {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.loading {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    margin: 50px 0;
}

.error {
    background: #ff4757;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
}

.flights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 30px;
    min-height: 600px;
    contain: layout;
}

.flight-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 280px;
    will-change: transform;
}

/* Gradient bar removed per user request */

.flight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.flight-card[onclick]:hover {
    background: #f8f9fa;
}

.flight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.airline {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
}

.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e8449;
}

.route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

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

.city {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.airport {
    font-size: 0.9rem;
    color: #5a6c7d;
    margin-top: 2px;
}

.arrow {
    margin: 0 20px;
    font-size: 1.5rem;
    color: #3498db;
}

.flight-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.8rem;
    color: #5a6c7d;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 2px;
}

.detail-value {
    font-weight: 500;
    color: #2c3e50;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    background: #2874a6;
    color: white;
    font-size: 0.7rem;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: 10px;
}

.badge.deal {
    background: #c0392b;
}

.badge.flexible {
    background: #1e8449;
}

/* Container for weather and beer sections */
.info-sections-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.weather-section {
    padding: 12px;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    border-radius: 8px;
    color: white;
}

.weather-section.compact {
    padding: 10px;
}

/* Cost section styling */
.cost-section {
    padding: 10px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-radius: 8px;
    color: white;
}

.cost-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.cost-title {
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cost-price {
    font-size: 1.1rem;
    font-weight: bold;
}

.cost-details {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 4px;
    text-align: center;
}

.cost-loading {
    font-size: 0.75rem;
    opacity: 0.7;
}

.weather-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.weather-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.weather-temp {
    font-size: 1.2rem;
    font-weight: bold;
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.8rem;
}

.weather-details.compact {
    display: block;
    font-size: 0.7rem;
    line-height: 1.3;
}

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

.weather-loading {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    font-size: 0.8rem;
}

.weather-error {
    color: #ff7675;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .flights-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .flight-details {
        grid-template-columns: 1fr;
    }
}

.refresh-btn {
    display: block;
    margin: 0 auto 30px;
    padding: 12px 24px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.filters-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 1200px;
    min-height: 94px;
    contain: layout style;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}

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

.filter-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.filter-select, .filter-input {
    padding: 10px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #667eea;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-input {
    flex: 1;
    padding: 8px 10px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn.primary {
    background: #667eea;
    color: white;
}

.filter-btn.primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.filter-btn.secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.filter-btn.secondary:hover {
    background: #edf2f7;
}

.results-info {
    text-align: center;
    color: #718096;
    margin: 10px 0;
    font-size: 0.9rem;
}

.config-container {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin: 0 auto 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 1200px;
    position: relative;
    z-index: 1000;
}

.config-container h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3rem;
    text-align: center;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

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

.config-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.config-select, .config-input {
    padding: 12px 14px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    background: white;
}

.config-select:focus, .config-input:focus {
    outline: none;
    border-color: #667eea;
}

.duration-range, .temp-setting {
    display: flex;
    align-items: center;
    gap: 8px;
}

.duration-input, .temp-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    min-width: 60px;
}

.duration-input:focus, .temp-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 100%;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.airport-search-container {
    position: relative;
    z-index: 10000;
}

/* Multi-airport tags styling */
.selected-airports-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 32px;
}

.airport-tag {
    display: inline-flex;
    align-items: center;
    background: #4a5fc4;  /* Even darker blue for WCAG AAA contrast */
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;  /* Bolder text */
    animation: tagAppear 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);  /* Subtle shadow for depth */
}

@keyframes tagAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.airport-tag .airport-code {
    margin-left: 4px;
    color: #ffffff;  /* Pure white for maximum contrast */
    font-size: 13px;  /* Slightly bigger */
    font-weight: 600;  /* Bolder for readability */
}

.airport-tag .remove-btn {
    margin-left: 8px;
    cursor: pointer;
    font-size: 20px;  /* Slightly bigger */
    line-height: 1;
    opacity: 0.9;
    transition: all 0.2s;
    font-weight: bold;
}

.airport-tag .remove-btn:hover {
    opacity: 1;
    transform: scale(1.2);  /* Slight grow on hover */
}

.airport-count {
    font-size: 12px;
    color: #666;
    margin-left: 8px;
}

.airport-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 99999 !important;
    display: none;
}

.airport-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.airport-suggestion:hover {
    background-color: #f8f9fa;
}

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

.airport-name {
    font-weight: 500;
    color: #2c3e50;
}

.airport-code {
    font-size: 0.8rem;
    color: #5a6c7d;
    margin-left: 5px;
}

.airport-country {
    font-size: 0.75rem;
    color: #6c7a89;
    display: block;
    margin-top: 2px;
}

.weather-emoji-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 100%;
}

.weather-emoji-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.weather-emoji-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-1px);
}

.weather-emoji-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.weather-filter-group {
    grid-column: 1 / -1;
}

.filters-compact {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.compact-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 54px;
    justify-content: space-between;
    position: relative;
    width: 100%;
}

/* Labels that show on wider screens */
.filter-label {
    display: none;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 4px;
}

/* Group container for filter items with labels */
.filter-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (min-width: 1200px) {
    .filter-label {
        display: inline-block;
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .filter-label.priority {
        display: inline-block;
    }
}

.compact-controls > * {
    flex-shrink: 0;
}

.separator-line {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 5px;
    flex-shrink: 0;
    align-self: center;
}

.compact-select {
    padding: 6px 10px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    background: white;
    font-size: 0.85rem;
    width: 160px;
    height: 36px;
    box-sizing: border-box;
    font-family: inherit;
}

.compact-select:focus {
    outline: none;
    border-color: #667eea;
}

.price-compact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.price-separator {
    display: inline-block;
    width: 10px;
    text-align: center;
    flex-shrink: 0;
    font-size: 14px;
    line-height: 36px;
    color: #666;
}

.compact-input {
    width: 80px;
    padding: 6px 8px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    height: 36px;
}

.compact-input:focus {
    outline: none;
    border-color: #667eea;
}

.compact-reset {
    padding: 6px;
    background: #f8f9fa;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.compact-reset:hover {
    background: #e9ecef;
    border-color: #667eea;
}

@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        grid-column: 1 / -1;
        justify-content: center;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
}
/* Theme toggle button */
.theme-toggle-btn {
    padding: 6px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-right: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Settings button */
.settings-toggle-btn {
    padding: 6px;
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-right: 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-toggle-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #5a6c7d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

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

.settings-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.settings-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    cursor: pointer;
}

.settings-select:focus {
    outline: none;
    border-color: #667eea;
}
