/* Autocomplete Component Styles
   For use in settings page city/timezone selection
   ============================================ */

/* Container */
.autocomplete-container {
    position: relative;
    width: 100%;
}

/* Results dropdown */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgb(var(--color-surface));
    border: 1px solid rgba(var(--color-border), var(--border-opacity));
    border-radius: var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-top: 0.25rem;
}

/* Individual result item */
.autocomplete-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(var(--color-border), 0.3);
    transition: background 0.15s ease;
}

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

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: rgba(var(--color-primary), 0.1);
}

.autocomplete-item.selected {
    background: rgba(var(--color-primary), 0.15);
}

/* City name - primary text */
.city-name {
    font-weight: 500;
    color: rgb(var(--color-text));
    font-size: 0.95rem;
}

/* Country code - secondary text */
.country-code {
    color: rgb(var(--color-text-tertiary));
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Timezone IANA identifier */
.timezone-iana {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: rgb(var(--color-text-secondary));
    margin-top: 0.25rem;
}

/* Population indicator */
.population {
    font-size: 0.75rem;
    color: rgb(var(--color-text-tertiary));
    margin-left: auto;
}

/* Hint text below input */
.autocomplete-hint {
    font-size: 0.8rem;
    color: rgb(var(--color-text-tertiary));
    margin-top: 0.35rem;
}

/* Empty state */
.autocomplete-empty {
    padding: 1rem;
    text-align: center;
    color: rgb(var(--color-text-secondary));
    font-size: 0.9rem;
}

/* Selected value display */
.selected-value {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    background: rgba(var(--color-overlay), 0.3);
    border: 1px solid rgba(var(--color-border), var(--border-opacity));
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

.selected-value .timezone-display {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: rgb(var(--color-primary));
    font-weight: 500;
}

.selected-value .city-display {
    font-size: 0.9rem;
    color: rgb(var(--color-text));
    margin-top: 0.25rem;
}

.selected-value .no-selection {
    color: rgb(var(--color-text-tertiary));
    font-style: italic;
}

/* Row layout for item metadata */
.autocomplete-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading state */
.autocomplete-loading {
    padding: 1rem;
    text-align: center;
    color: rgb(var(--color-text-secondary));
}

.autocomplete-loading::after {
    content: '...';
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Clear button for selected value */
.autocomplete-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgb(var(--color-text-tertiary));
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.autocomplete-clear:hover {
    color: rgb(var(--color-text));
}
