/* Airport Smart Search - CHS Brand Version 1.0.6 - FIXED PRODUCTION VERSION */

/* ===== SEARCH ICON AND CONTAINER ===== */

/* Fix search icon button */
.airport-search-icon,
.airport-search-icon:hover,
.airport-search-icon:focus,
.airport-search-icon:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    cursor: pointer !important;
    margin: 0 !important;
}

/* Only show outline when using keyboard for accessibility */
.airport-search-icon:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5) !important;
    outline-offset: 2px !important;
}

/* Search icon SVG styling */
.airport-search-icon svg {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
    fill: currentColor !important;
}

.airport-search-icon svg path {
    fill: #0F0F10 !important; /* CHS Soft Black */
}

/* Search container - FIXED: Better positioning */
.airport-search-container {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    height: auto !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: width 0.3s ease !important;
    width: auto !important;
    overflow: visible !important; /* FIXED: Ensure dropdown is visible */
}

/* Make container expandable but stay in line - FIXED */
.airport-search-container.search-active {
    width: 300px !important;
    position: relative !important; /* FIXED: Keep position relative */
}

/* Hide search icon when form is active */
.airport-search-container.search-active .airport-search-icon {
    display: none !important;
}

/* ===== SEARCH FORM STYLING - FIXED: Better positioning ===== */

/* Search form positioning - FIXED: Optimal alignment with header bar */
.airport-header-search-form {
    position: absolute !important;
    top: -27px !important; /* FIXED: Optimal positioning */
    left: 0 !important;
    width: 300px !important;
    height: 42px !important; /* FIXED: Extra height for proper alignment */
    background: transparent !important;
    padding: 0 !important;
    z-index: 9999 !important;
    display: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Ensure visible on active state */
.airport-header-search-form.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Search form layout */
.airport-header-search-form form {
    display: flex !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important; /* FIXED: Proper box model */
}

/* Search input styling - FIXED: Flat design, no shadows */
.airport-header-search-form input[type="search"] {
    background-color: white !important;
    color: #0F0F10 !important;
    border: 1px solid #0F0F10 !important;
    border-radius: 0 !important;
    padding: 8px 40px 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    width: 100% !important;
    margin: 0 !important;
    height: 42px !important; /* FIXED: Match parent height */
    box-shadow: none !important; /* FIXED: Completely flat, no shadow */
    box-sizing: border-box !important;
}

/* Placeholder styling */
.airport-header-search-form input[type="search"]::placeholder {
    color: #666 !important;
    opacity: 0.7 !important;
}

/* Focus state - FIXED: Flat focus, no shadow */
.airport-header-search-form input[type="search"]:focus {
    border-color: #000000 !important;
    box-shadow: none !important; /* FIXED: No shadow on focus either */
    outline: none !important;
}

/* Black search button - FIXED: Match new height */
.airport-header-search-form button {
    background-color: #000000 !important;
    border: none !important;
    border-radius: 0 !important;
    color: #fff !important;
    width: 40px !important;
    height: 42px !important; /* FIXED: Match parent height */
    cursor: pointer !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    box-sizing: border-box !important;
}

.airport-header-search-form button:hover {
    background: #333 !important;
}

/* ===== DROPDOWN SEARCH RESULTS - FIXED: Single dropdown, better positioning ===== */

/* Main dropdown container - FIXED: Position below adjusted form, flat design */
.airport-search-dropdown {
    position: absolute !important;
    top: 15px !important; /* FIXED: Adjust for new form position (-27px + 42px) */
    left: 0 !important;
    width: 300px !important;
    max-height: 350px !important;
    overflow: visible !important;
    background: white !important;
    border: 1px solid #0F0F10 !important;
    border-top: none !important;
    border-radius: 0 !important; /* FIXED: Completely flat, no rounded corners */
    box-shadow: none !important; /* FIXED: No shadow for flat design */
    z-index: 99999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.2s ease !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
}

.airport-search-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Search results container - FIXED: Single scroll area */
.airport-search-results {
    max-height: 350px !important; /* FIXED: Single scroll for entire dropdown */
    overflow-y: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Results list */
.airport-search-results-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.airport-search-results-list li {
    margin: 0 !important;
    padding: 0 !important;
}

/* Individual search items - FIXED: More compact */
.airport-search-item {
    border-bottom: 1px solid #f0f0f0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.airport-search-item:last-child {
    border-bottom: none !important;
}

/* Search item links - FIXED: More compact padding */
.airport-search-item-link {
    display: block !important;
    padding: 10px 15px !important; /* FIXED: Reduced padding from 12px to 10px */
    color: #0F0F10 !important; /* CHS Soft Black */
    text-decoration: none !important;
    transition: background-color 0.2s ease !important;
    line-height: 1.3 !important;
}

.airport-search-item-link:hover {
    background-color: #F8F8F8 !important; /* CHS Very Light Grey */
    color: #0076DF !important; /* CHS Link Color */
}

/* Search item content - FIXED: More compact */
.airport-search-item-title {
    display: block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 3px !important; /* FIXED: Reduced from 4px to 3px */
    color: #0F0F10 !important; /* CHS Soft Black */
    line-height: 1.3 !important;
}

.airport-search-item-link:hover .airport-search-item-title {
    color: #0076DF !important; /* CHS Link Color */
}

.airport-search-item-excerpt {
    display: block !important;
    font-size: 12px !important;
    color: #666 !important;
    line-height: 1.3 !important; /* FIXED: Reduced line height for compactness */
    margin-top: 2px !important; /* FIXED: Tighter spacing */
}

/* ===== POST TYPE COLOR CODING ===== */

/* Base styling for all type labels - FIXED: More compact */
.airport-search-result-card-type,
.airport-search-result-type,
.airport-search-item-type {
    display: inline-block !important;
    font-size: 10px !important; /* FIXED: Smaller font size */
    border-radius: 0 !important; /* Square corners */
    padding: 2px 6px !important;
    margin-bottom: 3px !important; /* FIXED: Reduced margin */
    text-transform: capitalize !important;
    font-weight: 500 !important;
}

/* Default fallback styling */
.airport-search-item-type {
    background: #F0F0F0 !important; /* CHS Light Grey */
    color: #0F0F10 !important; /* CHS Soft Black */
}

/* COLOR CODED POST TYPES USING CHS BRAND COLORS */
/* Pages */
.airport-type-page {
    background-color: #E9F8FF !important; /* CHS Light Purple Tone */
    color: #1B365D !important; /* CHS Dark Navy */
}

/* Posts */
.airport-type-post {
    background-color: #DBEEE8 !important; /* CHS Light Green Tone */
    color: #00865D !important; /* CHS Accessible Green */
}

/* Airlines */
.airport-type-airline {
    background-color: #EAFCFF !important; /* CHS Light Sky Blue */
    color: #0076DF !important; /* CHS Link Color */
}

/* Destinations */
.airport-type-destination {
    background-color: #FFE2CE !important; /* CHS Light Orange Tone */
    color: #FF9955 !important; /* CHS Orange */
}

/* Dining & Shopping Services */
.airport-type-services {
    background-color: #E3D9F2 !important; /* CHS New Light Blue */
    color: #9D7AD2 !important; /* CHS Purple */
}

/* Rental Cars */
.airport-type-rental-cars {
    background-color: #FFDFE3 !important; /* CHS Light Pink Tone */
    color: #F3909E !important; /* CHS Pink */
}

/* Airport Art */
.airport-type-art {
    background-color: #E9F8FF !important; /* CHS Light Purple Tone */
    color: #0088FF !important; /* CHS Royal Blue */
}

/* Routes */
.airport-type-route {
    background-color: #FFF2B6 !important; /* CHS Light Yellow Tone */
    color: #FFD100 !important; /* CHS Yellow */
}

/* Staff & Board Contacts */
.airport-type-staff-board-contact {
    background-color: #DBEEE8 !important; /* CHS Light Green Tone */
    color: #7DCD77 !important; /* CHS Light Green */
}

/* Events */
.airport-type-event {
    background-color: #FFDFE3 !important; /* CHS Light Pink Tone */
    color: #D2415B !important; /* CHS Accessible Red */
}

/* News */
.airport-type-news {
    background-color: #E3D9F2 !important; /* CHS New Light Blue */
    color: #9D7AD2 !important; /* CHS Purple */
}

/* Jobs/Careers */
.airport-type-job {
    background-color: #E9F8FF !important; /* CHS Light Purple Tone */
    color: #0076DF !important; /* CHS Link Color */
}

/* ===== "VIEW ALL RESULTS" LINK ===== */

.airport-search-view-all {
    border-top: 2px solid #f0f0f0 !important;
    background-color: #F8F8F8 !important; /* CHS Very Light Grey */
}

.airport-search-view-all-link {
    display: block !important;
    padding: 10px 15px !important; /* FIXED: Reduced padding for compactness */
    text-align: center !important;
    font-weight: 600 !important;
    color: #0076DF !important; /* CHS Link Color */
    text-decoration: none !important;
    transition: background 0.2s ease !important;
    font-size: 12px !important; /* FIXED: Smaller font */
}

.airport-search-view-all-link:hover,
.airport-search-view-all-link:focus {
    background: #E9F8FF !important; /* CHS Light Purple Tone */
    text-decoration: underline !important;
    outline: none !important;
}

/* ===== LOADING AND STATE MESSAGES - FIXED: More compact ===== */

.airport-search-loading,
.airport-search-no-results,
.airport-search-error {
    padding: 15px !important; /* FIXED: Reduced padding */
    text-align: center !important;
    color: #666 !important;
    font-size: 13px !important; /* FIXED: Smaller font */
}

/* ===== SEARCH RESULTS PAGE STYLING ===== */

/* Result title styling */
.airport-search-result-card-title,
.airport-search-result-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-bottom: 10px !important;
    line-height: 1.3 !important;
    color: #0F0F10 !important; /* CHS Soft Black */
}

.airport-search-result-card-title a,
.airport-search-result-title a {
    color: #0F0F10 !important; /* CHS Soft Black */
    text-decoration: none !important;
    line-height: 1.3 !important;
}

.airport-search-result-card-title a:hover,
.airport-search-result-title a:hover {
    text-decoration: underline !important;
    color: #0076DF !important; /* CHS Link Color */
}

/* Result excerpt styling */
.airport-search-result-card-excerpt,
.airport-search-result-excerpt {
    font-size: 14px !important;
    color: #0F0F10 !important; /* CHS Soft Black */
    margin-top: 10px !important;
    line-height: 1.5 !important;
}

/* Result card styling */
.airport-search-result-card {
    border: 1px solid #DEE2E8 !important; /* CHS Dark Blue Tone */
    border-radius: 0 !important; /* Square corners */
    overflow: hidden !important;
    transition: box-shadow 0.3s ease !important;
    background: #FFFFFF !important; /* CHS Cloud White */
    margin-bottom: 15px !important;
}

.airport-search-result-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.airport-search-result-card-body {
    padding: 20px !important;
}

/* Search results page container */
.airport-search-results-page {
    margin: 30px 0 !important;
    font-family: "Brandon Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
}

.airport-search-results-title {
    font-size: 28px !important;
    font-weight: 600 !important;
    margin-bottom: 10px !important;
    color: #0F0F10 !important; /* CHS Soft Black */
    border-bottom: 1px solid #DEE2E8 !important; /* CHS Dark Blue Tone */
    padding-bottom: 10px !important;
    line-height: 1.3 !important;
}

.airport-search-results-count {
    font-size: 16px !important;
    color: #0F0F10 !important; /* CHS Soft Black */
    margin-bottom: 30px !important;
}

/* Grid layout for search results */
.airport-search-results-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 20px !important;
}

/* ===== ACCESSIBILITY AND FOCUS STATES ===== */

/* Proper focus states for accessibility */
.airport-search-item-link:focus,
.airport-search-view-all-link:focus {
    outline: 2px solid #0076DF !important; /* CHS Link Color */
    outline-offset: -2px !important;
}

/* ===== MOBILE RESPONSIVENESS - FIXED ===== */

@media (max-width: 768px) {
    .airport-search-container.search-active {
        width: 280px !important; /* Smaller on mobile */
    }
    
    .airport-header-search-form,
    .airport-search-dropdown {
        width: 280px !important;
    }
    
    .airport-search-results-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .airport-search-container.search-active {
        width: 260px !important; /* Even smaller on very small screens */
    }
    
    .airport-header-search-form,
    .airport-search-dropdown {
        width: 260px !important;
    }
}

/* ===== THEME COMPATIBILITY - FIXED ===== */

/* Ensure proper display in various header contexts */
.site-header .airport-search-container {
    height: 100% !important;
}

/* Override any theme-specific button styling */
.airport-search-icon[type="button"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Ensure dropdowns appear above theme elements */
.airport-search-dropdown {
    z-index: 99999 !important; /* FIXED: Higher z-index */
}

/* FIXED: Prevent double dropdowns by ensuring only one exists */
#airport-search-dropdown {
    display: none !important; /* Remove any global dropdowns injected in footer */
}

/* End of Airport Smart Search CSS */