/* Main styling */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9; /* Changed to a nice blue color */
    --accent-color: #e74c3c;
    --background-color: #f5f7fa;
    --card-color: #ffffff;
    --text-color: #333333;
    --military-color: #e74c3c;
    --button-color: #6c757d; /* New gray color for buttons */
    --altitude-unknown: #333333; /* Black color for unknown altitude */
    
    /* Flight details popup variables */
    --card-bg: #ffffff;
    --card-bg-color: #ffffff;
    --primary-text-color: #333333;
    --secondary-text-color: #666666;
    --text-secondary: #666666;
    --border-color: #dddddd;
    --bg-secondary: #f5f7fa;
    --bg-hover: rgba(0, 0, 0, 0.05);
    --info-color: #2980b9;
    --info-color-hover: #3498db;
    --primary-color-hover: #217dbb;
    
    /* Altitude color scale - same as Discord and ADS-B Exchange */
    --altitude-dark-orange: #f0743e;
    --altitude-light-orange: #f1a340;
    --altitude-dark-yellow: #f0c938;
    --altitude-yellow: #e5d422;
    --altitude-light-green: #9dc12d;
    --altitude-green: #22b22d;
    --altitude-green-blue: #19c0bc;
    --altitude-light-blue: #13b0f2;
    --altitude-dark-blue: #2868a3;
    --altitude-purple: #a416a9;
    --altitude-grey: #3a3a3a;
    
    /* GitHub link colors */
    --github-link-color: #333333;
    --github-link-hover-color: #0366d6;
    
    /* Loading screen colors */
    --loading-title-color: #000000; /* Black color for the loading title */
}

/* Dark mode colors */
[data-theme="dark"] {
    --primary-color: #e0e0e0; /* Changed from light blue to white-ish color */
    --secondary-color: #cccccc; /* Changed from light blue to grey-ish color */
    --accent-color: #ff6b6b;
    --background-color: #121212;
    --card-color: #1e1e1e;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --military-color: #ff5252;
    --button-color: #4a4a4a;
    --altitude-unknown: #888888;
    
    /* Flight details popup variables */
    --card-bg-color: #1e1e1e;
    --primary-text-color: #e0e0e0;
    --secondary-text-color: #aaaaaa;
    --text-secondary: #aaaaaa;
    --border-color: #333333;
    --bg-secondary: #2a2a2a;
    --bg-hover: rgba(255, 255, 255, 0.1);
    --info-color: #58a6ff;
    --info-color-hover: #79b8ff;
    --primary-color-hover: #c0c0c0;
    
    /* GitHub link colors for dark mode */
    --github-link-color: #e0e0e0;
    --github-link-hover-color: #58a6ff;
    
    /* Loading screen colors for dark mode */
    --loading-title-color: #000000; /* Keep it black even in dark mode */
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

[data-theme="dark"] header {
    border-bottom-color: #333;
}

.title-section {
    display: flex;
    align-items: center;
    height: 60px; /* Added fixed height for better vertical alignment */
}

.title-section .theme-toggle {
    margin-right: 15px; /* Increased margin for better spacing */
    margin-left: 0;
}

header h1 {
    color: var(--text-color);
    font-family: var(--title-font);
    font-weight: 600;
    font-size: 2.2rem; /* Increased font size */
    letter-spacing: -0.02em; /* Slight negative letter spacing for a modern look */
    position: relative;
    top: 2px; /* Fine-tune vertical position */
}

[data-theme="dark"] header h1 {
    color: #e0e0e0;
}

/* Adjust status-info for new layout */
.status-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 5px;
}

[data-theme="dark"] .status-info {
    color: #999;
}

/* Refresh indicator styling - more minimal and fits better with the UI */
.refresh-indicator {
    font-size: 0.85rem;
    color: var(--button-color);
    transition: all 0.2s ease;
    cursor: default;
}

.refresh-countdown-container {
    display: inline-block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    font-weight: 500;
}

#nextUpdateCountdown {
    position: relative;
}

#nextUpdateCountdown::before {
    content: "↻";
    display: inline-block;
    margin-right: 4px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

#nextUpdateCountdown.refreshing::before {
    animation: spin 1.2s linear infinite;
}

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

/* Remove old elements */
.last-update, .next-update {
    display: none;
}

/* Dashboard stats */
.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-box {
    flex: 1;
    min-width: 150px;
    background-color: var(--card-color);
    border-radius: 8px;
    padding: 20px;
    margin-right: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-box:last-child {
    margin-right: 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--button-color); /* Changed from primary-color to button-color to match the rest of the design */
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.stat-sublabel {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

/* Clickable stat box styling */
.stat-box.clickable {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.stat-box.clickable::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

[data-theme="dark"] .stat-box.clickable::after {
    background-color: var(--accent-color); /* Changed from orange to red accent color */
}

.stat-box.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.6);
}

.stat-box.clickable:hover::after {
    width: 100%;
}

.stat-box.clickable:hover .stat-value {
    transform: scale(1.05);
}

[data-theme="dark"] .stat-box.clickable:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Active state for filter tiles (Military and Inbound) */
#militaryAircraftStat.active,
#inboundAircraftStat.active {
    position: relative;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

#militaryAircraftStat.active::before,
#inboundAircraftStat.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--secondary-color);
    border-radius: 8px;
    pointer-events: none;
    box-sizing: border-box;
}

[data-theme="dark"] #militaryAircraftStat.active::before,
[data-theme="dark"] #inboundAircraftStat.active::before {
    border-color: var(--accent-color); /* Changed from orange to red accent color */
}

/* Color styling for the inbound and military values */
#inboundAircraftStat .stat-value,
#militaryAircraftStat .stat-value {
    color: var(--button-color); /* Changed to button-color to match Total Aircraft */
    transition: color 0.3s ease;
}

[data-theme="dark"] #inboundAircraftStat .stat-value,
[data-theme="dark"] #militaryAircraftStat .stat-value {
    color: #ffffff; /* White color in dark mode */
}

/* Filter section */
.filter-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
    background-color: var(--card-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter {
    margin-right: 30px;
    display: flex;
    align-items: center;
}

.filter label {
    margin-right: 10px;
    font-size: 0.9rem;
    font-weight: bold;
}

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

/* Status filters styling */
.filter-status {
    display: flex;
    flex-direction: column;
}

.status-filters {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.status-filter-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-filter-item label {
    cursor: pointer;
    font-weight: normal;
    margin-right: 0;
}

.status-filter-item input[type="checkbox"] {
    cursor: pointer;
}

@media (max-width: 768px) {
    .status-filters {
        flex-direction: column;
        gap: 8px;
    }
}

/* Aircraft grid */
.aircraft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.no-aircraft {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 1.2rem;
    color: #666;
}

/* Loading state */
.no-aircraft.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px;
    color: var(--text-color);
    min-height: 300px;
}

/* Scanning animation - replaces the old spinner */
.no-aircraft.scanning {
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.scanning-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
}

.radar-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.radar-circle::before, .radar-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--secondary-color);
    opacity: 0.7;
}

.radar-circle::before {
    width: 70%;
    height: 70%;
}

.radar-circle::after {
    width: 40%;
    height: 40%;
}

.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 2px;
    background-color: var(--secondary-color);
    transform-origin: left center;
    animation: radar-sweep 3s linear infinite;
}

.radar-sweep::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to right, var(--secondary-color), transparent);
}

@keyframes radar-sweep {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.scanning-text {
    text-align: center;
}

.scanning-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--secondary-color);
}

.scanning-subtitle {
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Dark mode adjustments for the scanning animation */
[data-theme="dark"] .radar-circle {
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.3);
}

[data-theme="dark"] .radar-circle::before, 
[data-theme="dark"] .radar-circle::after {
    border-color: var(--accent-color);
}

[data-theme="dark"] .radar-sweep {
    background-color: var(--accent-color);
}

[data-theme="dark"] .radar-sweep::after {
    background: linear-gradient(to right, var(--accent-color), transparent);
}

[data-theme="dark"] .scanning-title {
    color: var(--accent-color);
}

/* Aircraft styling */
.aircraft-card {
    background-color: var(--card-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.aircraft-header {
    background-color: white;
    color: var(--text-color);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid var(--secondary-color); /* Default border color */
    border-bottom: 1px solid #eee;
}

.aircraft-header-left {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.aircraft-header-right {
    display: flex;
    align-items: center;
    margin-left: auto; /* Push to the right */
}

.aircraft-callsign {
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 5px;
}

/* Country flag in header styling */
.aircraft-country {
    display: flex;
    align-items: center;
}

.aircraft-country-flag {
    font-size: 1.5rem; /* Bigger flag */
    display: inline-block;
    line-height: 1;
}

.aircraft-country-flag.military-flag {
    background-color: var(--military-color);
    border-radius: 4px;
    padding: 4px;
    color: white;
    margin-left: 8px;
}

.aircraft-military-badge, .aircraft-approach-badge, .aircraft-ground-badge {
    display: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 8px;
    color: white;
}

.aircraft-military-badge {
    background-color: var(--military-color);
}

.aircraft-approach-badge {
    background-color: #4CAF50; /* Light green color */
}

.aircraft-ground-badge {
    background-color: #757575; /* Grey color */
}

/* Add styles for "on ground" altitude text */
.altitude-on-ground {
    color: #757575; /* Grey color to match the badge */
    font-weight: bold;
}

/* Add styles for on-ground aircraft card */
.is-on-ground .aircraft-header {
    border-left: 5px solid #757575; /* Grey color for on-ground indicator */
}

/* Dark mode adjustment for the approach badge */
[data-theme="dark"] .aircraft-approach-badge {
    background-color: #5cb85c; /* Slightly brighter green for dark mode */
}

.aircraft-image {
    height: 150px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aircraft-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Add specific styling for the fallback image */
.aircraft-image img.fallback-image {
    object-fit: contain;
    padding: 10px;
    max-height: 100%;
    background-color: #f8f8f8;
}

[data-theme="dark"] .aircraft-image img.fallback-image {
    background-color: #2a2a2a;
}

.aircraft-image::after {
    content: "No image available";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
    z-index: -1;
}

.aircraft-info {
    padding: 15px;
}

/* Fix info row styling */
.info-row {
    margin-bottom: 8px;
    display: flex;
}

.info-label {
    font-weight: bold;
    color: #666;
    width: 100px; /* Increased width to prevent overlap */
    flex-shrink: 0;
}

.info-value {
    display: flex;
    align-items: center;
    margin-left: auto; /* Push value to the right */
    text-align: right;
}

/* Give all info values consistent styling, not just those with units */
.aircraft-type, .aircraft-registration, .aircraft-icao, .aircraft-description, .aircraft-country-info {
    margin-left: auto; /* Push to the right */
    text-align: right;
}

/* Aircraft altitude color coding */
.altitude-lt-1000 { color: var(--altitude-dark-orange); }
.altitude-1000-2000 { color: var(--altitude-light-orange); }
.altitude-2000-3000 { color: var(--altitude-dark-yellow); }
.altitude-3000-5000 { color: var(--altitude-yellow); }
.altitude-5000-7000 { color: var(--altitude-light-green); }
.altitude-7000-10000 { color: var(--altitude-green); }
.altitude-10000-15000 { color: var(--altitude-green-blue); }
.altitude-15000-20000 { color: var(--altitude-light-blue); }
.altitude-20000-30000 { color: var(--altitude-dark-blue); }
.altitude-gt-30000 { color: var(--altitude-purple); }

/* Fix spacing for units */
.unit {
    margin-left: 4px;
    color: #666;
    font-size: 0.9em;
}

/* Remove background colors from header and use colored left borders instead */
.aircraft-header-lt-1000 { border-left-color: var(--altitude-dark-orange); }
.aircraft-header-1000-2000 { border-left-color: var(--altitude-light-orange); }
.aircraft-header-2000-3000 { border-left-color: var(--altitude-dark-yellow); }
.aircraft-header-3000-5000 { border-left-color: var(--altitude-yellow); }
.aircraft-header-5000-7000 { border-left-color: var(--altitude-light-green); }
.aircraft-header-7000-10000 { border-left-color: var(--altitude-green); }
.aircraft-header-10000-15000 { border-left-color: var(--altitude-green-blue); }
.aircraft-header-15000-20000 { border-left-color: var(--altitude-light-blue); }
.aircraft-header-20000-30000 { border-left-color: var(--altitude-dark-blue); }
.aircraft-header-gt-30000 { border-left-color: var(--altitude-purple); }
.aircraft-header-unknown { border-left-color: var(--altitude-grey); }

/* Aircraft links */
.aircraft-links {
    padding: 10px 15px; /* Reduce top/bottom padding to make bar smaller */
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px; /* Set a fixed height for consistency */
}

.aircraft-links a {
    text-decoration: none;
    color: white;
    font-weight: bold;
    padding: 12px;
    border-radius: 50%;
    background-color: var(--button-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

/* Style for disabled links */
.aircraft-links a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #999;
    pointer-events: none;
}

[data-theme="dark"] .aircraft-links a.disabled {
    background-color: #444;
    opacity: 0.5;
}

.aircraft-links a:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    background-color: var(--secondary-color); /* Changed to secondary-color (dark blue) for consistency */
}

.aircraft-links a.disabled:hover {
    opacity: 0.5;
    transform: none;
    background-color: #999;
}

[data-theme="dark"] .aircraft-links a.disabled:hover {
    background-color: #444;
}

/* Heading indicator styling */
.heading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 4px; /* Reduced from 8px to 4px to decrease spacing */
    transition: transform 0.3s ease;
}

.heading-indicator svg {
    width: 18px; /* Increased from 16px to 18px */
    height: 18px; /* Increased from 16px to 18px */
    stroke: var(--secondary-color);
    fill: none;
}

[data-theme="dark"] .heading-indicator svg {
    stroke: var(--accent-color);
}

/* Direction indicator styling */
.direction-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--secondary-color); /* Changed to secondary-color (dark blue) in light mode */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.direction-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.direction-indicator svg {
    width: 30px;
    height: 30px;
    stroke: white;
    fill: white;
}

.direction-indicator svg circle {
    fill: none;
    stroke: white;
}

.direction-indicator svg path {
    fill: white;
    stroke: none;
}

/* Styling for the arrow tail */
.direction-indicator svg .arrow-tail {
    fill: none;
    stroke: white;
    stroke-width: 2.5;  /* Slightly thicker than the default stroke */
}

[data-theme="dark"] .direction-indicator {
    background-color: var(--accent-color);
}

/* Aircraft notifications */
.aircraft-notifications {
    display: flex;
    padding: 8px 15px;
    background-color: #f5f5f5;
    justify-content: center;
    gap: 10px;
    border-bottom: 1px solid #eee;
    flex-direction: column;
    align-items: center;
}

.notification-banner {
    width: 100%;
    background-color: #4caf50;
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.notification-icons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.notification-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.notification-discord {
    background-color: #5865F2;
}

.notification-slack {
    background-color: #4A154B;
}

.notification-gotify {
    background-color: #3498db;
}

.notification-ntfy {
    background-color: #FF8300;
}

.notification-terminal {
    background-color: #333333;
}

/* Footer styles */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    background-color: var(--card-color);
    border-top: 1px solid #ddd;
}

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

.version-info {
    color: #888;
    font-size: 0.9rem;
}

[data-theme="dark"] .version-info {
    color: #aaa;
}

/* Add the navigation links for switching between dashboard and config page */
.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.nav-link.active {
    color: var(--secondary-color);
    font-weight: bold;
}

/* Active navigation icon styling */
.nav-link.active svg {
    stroke: var(--secondary-color);
    stroke-width: 2.25; /* Slightly thicker for better visibility */
    transform: scale(1.15);
}

[data-theme="dark"] .nav-link.active svg {
    stroke: var(--accent-color);
}

/* Configuration page styles */
.config-dashboard {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.config-section {
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.config-section h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

[data-theme="dark"] .config-section h2 {
    color: #e0e0e0; /* Changed from primary-color to white-ish color for consistency */
    border-bottom-color: #444;
}

.config-item {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.config-label {
    font-weight: bold;
    color: #666;
    width: 180px;
    flex-shrink: 0;
}

[data-theme="dark"] .config-label {
    color: #aaa;
}

.config-value {
    font-size: 1.1rem;
}

.config-description {
    margin-top: 5px;
    color: #888;
    font-size: 0.9rem;
    flex-basis: 100%;
    margin-left: 180px;
}

[data-theme="dark"] .config-description {
    color: #777;
}

.error-message {
    color: var(--accent-color);
    text-align: center;
    padding: 20px;
    font-weight: bold;
}

/* Notification cards */
.notification-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.notification-card {
    background-color: var(--card-color);
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .notification-card {
    border-color: #444;
}

.notification-card-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f8f8;
}

[data-theme="dark"] .notification-card-header {
    background-color: #2a2a2a;
}

.notification-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 15px;
}

#terminal-card .notification-icon {
    background-color: #333333;
}

#discord-card .notification-icon {
    background-color: #5865F2;
}

#slack-card .notification-icon {
    background-color: #4A154B;
}

#gotify-card .notification-icon {
    background-color: #3498db;
}

#ntfy-card .notification-icon {
    background-color: #FF8300;
}

.notification-name {
    font-weight: bold;
}

.notification-status {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

[data-theme="dark"] .notification-status {
    border-bottom-color: #444;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #ccc;
}

.status-indicator.active {
    background-color: #4caf50;
}

.status-text {
    font-size: 0.9rem;
    color: #666;
}

[data-theme="dark"] .status-text {
    color: #aaa;
}

.notification-config {
    padding: 15px;
}

/* Responsive styles for the configuration page */
@media (max-width: 768px) {
    .config-label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .config-description {
        margin-left: 0;
    }
    
    .notification-cards {
        grid-template-columns: 1fr;
    }
    
    /* Modified: Keep nav-links in row direction on mobile */
    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    /* Make icons more compact on mobile */
    .nav-link {
        padding: 8px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stats {
        flex-direction: column;
    }
    
    .stat-box {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .filter-container {
        flex-direction: column;
    }
    
    .filter {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .aircraft-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark mode specific adjustments */
[data-theme="dark"] .aircraft-header {
    background-color: var(--card-color);
    border-bottom: 1px solid #333;
}

[data-theme="dark"] .aircraft-notifications {
    background-color: #2a2a2a;
    border-bottom: 1px solid #333;
}

[data-theme="dark"] .info-label {
    color: #aaa;
}

[data-theme="dark"] .unit,
[data-theme="dark"] .stat-label,
[data-theme="dark"] .last-update,
[data-theme="dark"] .next-update {
    color: #999;
}

[data-theme="dark"] .stat-value {
    color: #ffffff;
}

[data-theme="dark"] header {
    border-bottom: 1px solid #333;
}

[data-theme="dark"] .aircraft-links {
    border-top: 1px solid #333;
}

[data-theme="dark"] .footer {
    border-top: 1px solid #333;
}

[data-theme="dark"] .filter select,
[data-theme="dark"] .filter input[type="checkbox"] {
    background-color: #2a2a2a;
    color: var(--text-color);
    border: 1px solid #444;
}

/* Theme toggle in footer */
.theme-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-label {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* GitHub link styling */
.github-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--github-link-color);
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.github-link:hover {
    color: var(--github-link-hover-color);
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .github-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.github-icon {
    margin-right: 8px;
    fill: currentColor;
}

[data-theme="dark"] .github-icon,
[data-theme="dark"] .github-link {
    color: #e0e0e0;
}

/* Theme toggle button */
.theme-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.theme-toggle:hover {
    background-color: rgba(128, 128, 128, 0.2);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: var(--secondary-color); /* Changed from currentColor to secondary-color for color swap */
}

[data-theme="dark"] .theme-toggle svg {
    fill: var(--accent-color); /* Changed from orange to red accent color */
}

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

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

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

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

/* Sort direction toggle button */
.sort-direction-toggle {
    display: flex;
    align-items: center;
    background-color: var(--card-color);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 7px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: normal;
    color: var(--text-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sort-direction-toggle:hover {
    background-color: #f5f5f5;
}

[data-theme="dark"] .sort-direction-toggle:hover {
    background-color: #333;
}

.sort-direction-toggle .sort-icon {
    margin-right: 6px;
    font-weight: bold;
}

.sort-direction-toggle.desc .asc-icon {
    display: none;
}

.sort-direction-toggle.asc .desc-icon {
    display: none;
}

[data-theme="dark"] .sort-direction-toggle {
    background-color: #2a2a2a;
    border-color: #444;
}

/* Responsive styles for the sort direction toggle */
@media (max-width: 768px) {
    .sort-direction-toggle {
        width: 100%;
        justify-content: center;
    }
}

/* Map container styles */
.location-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.location-info {
    flex: 1;
    min-width: 250px;
}

.map-container {
    flex: 2;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#location-map {
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: #f5f5f5; /* Light background to make it visible when empty */
    position: relative; /* For absolute positioning of error messages */
    min-height: 300px; /* Ensure a minimum height */
    width: 100%; /* Ensure full width */
}

[data-theme="dark"] #location-map {
    background-color: #2a2a2a; /* Dark background for dark mode */
}

/* Map legend styles */
#map-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 8px;
    background-color: var(--card-color);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.notification-range {
    background-color: rgba(231, 76, 60, 0.7); /* Red with opacity */
    border: 1px solid #e74c3c;
}

.scan-range {
    background-color: rgba(52, 152, 219, 0.4); /* Blue with opacity */
    border: 1px solid #3498db;
}

/* Dark mode adjustments for the map */
[data-theme="dark"] #map-legend {
    background-color: #2a2a2a;
    border: 1px solid #444;
}

/* Responsive styles for the header */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-right {
        margin-top: 15px;
        align-items: flex-start;
    }
    
    .nav-links {
        margin-bottom: 10px;
    }
    
    .status-info {
        align-items: flex-start;
        text-align: left;
    }
}

/* Version badge styling - more professional and subtle */
.version-badge {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    padding: 6px 10px;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.version-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.version-icon {
    margin-right: 6px;
    stroke: #555;
}

.version-text {
    color: #555;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Dark mode version badge */
[data-theme="dark"] .version-badge {
    background-color: #2a2a2a;
    color: #ccc;
    border-color: #444;
}

[data-theme="dark"] .version-icon {
    stroke: #aaa;
}

[data-theme="dark"] .version-text {
    color: #ccc;
}

/* Buy Me a Coffee button styling - less flashy, more integrated with design */
.coffee-link {
    display: flex;
    align-items: center;
    background-color: var(--card-color);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.coffee-link:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.coffee-icon {
    margin-right: 7px;
    stroke: var(--secondary-color);
}

/* Dark mode coffee button */
[data-theme="dark"] .coffee-link {
    background-color: var(--card-color);
    color: var(--text-color);
    border-color: #444;
}

[data-theme="dark"] .coffee-link:hover {
    background-color: #2f2f2f;
    border-color: #555;
}

[data-theme="dark"] .coffee-icon {
    stroke: var(--primary-color);
}

/* N/A value styling */
.value-na {
    color: #999; /* Light grey for N/A values */
    font-style: italic;
}

/* User dropdown styling */
.user-dropdown {
    position: relative;
    margin-left: 15px;
}

.user-button {
    display: flex;
    align-items: center;
    background-color: var(--card-color);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: normal;
    color: var(--text-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-button:hover {
    background-color: #f5f5f5;
}

.user-button svg {
    margin-right: 6px;
}

.dropdown-icon {
    margin-left: 6px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--card-color);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    z-index: 10;
    margin-top: 5px;
    overflow: hidden;
}

/* Show dropdown when active class is present */
.user-dropdown.active .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dropdown-content svg {
    margin-right: 8px;
}

/* Logout button styling - making it more obvious */
.logout-link {
    color: var(--accent-color) !important;
    font-weight: 600;
}

/* Login button styling */
.login-button {
    display: flex;
    align-items: center;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: none;
    margin-left: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.login-button:hover {
    background-color: #245580;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.login-button svg {
    margin-right: 5px;
}

/* Dark mode styles */
[data-theme="dark"] .user-button {
    background-color: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .user-button:hover {
    background-color: #333;
}

[data-theme="dark"] .dropdown-content {
    background-color: #2a2a2a;
    border: 1px solid #444;
}

[data-theme="dark"] .dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .login-button {
    background-color: var(--accent-color);
}

[data-theme="dark"] .login-button:hover {
    background-color: #c0392b;
}

/* Responsive styles for the user dropdown */
@media (max-width: 768px) {
    .user-dropdown {
        margin-top: 10px;
    }
    
    .dropdown-content {
        width: 100%;
    }
    
    .login-button {
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
}

/* Flight details popup */
.flight-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.flight-details-overlay.active {
    display: flex;
}

.flight-details-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    z-index: 2001;
    animation: popup-fade-in 0.25s ease-out;
    padding: 0;
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.flight-details-popup.active {
    display: flex;
}

.flight-details-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--card-bg);
    z-index: 10;
    border-radius: 12px 12px 0 0;
}

.flight-details-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.flight-details-title .callsign {
    font-weight: 700;
    margin-left: 8px;
}

.flight-details-title .aircraft-type {
    font-size: 0.9rem;
    font-weight: 400;
    margin-left: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.flight-details-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 1.5rem;
}

.flight-details-close:hover {
    background-color: var(--bg-hover);
    color: var(--text-color);
}

.flight-details-route {
    padding: 24px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.flight-route-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100px;
    position: relative;
}

.route-airport {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 30%; /* Increase width from 25% to 30% for more space for airport names */
    position: relative;
    z-index: 2;
}

.airport-code {
    font-weight: 700;
    font-size: 1.7rem;
    color: var(--text-color);
    letter-spacing: 1px;
}

.airport-name {
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-secondary);
    max-width: 100%;
    padding: 0 4px;
    /* Remove white-space, overflow, and text-overflow properties to allow multi-line text */
    white-space: normal;
    overflow: visible;
    /* Add a max height with a subtle fade */
    max-height: 2.6em;
    line-height: 1.3;
}

.airport-city {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-align: center;
}

.route-line {
    flex-grow: 1;
    position: relative;
    height: 3px;
    background-color: var(--border-color);
    margin: 0 10px; /* Reduce margins from 15px to 10px */
    z-index: 1;
}

.route-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: 1.5px;
}

.flight-info-badge {
    position: absolute;
    bottom: -34px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .flight-info-badge {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.flight-info-badge svg {
    width: 14px;
    height: 14px;
}

.route-aircraft {
    position: absolute;
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%) rotate(90deg);
    z-index: 2;
    width: 30px;
    height: 30px;
    background-color: var(--card-bg);
    border: 2px solid var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.route-aircraft svg {
    width: 18px;
    height: 18px;
    fill: var(--secondary-color);
    stroke: none;
}

[data-theme="dark"] .route-aircraft {
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .route-aircraft svg {
    fill: var(--accent-color);
}

.flight-details-content {
    padding: 30px 24px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.flight-details-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 8px;
    background-color: var(--card-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flight-details-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .flight-details-section {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .flight-details-section:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.flight-details-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flight-details-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.flight-details-subvalue {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.flight-details-airline,
.flight-details-distance,
.flight-details-flight,
.flight-details-registration {
    grid-column: span 1;
}

.flight-details-aircraft {
    grid-column: span 2;
}

.flight-details-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 16px;
}

.flight-details-actions .action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.track-aircraft-button {
    background-color: var(--secondary-color);
    color: white;
}

.track-aircraft-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: var(--primary-color-hover);
}

.view-image-button {
    background-color: var(--card-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.view-image-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--bg-secondary);
}

.action-button.disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

[data-theme="dark"] .track-aircraft-button {
    background-color: var(--accent-color);
}

[data-theme="dark"] .track-aircraft-button:hover {
    background-color: #c0392b;
}

.country-flag {
    font-size: 1.2rem;
    margin-right: 6px;
    position: relative;
    top: 1px;
    display: inline-block;
    filter: drop-shadow(0px 1px 1px rgba(0, 0, 0, 0.2));
}

.airport-flag {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 4px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));
}

@media (max-width: 768px) {
    .flight-details-title .aircraft-type {
        display: none;
    }
    
    .flight-details-content {
        grid-template-columns: 1fr;
    }
    
    .flight-details-airline,
    .flight-details-aircraft,
    .flight-details-registration,
    .flight-details-distance,
    .flight-details-flight {
        grid-column: span 1;
    }
    
    .flight-details-actions {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
        justify-content: center;
    }
    
    .airport-name {
        max-width: 100px;
    }
    
    .airport-code {
        font-size: 1.4rem;
    }
}
