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

/* Container - Fixed for proper visibility */
.autocomplete-results {
    background: #242424 !important;
    border: none !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    margin-top: 0 !important;
    border-radius: 0 0 4px 4px !important;
}

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

/* Individual suggestion item - Dark theme */
.autocomplete-item {
    padding: 10px 12px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    color: #D8D8D8 !important;
    background: #242424 !important;
    transition: background-color 0.15s ease !important;
    border-bottom: 1px solid #333 !important;
    overflow: visible !important;
}

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

/* Hover state - Dark theme */
.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #4B0082 !important;
    color: #FFFFFF !important;
}

/* 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 - Dark theme */
.autocomplete-item span {
    flex: 1 !important;
    color: #D8D8D8 !important;
    font-weight: 400 !important;
    overflow: visible !important;
}

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

.autocomplete-item:hover span,
.autocomplete-item.active span {
    color: #FFFFFF !important;
}

.autocomplete-item:hover strong,
.autocomplete-item.active strong {
    color: #FFFFFF !important;
}

/* 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;
}

/* CRITICAL: Fix overflow on search container */
.search {
    overflow: visible !important;
}

.search form {
    overflow: visible !important;
}

.search-input {
    overflow: visible !important;
}
