/* /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;
}

/* --- 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;
}

#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 */
}
#atis-view .section-title { grid-column: 1 / -1; font-size: 18px; font-weight: 700; color: var(--accent-color); padding-bottom: 10px; border-bottom: 1px solid var(--border-color); margin-top: 20px; margin-bottom: 10px; }
#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 2s infinite; }
@keyframes pulse { 0% { transform: scale(0.95); } 70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 229, 255, 0); } 100% { transform: scale(0.95); } }
#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 .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 .wx-title:first-child { margin-top: 0; }
#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 mapbox controls to not overlap with our header */
.mapboxgl-ctrl-top-right {
    top: 80px !important;
}


/* 새로고침 애니메이션 스타일 */
@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 .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 */
}

#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;
    justify-content: center; /* 입력창 그룹을 중앙에 정렬합니다. */
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-body .input-group {
    position: relative; /* For suggestion list positioning */
    /* 아래 flex 비율을 제거하여 입력창이 불필요하게 늘어나는 것을 방지합니다. */
}

.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%;
    }
}


/* 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 */
    }
}
