/**
 * Autocomplete Dropdown Styles
 */

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border, #e0e0e0);
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--primary-light, rgba(0, 102, 204, 0.05));
}

.autocomplete-icon {
    font-size: 16px;
    margin-right: 12px;
    opacity: 0.7;
}

.autocomplete-text {
    flex: 1;
    font-size: 14px;
    color: var(--text, #1a1a1a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-type {
    font-size: 12px;
    color: var(--text-secondary, #666);
    background: var(--primary-light, rgba(0, 102, 204, 0.08));
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.autocomplete-count {
    font-size: 11px;
    color: var(--text-secondary, #999);
    margin-left: auto;
    padding-left: 8px;
}

/* Different item types */
.autocomplete-item[data-type="category"] .autocomplete-text,
.autocomplete-item[data-type="tag"] .autocomplete-text {
    font-weight: 500;
}

.autocomplete-item[data-type="category"] .autocomplete-type {
    background: var(--success-light, rgba(40, 167, 69, 0.1));
    color: var(--success, #28a745);
}

.autocomplete-item[data-type="tag"] .autocomplete-type {
    background: var(--info-light, rgba(23, 162, 184, 0.1));
    color: var(--info, #17a2b8);
}

/* Header-specific styles */
.nav-search-wrapper .autocomplete-dropdown {
    min-width: 300px;
    max-width: 400px;
    right: auto;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        bottom: auto;
        max-height: 60vh;
        border-radius: 8px;
        margin-top: 8px;
    }
    
    .nav-search-wrapper .autocomplete-dropdown {
        top: 56px; /* Below navigation */
        min-width: auto;
        max-width: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .autocomplete-dropdown {
        background: var(--card-bg, #1e1e1e);
        border-color: var(--border, #333);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .autocomplete-item {
        border-color: var(--border, #333);
    }
    
    .autocomplete-item:hover,
    .autocomplete-item.selected {
        background: var(--primary-light, rgba(59, 130, 246, 0.1));
    }
    
    .autocomplete-text {
        color: var(--text, #f0f0f0);
    }
}

/* Animation */
.autocomplete-dropdown {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}