/* Airport Autocomplete Styles */

.airport-autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.airport-autocomplete-wrapper input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.airport-autocomplete-wrapper input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.airport-autocomplete-wrapper.loading input[type="text"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" stroke="%23ccc" stroke-width="4" fill="none"/><circle cx="25" cy="25" r="20" stroke="%230073aa" stroke-width="4" fill="none" stroke-dasharray="80" stroke-dashoffset="60"><animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="1s" repeatCount="indefinite"/></circle></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px 18px;
    padding-right: 36px;
}

.airport-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.airport-autocomplete-dropdown.open {
    display: block;
}

.airport-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.airport-item:last-child {
    border-bottom: none;
}

.airport-item:hover,
.airport-item.selected {
    background-color: #f5f5f5;
}

.airport-item.selected {
    background-color: #e8f4fc;
}

.airport-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 4px 8px;
    margin-right: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #0073aa;
    background-color: #e8f4fc;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.airport-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.airport-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.airport-location {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.airport-no-results {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Scrollbar styling */
.airport-autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.airport-autocomplete-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.airport-autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.airport-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .airport-autocomplete-wrapper input[type="text"] {
        background-color: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .airport-autocomplete-dropdown {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .airport-item {
        border-bottom-color: #444;
    }
    
    .airport-item:hover,
    .airport-item.selected {
        background-color: #3d3d3d;
    }
    
    .airport-code {
        background-color: #1a3a4a;
    }
    
    .airport-name {
        color: #fff;
    }
    
    .airport-location {
        color: #999;
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .airport-autocomplete-dropdown {
        max-height: 250px;
    }
    
    .airport-item {
        padding: 8px 10px;
    }
    
    .airport-code {
        min-width: 40px;
        font-size: 12px;
    }
    
    .airport-name {
        font-size: 13px;
    }
}
