/**
 * flugbuchen.de — Airport Autocomplete Styles
 *
 * Shared styles for the airport autocomplete dropdown component.
 * Used on /fluege and / (home hero search).
 *
 * @copyright reDim GmbH | @link https://www.redim.de | @contact team@redim.de
 */

/* Wrapper */
.ac-wrapper {
    position: relative;
    display: block;
}

/* Dropdown list */
.ac-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    list-style: none;
    padding: 0.25rem 0;
    margin: 0;
    max-height: 22rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.ac-dropdown::-webkit-scrollbar {
    width: 4px;
}

.ac-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.ac-dropdown::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

/* Individual item */
.ac-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    min-height: 44px;
    cursor: pointer;
    transition: background-color 0.1s ease;
    border-bottom: 1px solid transparent;
}

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

.ac-item:hover,
.ac-item.is-active {
    background: rgba(13, 148, 136, 0.07);
}

.ac-item.is-active {
    outline: none;
}

/* IATA code badge */
.ac-item__iata {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-secondary);
    background: rgba(13, 148, 136, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.125rem 0.375rem;
    letter-spacing: 0.04em;
    font-family: ui-monospace, 'Courier New', monospace;
    min-width: 2.75rem;
    text-align: center;
}

/* City — Airport Name */
.ac-item__label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Country */
.ac-item__country {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* Empty state */
.ac-item--empty {
    color: var(--color-text-secondary);
    font-style: italic;
    font-size: 0.8125rem;
    cursor: default;
    justify-content: center;
}

.ac-item--empty:hover {
    background: transparent;
}

@media (max-width: 480px) {
    .ac-item__country {
        display: none;
    }

    .ac-item__label {
        font-size: 0.8125rem;
    }
}
