.flight-search-page .airport-selector {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    text-align: left !important;
    background-color: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 1rem 0.75rem !important;
    margin: 0 !important;
}

.flight-search-page .airport-selector span:first-child {
    flex: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    margin-right: 0.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
}

.flight-search-page .airport-selector .dropdown-arrow {
    font-size: 0.75rem !important;
    color: #ff7a00 !important;
    flex-shrink: 0 !important;
    width: 16px !important;
    text-align: center !important;
}

/* ==============================================
   AIRPORT MODAL CONTAINER
   ============================================== */

.airport-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    font-family: 'Noto Serif', serif !important;
}

.airport-modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.airport-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(5px) !important;
}

.airport-modal-content {
    position: relative !important;
    width: 85% !important;
    max-width: 700px !important;
    max-height: 60vh !important;
    background: white !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden !important;
    z-index: 1 !important;
    margin: 20px !important;
}

/* ==============================================
   MODAL HEADER
   ============================================== */

.airport-modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid #e9ecef !important;
    background: linear-gradient(135deg, #ff7a00, #ff9500) !important;
    color: white !important;
}

.airport-modal-header h3 {
    margin: 0 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: white !important;
}

.airport-modal-close {
    background: none !important;
    border: none !important;
    font-size: 1.5rem !important;
    color: white !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
}

/* ==============================================
   MODAL BODY
   ============================================== */

.airport-modal-body {
    padding: 0 !important;
    max-height: calc(60vh - 70px) !important;
}

/* ==============================================
   SEARCH BOX
   ============================================== */

.airport-search {
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid #e9ecef !important;
    background: #f8f9fa !important;
}

.airport-search input {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 12px !important;
    font-size: 0.9rem !important;
    font-family: 'Noto Serif', serif !important;
    outline: none !important;
}

.airport-search input:focus {
    border-color: #ff7a00 !important;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.1) !important;
}

.airport-search input::placeholder {
    color: #6c757d !important;
    font-style: italic !important;
}

/* ==============================================
   CATEGORY NAVIGATION
   ============================================== */

.airport-categories {
    padding: 0 !important;
}

.category-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    padding: 0.75rem 1.5rem !important;
    border-bottom: 1px solid #e9ecef !important;
    background: white !important;
}

.category-btn {
    padding: 0.4rem 0.8rem !important;
    border: 2px solid #dee2e6 !important;
    background: white !important;
    border-radius: 16px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #6c757d !important;
    cursor: pointer !important;
    font-family: 'Noto Serif', serif !important;
    margin: 0 !important;
}

.category-btn.active {
    border-color: #ff7a00 !important;
    background: #ff7a00 !important;
    color: white !important;
}

/* ==============================================
   AIRPORT GRID - COMPACT VERSION - Updated
   ============================================== */

.airport-grid.compact {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-rows: 45px !important;
    gap: 1px !important;
    padding: 0 !important;
    background: #e9ecef !important;
    min-height: 100px !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    list-style: none !important;
    margin: 0 !important;
    align-content: start !important;
}

.airport-grid.compact li {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 45px !important;
}

.airport-grid.compact li a {
    padding: 0.4rem 0.3rem !important;
    background: transparent !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    text-align: center !important;
    font-family: 'Noto Serif', serif !important;
    width: 100% !important;
    height: 100% !important;
    transition: background-color 0.2s ease !important;
    color: inherit !important;
}

.airport-grid.compact li a:hover {
    background: #f8f9fa !important;
    border: 1px solid #ff7a00 !important;
}

.airport-grid.compact li a b {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.1 !important;
    margin-right: 3px !important;
}

.airport-grid.compact li a span {
    font-size: 0.7rem !important;
    font-weight: 400 !important;
    color: #6c757d !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

/* ==============================================
   RESPONSIVE DESIGN - UPDATED (FULLSCREEN MOBILE WITH SCROLL FIX)
   ============================================== */

/* Desktop */
@media (min-width: 992px) {
    .airport-grid.compact {
        grid-template-columns: repeat(4, 1fr) !important;
        max-height: 200px !important;
        grid-auto-rows: 45px !important;
    }
    
    .airport-grid.compact li {
        height: 45px !important;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .airport-grid.compact {
        grid-template-columns: repeat(4, 1fr) !important;
        max-height: 200px !important;
        grid-auto-rows: 40px !important;
    }
    
    .airport-grid.compact li {
        height: 40px !important;
    }
    
    .airport-grid.compact li a {
        padding: 0.35rem 0.25rem !important;
    }
    
    .airport-grid.compact li a b {
        font-size: 0.7rem !important;
    }
    
    .airport-grid.compact li a span {
        font-size: 0.65rem !important;
    }
}

/* Mobile - FULLSCREEN MODE WITH SCROLL FIX */
@media (max-width: 767px) {
    .airport-modal.show {
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    
    .airport-modal-overlay {
        background: rgba(0, 0, 0, 0.8) !important;
        backdrop-filter: blur(2px) !important;
    }
    
    .airport-modal-content {
        width: 100% !important;
        height: 100vh !important; /* Use 100vh instead of 100% */
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important; /* Prevent modal overflow */
    }
    
    .airport-modal-header {
        flex-shrink: 0 !important;
        padding: 1rem !important;
        position: relative !important;
        z-index: 2 !important;
    }
    
    .airport-modal-header h3 {
        font-size: 1.2rem !important;
    }
    
    .airport-modal-body {
        flex: 1 !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important; /* Key fix */
        min-height: 0 !important; /* Fix for Firefox */
    }
    
    .airport-search {
        flex-shrink: 0 !important;
        padding: 1rem !important;
        background: #f8f9fa !important;
        border-bottom: 1px solid #e9ecef !important;
    }
    
    .airport-categories {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        min-height: 0 !important;
    }
    
    .category-nav {
        flex-shrink: 0 !important;
        padding: 0.75rem 1rem !important;
        gap: 0.5rem !important;
        border-bottom: 1px solid #e9ecef !important;
        background: white !important;
    }
    
    .category-btn {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    /* KEY FIX: Airport Grid scrollable */
    .airport-grid.compact {
        flex: 1 !important;
        grid-template-columns: repeat(3, 1fr) !important;
        max-height: none !important; /* Remove height limit */
        min-height: 0 !important;
        grid-auto-rows: 55px !important;
        gap: 2px !important;
        padding: 1rem !important;
        background: #f8f9fa !important;
        overflow-y: auto !important; /* Enable scroll */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important; /* Smooth scroll on iOS */
    }
    
    .airport-grid.compact li {
        height: 55px !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }
    
    .airport-grid.compact li a {
        padding: 0.5rem 0.3rem !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    
    .airport-grid.compact li a b {
        font-size: 0.75rem !important;
        margin-bottom: 2px !important;
        margin-right: 0 !important;
    }
    
    .airport-grid.compact li a span {
        font-size: 0.65rem !important;
    }
}

/* Extra Small Mobile - FULLSCREEN MODE */
@media (max-width: 480px) {
    .airport-modal-content {
        height: 100vh !important;
    }
    
    .airport-modal-header {
        padding: 0.75rem !important;
    }
    
    .airport-modal-header h3 {
        font-size: 1.1rem !important;
    }
    
    .airport-search {
        padding: 0.75rem !important;
    }
    
    .category-nav {
        padding: 0.5rem 0.75rem !important;
        gap: 0.3rem !important;
    }
    
    .category-btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
    
    .airport-grid.compact {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-rows: 60px !important;
        padding: 0.75rem !important;
        gap: 3px !important;
    }
    
    .airport-grid.compact li {
        height: 60px !important;
    }
    
    .airport-grid.compact li a {
        padding: 0.4rem 0.2rem !important;
    }
    
    .airport-grid.compact li a b {
        font-size: 0.7rem !important;
    }
    
    .airport-grid.compact li a span {
        font-size: 0.6rem !important;
    }
}

/* ==============================================
   ENHANCED SCROLL BAR STYLING FOR MOBILE
   ============================================== */

.airport-grid.compact::-webkit-scrollbar {
    width: 6px !important;
}

.airport-grid.compact::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 3px !important;
}

.airport-grid.compact::-webkit-scrollbar-thumb {
    background: #ff7a00 !important;
    border-radius: 3px !important;
}

.airport-grid.compact::-webkit-scrollbar-thumb:hover {
    background: #e56600 !important;
}

/* Enhanced scrollbar for mobile */
@media (max-width: 767px) {
    .airport-grid.compact::-webkit-scrollbar {
        width: 8px !important;
    }
    
    .airport-grid.compact::-webkit-scrollbar-track {
        background: #f1f1f1 !important;
        border-radius: 4px !important;
    }
    
    .airport-grid.compact::-webkit-scrollbar-thumb {
        background: #ff7a00 !important;
        border-radius: 4px !important;
    }
    
    .airport-grid.compact::-webkit-scrollbar-thumb:hover {
        background: #e56600 !important;
    }
}

/* ==============================================
   LOADING & ERROR STATES
   ============================================== */

.airport-grid.loading {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 200px !important;
    color: #6c757d !important;
    font-style: italic !important;
}

.airport-grid.empty {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 200px !important;
    color: #6c757d !important;
    font-style: italic !important;
}

.airport-grid.empty::before {
    content: "Không tìm thấy sân bay nào" !important;
}

.airport-grid.compact.no-results {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100px !important;
    color: #6c757d !important;
    font-style: italic !important;
    grid-template-columns: 1fr !important;
}

.airport-grid.compact.no-results::before {
    content: "Không tìm thấy sân bay nào" !important;
}

/* ==============================================
   ACCESSIBILITY
   ============================================== */

.airport-item:focus {
    outline: 2px solid #ff7a00 !important;
    outline-offset: 2px !important;
}

.category-btn:focus {
    outline: 2px solid #ff7a00 !important;
    outline-offset: 2px !important;
}

.airport-modal-close:focus {
    outline: 2px solid white !important;
    outline-offset: 2px !important;
}

.airport-grid.compact li a:focus {
    outline: 2px solid #ff7a00 !important;
    outline-offset: 2px !important;
}