/* /assets/css/style.css */

:root {
    --bg-color: #0d1a26;
    --card-bg-color: #1c2938;
    --border-color: #3a4a5b;
    --primary-text-color: #e0e0e0;
    --secondary-text-color: #9cb3c9;
    --accent-color: #00e5ff;
    --favorite-color: #ffd700;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color);
    font-family: var(--font-ui);
    color: var(--primary-text-color);
    padding-bottom: 0; /* Remove extra padding */
}
.view {
    width: 100%;
    height: 100%;
    display: none;
}
.view.active {
    display: block;
}

/* --- Bottom Mobile App Download Banner --- */
.mobile-app-banner-bottom {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.mobile-app-banner-bottom.hidden {
    transform: translateY(100%);
}

.mobile-app-banner-bottom:not(.hidden) {
    transform: translateY(0);
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1800px;
    margin: 0 auto;
    gap: 20px;
}

.banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
}

.banner-icon {
    font-size: 18px;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.download-btn {
    display: inline-block;
    transition: transform 0.2s ease;
}

.download-btn:hover {
    transform: scale(1.05);
}

.download-btn img {
    height: 32px;
    width: auto;
}

.close-banner-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.close-banner-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .mobile-app-banner-bottom {
        padding: 10px 15px;
    }
    
    .banner-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .banner-text {
        font-size: 13px;
        flex: 1;
        min-width: 200px;
    }
    
    .banner-actions {
        gap: 8px;
    }
    
    .download-btn img {
        height: 28px;
    }
}

@media (max-width: 480px) {
    .banner-text {
        font-size: 12px;
        min-width: 150px;
    }
    
    .download-btn img {
        height: 24px;
    }
}

/* --- Floating App Download Button --- */
.floating-app-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Adjust floating button when bottom banner is visible */
body.has-bottom-banner .floating-app-btn {
    bottom: 80px;
}

.floating-app-btn.hidden {
    display: none;
}

.floating-btn-main {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    text-decoration: none;
    color: inherit;
}

.floating-btn-main:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: #1e3c72;
}

.floating-btn-main:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s ease;
}

/* Floating menu styles removed - direct redirect implemented */

.floating-download-link img {
    height: 24px;
    width: auto;
}

/* Mobile adjustments for floating button */
@media (max-width: 768px) {
    .floating-app-btn {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-btn-main {
        width: 54px;
        height: 54px;
        padding: 4px;
    }
    
    .floating-btn-main img {
        width: 32px;
        height: 32px;
    }
    
    /* Floating menu styles removed */
}

/* --- ATIS View Styles --- */
#atis-view .main-container { max-width: 1800px; margin: 0 auto; padding: 20px 20px 8px 20px; box-sizing: border-box; padding-bottom: 24px; }
#atis-view .app-header { display: flex; flex-direction: column; gap: 20px; margin-bottom: 30px; }
#atis-view .top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: transparent;
    border-bottom: none;
    gap: 15px;
}
#atis-view .logo { font-size: 24px; font-weight: 700; }
#atis-view .logo span { color: var(--accent-color); }
#atis-view .header-actions { display: flex; align-items: center; gap: 20px; }
#atis-view .search-bar {
    flex-grow: 1;
    max-width: 500px; /* 검색창 최대 너비 설정 */
}

#atis-search-input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-color);
    color: var(--primary-text-color);
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box; /* Add this line to fix width calculation */
}

#atis-search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.icon-group {
    display: flex;
    gap: 8px; /* Adjust the gap between icons */
}

#atis-view .icon-button { background: none; border: none; color: var(--secondary-text-color); cursor: pointer; padding: 5px; }
#atis-view .icon-button svg { width: 28px; height: 28px; fill: currentcolor; transition: color 0.2s, transform 0.5s ease-in-out; }
#atis-view .icon-button:hover svg { color: var(--accent-color); }
#atis-view .navigation-bar { display: flex; align-items: center; gap: 10px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; -ms-overflow-style: none;}
#atis-view .navigation-bar::-webkit-scrollbar { display: none; }
#atis-view .nav-button { padding: 8px 16px; border-radius: 8px; color: var(--secondary-text-color); background-color: var(--card-bg-color); font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer; border: 1px solid transparent; display: flex; align-items: center; transition: all 0.2s ease-in-out; }
#atis-view .nav-button.active { color: #fff; background-color: var(--accent-color); }
#atis-view .nav-button svg { width: 16px; height: 16px; margin-right: 8px; fill: currentcolor; }
#atis-view .content-area { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); transition: opacity 0.3s ease-in-out; }
#atis-view .content-area.refreshing {
    opacity: 0.5;
    pointer-events: none; /* Prevent clicking while refreshing */
}
#card-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
    grid-column: 1 / -1; /* Make it span all columns in the grid */
}
.plane-orbit {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: orbit-spin 1.5s linear infinite;
}
.orbit-circle {
    position: absolute;
    top: 0; left: 0;
    width: 90px; height: 90px;
    z-index: 1;
}
.orbit-plane {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    transform-origin: left center;
    z-index: 2;
}
@keyframes orbit-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#loading-airplane-icon {
    animation: spin 1.5s linear infinite;
    fill: var(--accent-color); /* Use accent color for better visibility */
}
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
#atis-view .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
}
#atis-view .section-title { 
    font-size: 18px; 
    font-weight: 700; 
    color: var(--accent-color); 
    margin: 0;
}
.sort-container-wrapper {
    display: flex;
    gap: 8px;
}
.sort-button {
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--secondary-text-color);
    background-color: var(--card-bg-color);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease-in-out;
}
.sort-button.active, .sort-button:hover {
    color: #fff;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}
#sort-container-mobile {
    display: none; /* Hide mobile sorter on desktop */
}

/* Custom Select Dropdown for Mobile */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
}
.custom-select-btn {
    background: var(--card-bg-color);
    color: var(--primary-text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12px;
    min-width: 90px;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
    
    /* Flexbox for alignment */
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#mobile-sort-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 5px; /* Add a small gap between text and arrow */
}
.custom-select-arrow {
    font-size: 10px;
    color: var(--secondary-text-color);
}
.custom-select-list {
    position: absolute;
    top: 110%;
    right: 0;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 0;
    padding: 5px;
    list-style: none;
    z-index: 100;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    min-width: 120px;
}
.custom-select-list li {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--primary-text-color);
    transition: background 0.2s;
    border-radius: 6px;
}
.custom-select-list li:hover {
    background: var(--accent-color);
    color: #000;
}
.custom-select-list li.selected {
    background: var(--accent-color);
    color: #000;
    font-weight: 700;
}

/* New container for cards */
#atis-card-container {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    transition: opacity 0.3s ease-in-out;
}
#atis-view .atis-card { background-color: var(--card-bg-color); border-radius: 12px; border: 1px solid var(--border-color); padding: 20px; display: flex; flex-direction: column; transition: opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
#atis-view .atis-card.is-fresh { border-color: var(--accent-color); box-shadow: 0 0 15px rgba(0, 229, 255, 0.2); }
#atis-view .atis-card.is-outdated { opacity: 0.7; }
#atis-view .atis-card.is-outdated:hover { opacity: 1; }
#atis-view .card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
#atis-view .airport-info { display: flex; align-items: center; gap: 12px; }
#atis-view .flag-icon { font-size: 24px; }
#atis-view .airport-details .code { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px;}
#atis-view .live-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-color);
  animation: pulse-glow 1.2s linear infinite;
}

@keyframes pulse-glow {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0px rgba(0,229,255,0.7);
  }
  40% {
    transform: scale(1.08);
    box-shadow: 0 0 16px 7px rgba(0,229,255,0.18);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 24px 10px rgba(0,229,255,0.0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0px rgba(0,229,255,0.0);
  }
}
#atis-view .airport-details .name { font-size: 14px; color: var(--secondary-text-color); }
#atis-view .favorite-toggle { cursor: pointer; }
#atis-view .favorite-toggle svg { width: 24px; height: 24px; stroke: var(--secondary-text-color); stroke-width: 1.5; fill: none; transition: all 0.2s ease-in-out; }
#atis-view .favorite-toggle.favorited svg { stroke: var(--favorite-color); fill: var(--favorite-color); }
#atis-view .content-toggle { display: flex; background-color: var(--bg-color); border-radius: 8px; padding: 4px; margin-bottom: 15px; }
#atis-view .toggle-btn { flex: 1; padding: 8px; text-align: center; background-color: transparent; border: none; color: var(--secondary-text-color); font-weight: 700; border-radius: 6px; cursor: pointer; transition: all 0.2s ease-in-out; }
#atis-view .toggle-btn.active { background-color: var(--border-color); color: var(--primary-text-color); }
#atis-view .toggle-btn:disabled {
    color: #555; /* Dark gray text */
    cursor: not-allowed;
    background-color: transparent; /* Ensure no other background is active */
}
/* ATIS 타입 토글 (ARR/DEP) - WX 탭 RAW/DECODED 스타일과 통일 */
#atis-view .atis-type-toggle { display: flex; gap: 2px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 1px; margin-bottom: 8px; margin-left: auto; width: fit-content; }
#atis-view .atis-type-btn { padding: 4px 8px; background: transparent; border: none; color: var(--secondary-text-color); font-weight: 700; font-size: 11px; border-radius: 6px; cursor: pointer; transition: all 0.2s ease-in-out; }
#atis-view .atis-type-btn.active { background: var(--border-color); color: var(--primary-text-color); }
#atis-view .atis-type-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#atis-view .content-pane { display: none; }
#atis-view .content-pane.active { display: block; }
#atis-view .content-pane .text-line { font-family: var(--font-mono); font-size: 14px; color: var(--primary-text-color); line-height: 1.7; display: block; min-height: 1em; }
#atis-view .is-stale .atis-content .text-line { text-decoration: line-through; text-decoration-color: var(--secondary-text-color); }
#atis-view .wx-content .wx-title { font-weight: 700; color: var(--accent-color); margin-top: 10px; margin-bottom: 5px; }
#atis-view .wx-content .metar-title { color: var(--accent-color); font-weight: 700; }
#atis-view .wx-content .wx-title:first-child { margin-top: 0; }
/* METAR Raw/Decoded toggle next to title */
#atis-view .wx-content .wx-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#atis-view .metar-mode-toggle { display: inline-flex; gap: 2px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 1px; }
#atis-view .metar-toggle-btn { padding: 4px 8px; background: transparent; border: none; color: var(--secondary-text-color); font-weight: 700; font-size: 11px; border-radius: 6px; cursor: pointer; transition: all 0.2s ease-in-out; }
#atis-view .metar-toggle-btn.active { background: var(--border-color); color: var(--primary-text-color); }
#atis-view .metar-body { margin-top: 4px; }
/* Reuse same style for TAF toggle */
#atis-view .taf-body { margin-top: 4px; }
#atis-view .taf-toggle-btn { padding: 4px 8px; background: transparent; border: none; color: var(--secondary-text-color); font-weight: 700; font-size: 11px; border-radius: 6px; cursor: pointer; transition: all 0.2s ease-in-out; }
#atis-view .taf-toggle-btn.active { background: var(--border-color); color: var(--primary-text-color); }

/* Decoded label color for METAR */
#atis-view .wx-content .decoded-body .wx-label {
  color: #7ecbff; /* fallback lighter accent */
  color: color-mix(in srgb, var(--accent-color) 70%, white 30%);
  font-weight: 700;
  margin-right: 6px;
}

/* TAF section headings (Forecast/Becoming/Temporary/From) */
#atis-view .wx-content .taf-title { color: var(--accent-color); font-weight: 700; }
#atis-view .card-footer { margin-top: auto; padding-top: 15px; }
#atis-view .footer-content { display: flex; justify-content: space-between; align-items: center; }
#atis-view .footer-icons { display: flex; gap: 8px; }
#atis-view .footer-icons .icon-button { font-size: 20px; padding: 0; line-height: 1; }
#atis-view .ago-time { font-size: 12px; font-family: var(--font-mono); color: var(--secondary-text-color); }
#atis-view .navigation-bar.sub-nav {
    margin-top: -10px; /* 메인 네비게이션과의 간격 조정 */
    padding-left: 10px;
}
#atis-view .sub-nav .nav-button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    font-size: 13px;
    padding: 6px 12px;
}
#atis-view .sub-nav .nav-button.active {
    background-color: var(--border-color);
    color: var(--primary-text-color);
}
#atis-view .atis-card.hidden-by-filter {
    display: none;
}
/* --- Weather Popup Styles --- */
.weather-popup {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000; opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.weather-popup:not(.hidden) {
    opacity: 1; visibility: visible;
}
.weather-content {
    background: var(--card-bg-color); padding: 20px;
    border-radius: 12px; border: 1px solid var(--border-color);
    width: 90%; max-width: 800px; position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transform: scale(0.95); transition: transform 0.3s;
}
.weather-popup:not(.hidden) .weather-content {
    transform: scale(1);
}
.close-popup {
    position: absolute; top: 10px; right: 15px;
    background: transparent; border: none; font-size: 24px;
    color: var(--secondary-text-color); cursor: pointer; line-height: 1;
}
.close-popup:hover { color: var(--primary-text-color); }
#popup-title { margin: 0 0 15px 0; text-align: center; font-size: 18px; color: var(--primary-text-color); }
#weather-forecast-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 15px; }
.weather-slot { background-color: var(--bg-color); border-radius: 8px; padding: 10px; text-align: center; }
.weather-slot .time { font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.weather-slot .temp { font-size: 16px; font-weight: 500; margin-top: 5px; }
.weather-slot lottie-player { width: 50px !important; height: 50px !important; margin: 0 auto; }
#weather-forecast-footer { text-align: right; font-size: 11px; color: var(--secondary-text-color); margin-top: 15px; }
.hidden { display: none !important; }

/* --- Map View Styles --- */
#map-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
}
#map {
    width: 100%;
    height: 100%;
    min-height: 600px;
    position: relative;
}
#map-header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(26, 26, 26, 0.7);
    padding: 8px 15px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}
#map-header .logo {
    font-size: 1.6em;
    font-weight: 700;
    color: #ffffff;
    cursor: default;
}
#map-header .logo span {
    color: #7ecbff;
}

.map-back-button {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background-color: rgba(45, 55, 71, 0.8);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.map-back-button:hover {
    background-color: rgba(65, 75, 91, 0.9);
}

.map-back-button svg {
    fill: var(--accent-color);
}

#map-logo { position: absolute; top: 20px; left: 20px; z-index: 1001; font-size: 24px; font-weight: 700; cursor: pointer; color: white; text-shadow: 0 0 5px black;}
#map-logo span { color: var(--accent-color); }
#control-panel { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(30, 30, 30, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 15px 25px; border-radius: 15px; border: 1px solid rgba(255, 255, 255, 0.1); color: white; z-index: 1000; display: flex; flex-direction: column; align-items: center; width: 350px; box-sizing: border-box;}
#control-panel #time-label { margin-bottom: 10px; font-size: 16px; font-weight: 700; }
#control-panel #timeline { width: 100%; margin: 5px 0; }
#control-panel .button-group { display: flex; gap: 10px; margin-top: 12px; }
#control-panel button { padding: 8px 15px; background: #00c3ff; border: none; border-radius: 8px; color: white; cursor: pointer; font-weight: 700; font-size: 14px; }
#control-panel button:disabled { background: #555; cursor: not-allowed; }
#location-button { position: absolute; bottom: 30px; right: 20px; z-index: 1000; width: 40px; height: 40px; border-radius: 50%; background-color: rgba(0,0,0,0.6); border: 2px solid white; color: white; font-size: 24px; line-height: 36px; text-align: center; cursor: pointer; }

/* Adjust maplibre controls to not overlap with our header */
.maplibregl-ctrl-top-right {
    top: 80px !important;
}

/* Airport marker popup styles */
.airport-popup {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    max-width: 300px;
    color: white;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.airport-popup h3 {
    margin: 0 0 10px 0;
    color: #00d4ff;
    font-size: 16px;
    font-weight: 600;
}

.airport-popup .airport-info {
    margin-bottom: 15px;
    font-size: 14px;
}

.airport-popup .airport-info span {
    color: #ccc;
}

.airport-popup .info-toggle {
    display: flex;
    gap: 5px;
    margin: 15px 0;
}

.airport-popup .toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #ccc;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
}

.airport-popup .toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.airport-popup .toggle-btn.active {
    background: #00d4ff;
    color: black;
    border-color: #00d4ff;
}

.airport-popup .info-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.airport-popup .info-content.active {
    display: block;
}

.airport-popup .wx-title {
    font-weight: bold;
    color: #00e5ff;
    margin: 4px 0 2px 0;
    font-size: 14px;
    padding: 0;
}

.airport-popup .loading {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

.airport-popup .metar-raw,
.airport-popup .taf-raw {
    font-family: 'Courier New', monospace;
    background: rgba(0, 229, 255, 0.1);
    padding: 6px 8px;
    border-radius: 4px;
    border-left: 3px solid #00e5ff;
    margin: 2px 0 4px 0;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    text-indent: 0;
}

.airport-popup .atis-content {
    white-space: pre-line;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin: 10px 0;
}

/* 첫 번째 줄 앞의 공백 제거 - 간단한 방법 */
.airport-popup .atis-content {
    text-indent: 0;
}

.airport-popup .weather-content {
    white-space: normal;
    line-height: 1.4;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin: 10px 0;
    text-indent: 0;
}

/* WX 내용의 불필요한 공백 제거 */
.airport-popup .weather-content .wx-title:first-child {
    margin-top: 0;
}

.airport-popup .weather-content .metar-raw:last-child,
.airport-popup .weather-content .taf-raw:last-child {
    margin-bottom: 0;
}



.airport-popup .no-data {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin: 10px 0;
}



/* Airport marker styles */
.airport-marker {
    background: #00d4ff;
    border: 2px solid white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    cursor: pointer;
    transform-origin: center center;
    transition: transform 0.05s linear;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.airport-marker:hover {
    background: #ff6b35;
    transform: scale(1.2);
}

.airport-marker.has-atis {
    background: #00ff88;
}

.airport-marker.has-camera {
    background: #ff6b35;
}

.airport-marker.has-both {
    background: linear-gradient(45deg, #00ff88 50%, #ff6b35 50%);
}

/* 신선한 ATIS 마커 강력한 반짝이는 효과 */
@keyframes fresh-atis-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 0, 0.8),
                    0 0 0 0 rgba(255, 215, 0, 0.6);
        transform: scale(1);
        filter: brightness(1);
    }
    25% {
        box-shadow: 0 0 0 15px rgba(255, 255, 0, 0.4),
                    0 0 0 25px rgba(255, 215, 0, 0.2);
        transform: scale(1.15);
        filter: brightness(1.3);
    }
    50% {
        box-shadow: 0 0 0 25px rgba(255, 255, 0, 0.3),
                    0 0 0 35px rgba(255, 165, 0, 0.2);
        transform: scale(1.25);
        filter: brightness(1.6);
    }
    75% {
        box-shadow: 0 0 0 15px rgba(255, 255, 0, 0.4),
                    0 0 0 25px rgba(255, 215, 0, 0.2);
        transform: scale(1.15);
        filter: brightness(1.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 0, 0.8),
                    0 0 0 0 rgba(255, 215, 0, 0.6);
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes fresh-atis-glow {
    0% {
        filter: drop-shadow(0 0 8px rgba(255, 255, 0, 0.8)) 
                drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    }
    25% {
        filter: drop-shadow(0 0 15px rgba(255, 255, 0, 1)) 
                drop-shadow(0 0 25px rgba(255, 215, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 255, 0, 1)) 
                drop-shadow(0 0 35px rgba(255, 165, 0, 1));
    }
    75% {
        filter: drop-shadow(0 0 15px rgba(255, 255, 0, 1)) 
                drop-shadow(0 0 25px rgba(255, 215, 0, 0.8));
    }
    100% {
        filter: drop-shadow(0 0 8px rgba(255, 255, 0, 0.8)) 
                drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    }
}

.fresh-atis-marker {
    animation: fresh-atis-pulse 1.2s infinite, fresh-atis-glow 1s infinite;
    z-index: 1000;
}

.fresh-atis-marker::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 0, 0.4) 0%, rgba(255, 215, 0, 0.2) 30%, transparent 70%);
    animation: fresh-atis-pulse 1.2s infinite;
    pointer-events: none;
}

/* 기존 마커 스타일과 함께 사용 */
.airport-marker.fresh-atis {
    animation: fresh-atis-pulse 1.2s infinite, fresh-atis-glow 1s infinite;
}

/* Maplibre Symbol Layer용 신선한 ATIS 마커 스타일 */
.maplibregl-marker.fresh-atis {
    animation: fresh-atis-pulse 1.2s infinite, fresh-atis-glow 1s infinite;
}

/* 신선한 ATIS 마커 호버 효과 */
.maplibregl-marker.fresh-atis:hover {
    transform: scale(1.3);
    transition: transform 0.2s ease;
    filter: brightness(1.5) drop-shadow(0 0 30px rgba(255, 255, 0, 1));
}

/* 신선한 ATIS 마커 추가 강화 효과 */
.fresh-atis-marker,
.airport-marker.fresh-atis,
.maplibregl-marker.fresh-atis {
    position: relative;
    z-index: 1000;
}

/* 신선한 ATIS 마커 주변에 추가 글로우 효과 */
.fresh-atis-marker::after,
.airport-marker.fresh-atis::after,
.maplibregl-marker.fresh-atis::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 0, 0.2) 0%, transparent 60%);
    animation: fresh-atis-pulse 1.2s infinite reverse;
    pointer-events: none;
    z-index: -1;
}

/* Map control panel styles */
#map-control-panel {
    position: absolute;
    top: 100px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

/* 작은 모바일 화면에서만 간격 조정 */
@media (max-width: 480px) {
    #map-control-panel {
        left: 10px;
        top: 80px;
        gap: 8px;
    }
    
    .map-control-btn {
        padding: 8px;
        font-size: 12px;
    }
    
    .zoom-info {
        padding: 8px;
        font-size: 11px;
    }
}

.zoom-info {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.zoom-info span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #00d4ff;
}

.zoom-info small {
    display: block;
    font-size: 11px;
    color: #ccc;
    margin-top: 2px;
}

.map-control-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.map-control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.map-control-btn.active {
    background: rgba(0, 212, 255, 0.3);
    border-color: #00d4ff;
}

.map-control-btn svg {
    width: 20px;
    height: 20px;
}


/* 새로고침 애니메이션 스타일 */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
.rotate {
  animation: rotate 1s linear;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #atis-view .top-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 10px 20px; /* Re-adjust padding for mobile */
        gap: 15px;
    }

    #atis-view .logo {
        order: 1;
        flex-grow: 1; /* Pushes other items to the right */
        font-size: 22px; /* Slightly smaller logo on mobile */
    }

    /* Target the container of the status indicator and icons directly */
    #atis-view .header-actions {
        order: 2; /* Ensure it comes after the logo in the flex order */
        display: contents; /* This is key: it makes the children of header-actions direct flex items of .top-bar */
    }
    
    #network-status-indicator {
        order: 2; /* Explicitly place it second */
    }

    #atis-view .search-bar {
        order: 3;
        width: 100%; /* Full width on its own line */
    }

    #atis-view .icon-group {
        order: 4;
        margin-left: auto; /* Pushes the icons to the far right on their line */
    }

    #atis-view .navigation-bar {
        padding: 0 10px; /* Keep horizontal padding for scrollable nav */
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    #atis-view .section-header {
       display: none; /* Hide desktop sorter on mobile */
    }
    #sort-container-mobile {
        display: flex; /* Show on mobile */
        gap: 5px;
        margin-left: auto; /* Push it to the right of other icons */
    }
    #sort-container-mobile .sort-button {
        font-size: 12px;
        padding: 5px 8px;
    }
}

/* 정렬 드롭다운 스타일 */
#atis-view .sort-select {
    font-family: var(--font-ui);
    background: var(--card-bg-color);
    color: var(--primary-text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    min-width: 110px;
    max-width: 160px;
    width: auto;
    margin-left: 10px;
    outline: none;
    transition: border-color 0.2s;
}
#atis-view .sort-select:focus {
    border-color: var(--accent-color);
}
@media (max-width: 768px) {
    #atis-view .sort-select {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }
}

.custom-select-wrapper {
    position: relative;
    display: inline-block;
    font-family: var(--font-ui);
}
.custom-select-btn {
    background: var(--card-bg-color);
    color: var(--primary-text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    min-width: 110px;
    max-width: 160px;
    width: auto;
    cursor: pointer;
    transition: border-color 0.2s;
}
.custom-select-btn:focus {
    border-color: var(--accent-color);
}
.custom-select-list {
    position: absolute;
    left: 0; right: 0;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 0; padding: 0;
    list-style: none;
    z-index: 100;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.custom-select-list li {
    padding: 10px 16px;
    cursor: pointer;
    color: var(--primary-text-color);
    transition: background 0.2s;
}
.custom-select-list li:hover, .custom-select-list li.selected {
    background: var(--accent-color);
    color: #fff;
}
@media (max-width: 768px) {
    .custom-select-btn, .custom-select-list {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

/* 공통 모달 배경 (blur + 반투명) */
.modal-blur-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 공통 모달 컨텐츠 */
.modal-content {
    background: var(--card-bg-color);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalFadeIn 0.2s;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95);}
    to { opacity: 1; transform: scale(1);}
}
.modal-title {
    color: var(--primary-text-color);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    width: 100%;
    text-align: center;
}
.modal-close-btn {
    position: absolute;
    top: 10px; right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--secondary-text-color);
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}
.modal-close-btn:hover { color: var(--primary-text-color); }
.modal-image-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    min-height: 200px;
}
.modal-image-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    background: #222;
}
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: var(--accent-color);
    background: rgba(0,0,0,0.2);
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s, color 0.2s;
}
.modal-nav-btn:disabled {
    color: #555;
    background: rgba(0,0,0,0.1);
    cursor: default;
}
.modal-nav-btn.left { left: 10px; }
.modal-nav-btn.right { right: 10px; }

footer {
    transition: bottom 0.3s;
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100px; /* 숨김 */
}
footer.footer-visible {
    bottom: 0; /* 노출 */
}

#scroll-to-top-btn {
    position: fixed;
    right: 30px;
    bottom: 40px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #00e5ff 60%, #1c2938 100%);
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1200;
}
#scroll-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

#network-status-indicator {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    background-color: #333;
    color: #ccc;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

#network-status-indicator .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ff4d4d; /* Red */
    margin-right: 8px;
    transition: background-color 0.3s ease;
}

#network-status-indicator.online {
    color: #a7ffaf;
    background-color: #274934;
}

#network-status-indicator.online .status-dot {
    background-color: #4caf50; /* Green */
    animation: pulse-glow 1.2s linear infinite;
}

#network-status-indicator.online .status-text {
    content: "ONLINE";
}

/* Custom Select Wrapper */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper::after {
    content: '▼';
    font-size: 12px;
    color: #888;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

#search-filter-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #2a2a2a;
    border: 1px solid #444;
    padding: 8px 30px 8px 12px;
    border-radius: 6px;
    color: #eee;
    cursor: pointer;
    font-size: 14px;
}

#search-filter-select:hover {
    border-color: #666;
}

/* Navigation Bar active state */
.navigation-bar .nav-button.active {
    background-color: #007bff; /* Remove jarring blue */
    background-color: var(--accent-color);
    color: #ffffff;
    font-weight: bold;
}

/* Mobile Responsive Header */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: row !important; /* OVERRIDE any column directions */
        flex-wrap: wrap;
        align-items: center;
    }

    .header-actions {
       display: contents;
    }

    .logo {
        order: 1;
        flex-grow: 1;
    }
    #network-status-indicator {
        order: 2;
    }

    .search-bar {
        order: 3;
        width: 100%;
        min-width: unset;
    }

    .icon-group {
        order: 4;
        margin-left: auto; /* Push to the right */
        padding-top: 5px; /* Add some space */
    }
    
    .navigation-bar {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* -------------------- */
/* Flight Search Modal  */
/* -------------------- */

#flight-modal-content {
    /* Override generic modal styles for this specific modal */
    display: block; /* Use block instead of flex */
    text-align: left; /* Align content to the left */
    padding: 1.5rem; /* Custom padding */
    width: 90%;
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary-text-color);
    cursor: pointer;
    /* This button does not need to be absolute, header is flex */
}

.modal-body .search-inputs {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem;
}

.modal-body .input-group {
    flex: 1 1 0 !important;
    min-width: 0 !important;
}
.modal-body .input-group input {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.modal-body input[type="text"] {
    padding: 0.75rem;
    background-color: var(--bg-color); /* Use defined variable */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--primary-text-color);
    font-size: 1rem;
}

#modal-airline {
    width: 240px; /* 항공사 입력창 너비 */
}

#modal-flight-number {
    width: 140px; /* 편명 입력창 너비 */
}

.modal-body .suggestions-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-color); /* Use defined variable */
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1010;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); /* Add shadow for depth */
}

.modal-body .suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    color: var(--primary-text-color); /* Explicitly set text color */
}

.modal-body .suggestion-item:hover {
    background-color: var(--border-color); /* Change highlight color */
}

.modal-body .suggestion-item small {
    color: var(--secondary-text-color);
    display: block;
    margin-top: 4px;
}

.modal-body button[type="submit"] {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--accent-color);
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#flight-results-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* --- Flight Result Card Styles --- */
.flight-result-card {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.flight-info-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.flight-info-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--primary-text-color);
}

.flight-info-header .airline-details {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    margin: 0;
}

.flight-path-container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* 핵심: 공항 텍스트와 애니메이션 경로를 세로 중앙 정렬합니다. */
    position: relative;
    padding: 1rem 0;
}

.airport-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100px; /* 공항 정보 너비를 고정하여 레이아웃 안정성 확보 */
}

.airport-column .airport-code {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-color);
}

.airport-column .airport-name {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
    margin-top: 0.25rem;
}

.airport-column .flight-time {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin-top: 0.75rem;
    color: var(--primary-text-color);
}

.animation-path {
    flex-grow: 1;
    position: relative;
    height: 40px; /* 애니메이션을 위한 높이 확보 */
    margin: 0 1rem; /* 경로의 시작과 끝에 여백을 추가하여 글자와 겹치지 않게 합니다. */
}

.flight-arc {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 2;
    stroke-dasharray: 4 4;
}

.airplane-icon {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 1.5rem;
    transform: translate(-40%, -60%) rotate(45deg);
    offset-path: path("M 0,20 C 50,-5 150,-5 200,20");
    offset-rotate: auto;
    animation: fly 3s ease-in-out infinite;
}

@keyframes fly {
    from {
        offset-distance: 0%;
    }
    to {
        offset-distance: 100%;
    }
}

/* 모바일: 비행기 직선 애니메이션 */
@media (max-width: 768px) {
  .airplane-icon.airplane-mobile {
    /* 도착점을 전체 경로의 60% 지점(예: 96px)으로 조정 */
    offset-path: path("M 0,20 L 96,20");
    offset-rotate: auto;
    animation: fly-inertia 7s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  }
}

@keyframes fly-inertia {
  0% {
    offset-distance: 0%;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  80% {
    offset-distance: 100%;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  100% {
    offset-distance: 100%;
  }
}


/* Responsive modal inputs */
@media (max-width: 768px) {
    .modal-body .search-inputs {
        flex-direction: column;
        gap: 0.5rem; /* 모바일에서 세로 간격 줄이기 */
    }
    
    /* 기존의 flex 비율을 무시하고 너비를 자동으로 채우도록 재정의 */
    .modal-body .search-inputs .input-group:first-child,
    .modal-body .search-inputs .input-group:last-child {
        flex: 1 1 auto;
    }
}

/* --- PWA Install Banner Styles --- */
.pwa-banner {
    position: fixed;
    bottom: -100px; /* Initially hidden */
    left: 0;
    width: 100%;
    z-index: 3000;
    display: flex;
    justify-content: center;
    transition: bottom 0.5s ease-in-out;
}

.pwa-banner.visible {
    bottom: 20px; /* Slide in */
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    background-color: var(--card-bg-color);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border: 1px solid var(--border-color);
    max-width: 90%;
    width: 400px;
}

.pwa-icon {
    width: 48px;
    height: 48px;
    margin-right: 12px;
}

.pwa-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pwa-text strong {
    font-weight: bold;
    color: var(--primary-text-color);
}

.pwa-text span {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.pwa-button {
    background-color: var(--accent-color);
    color: #111;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 16px;
}

.pwa-close-button {
    background: none;
    border: none;
    color: var(--secondary-text-color);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 8px;
}

#loading-progress-container {
    width: 100%;
    height: 3px; /* Very slim progress bar */
    background-color: transparent; /* No background when not active */
    position: sticky;
    top: 56px; /* Position it right below the header (adjust if header height changes) */
    z-index: 999; /* Below header but above content */
    overflow: hidden;
    display: none; /* Hidden by default */
}

#loading-progress-bar {
    width: 0;
    height: 100%;
    background-color: #4caf50; /* Green color */
    transition: width 0.3s ease-out; /* Smooth transition for progress */
}

#app-version {
    position: absolute;
    bottom: 5px;
    right: 15px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none; /* Make it non-interactive */
}

#app-container {
    position: relative;
    padding-bottom: 0; /* Remove bottom padding */
}

#refresh-button-container {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#refresh-data-button {
    position: absolute;
}

#refresh-data-button:disabled {
    cursor: not-allowed;
}

#refresh-data-button:disabled svg {
    opacity: 0.5;
}

.cooldown-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    transform: rotate(-90deg); /* Start from the top */
    pointer-events: none; /* Make it non-interactive */
}

.cooldown-indicator.hidden {
    display: none;
}

.cooldown-indicator circle {
    fill: none;
    stroke-width: 3;
}

.cooldown-bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.cooldown-progress {
    stroke: #e74c3c; /* Initial red color */
    stroke-dasharray: 113; /* Circumference of the circle (2 * PI * 18) */
    stroke-dashoffset: 113; /* Start with the circle fully "empty" */
    transition: stroke-dashoffset 1s linear, stroke 1s linear;
}

/* --- Responsive Design for Mobile Header --- */
@media (max-width: 768px) {
    .app-header .top-bar {
        flex-wrap: wrap; /* Allow items to wrap to the next line on small screens */
        row-gap: 0.75rem; /* Add vertical space when items wrap */
    }
}

/* --- Responsive Design for Mobile Header (768px and below) --- */
@media (max-width: 768px) {
    .app-header .top-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.75rem 1rem;
        row-gap: 0.75rem;
    }

    /* This makes the children of .header-actions act as direct children of .top-bar for layout purposes */
    .app-header .header-actions {
        display: contents;
    }

    /* --- Line 1: Logo and Online Status --- */
    .app-header .logo {
        order: 1;
        flex-grow: 1; /* Takes up space, pushing the status indicator to the right */
    }
    #network-status-indicator {
        order: 2;
    }

    /* --- Line 2: Search and Icons --- */
    .app-header .search-bar {
        order: 3;
        flex-grow: 1; /* Takes up available space */
        min-width: 150px; /* Ensures it doesn't get too small */
    }
    .app-header .icon-group {
        order: 4;
        margin-left: 0.5rem; /* Space between search and icons */
    }
}

/* --- FINAL OVERRIDE FOR MOBILE HEADER --- */
@media (max-width: 768px) {
    #atis-view .top-bar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    #atis-view .header-actions {
        display: contents !important;
    }

    #atis-view .logo {
        order: 1 !important;
        flex-grow: 1 !important;
        padding-bottom: 0 !important; /* Reset any specific padding */
    }

    #network-status-indicator {
        order: 2 !important;
    }

    #atis-view .search-bar {
        order: 3 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #atis-view .icon-group {
        order: 4 !important;
        width: 100% !important;
        justify-content: flex-end !important;
        padding-top: 10px; /* Add some space above the icons */
    }
}


/* Footer Styles */
.site-footer {
  background: transparent !important;
  border-top: 1px solid rgba(255,255,255,0.1) !important;
  padding: 0.8rem 0 !important;
  margin-top: 2rem !important;
  display: block !important;
  position: relative !important;
  z-index: 999 !important;
  width: 100% !important;
  min-height: 40px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.site-footer .footer-content {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 0.85rem !important;
  color: rgba(255,255,255,0.7) !important;
  font-family: 'Inter', sans-serif !important;
  height: 40px !important;
}

.site-footer .footer-left {
  font-family: 'Inter', sans-serif !important;
  color: rgba(255,255,255,0.6) !important;
  display: flex !important;
  align-items: center !important;
}

.site-footer .footer-right {
  font-family: 'Inter', sans-serif !important;
  display: flex !important;
  align-items: center !important;
}

.site-footer .footer-link {
  color: #667eea !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  background: rgba(102, 126, 234, 0.1) !important;
  border: 1px solid rgba(102, 126, 234, 0.2) !important;
  display: flex !important;
  align-items: center !important;
}

.site-footer .footer-link:hover {
  color: #ffffff !important;
  background: rgba(102, 126, 234, 0.2) !important;
  border-color: rgba(102, 126, 234, 0.4) !important;
  transform: translateY(-1px) !important;
}

@media (max-width: 768px) {
  .site-footer .footer-content {
    flex-direction: column !important;
    gap: 0.5rem !important;
    text-align: center !important;
    height: auto !important;
    padding: 0.5rem 1rem !important;
  }
  
  .site-footer .footer-link {
    padding: 8px 16px !important;
  }
}

/* Ensure ATIS card footer layout remains row and split on mobile */
@media (max-width: 768px) {
  #atis-view .footer-content {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
  }
}
