/**
 * Search Autocomplete - xHamster Style
 * Version: 2.1 (Compact, no numbers)
 */

/* Container */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 0;
    border-radius: 0 0 4px 4px;
    display: none;
}

.autocomplete-results.show {
    display: block;
}

/* Individual suggestion item - KOMPAKT */
.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #333;
    background: #fff;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

/* Hover state */
.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f5f5f5;
}

/* Search icon (before text) */
.autocomplete-item::before {
    content: '\1F50D'; /* 🔍 Unicode search icon */
    font-size: 13px;
    color: #999;
    margin-right: 8px;
    opacity: 0.7;
}

/* Alternative: Use Font Awesome icon if available */
.autocomplete-item.use-fa::before {
    content: '\f002'; /* Font Awesome search icon */
    font-family: 'Font Awesome 5 Free', FontAwesome;
    font-weight: 900;
    font-size: 12px;
    color: #999;
    margin-right: 8px;
}

/* Suggestion text */
.autocomplete-item span {
    flex: 1;
    color: #333;
    font-weight: 400;
}

/* Highlighted (matched) text */
.autocomplete-item strong {
    font-weight: 700;
    color: #000;
}

/* ELTÁVOLÍTVA: Hits badge (nem kell) */
.autocomplete-hits {
    display: none !important;
}

/* Scrollbar styling (webkit browsers) */
.autocomplete-results::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* Loading state (optional) */
.autocomplete-loading {
    padding: 10px 12px;
    text-align: center;
    color: #999;
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
}

/* No results state */
.autocomplete-no-results {
    padding: 10px 12px;
    text-align: center;
    color: #999;
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .autocomplete-results {
        max-height: 300px;
        border-radius: 0 0 8px 8px;
    }

    .autocomplete-item {
        padding: 10px 12px;
        font-size: 14px;
    }

    .autocomplete-item::before {
        font-size: 14px;
        margin-right: 10px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .autocomplete-results {
        background: #1a1a1a;
        border-color: #333;
    }

    .autocomplete-item {
        background: #1a1a1a;
        color: #e0e0e0;
        border-bottom-color: #2a2a2a;
    }

    .autocomplete-item:hover,
    .autocomplete-item.active {
        background-color: #252525;
    }

    .autocomplete-item span {
        color: #e0e0e0;
    }

    .autocomplete-item strong {
        color: #fff;
    }

    .autocomplete-item::before {
        color: #666;
    }
}

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

.autocomplete-results.show {
    animation: slideDown 0.2s ease-out;
}

/* Fix for positioned parent */
.autocomplete-wrapper {
    position: relative;
}
