/*
 * Search Autocomplete Styles - VERSION 2.0 WITH TRENDING BADGE
 * xHamster-style narrow rows + Trending support
 */

:root {
    --ac-bg: #ffffff;
    --ac-bg-hover: #f5f5f5;
    --ac-border: #ddd;
    --ac-text: #333;
    --ac-text-light: #666;
    --ac-highlight: #000;
    --ac-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --ac-radius: 4px;
    --ac-font-size: 14px;
    --ac-z-index: 9999;
    --ac-trending-color: #ff6b35;
    --ac-trending-bg: #fff3ee;
}

/* Wrapper */
.ac-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Input */
.ac-input {
    width: 100%;
    padding: 10px 14px;
    font-size: var(--ac-font-size);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    background: var(--ac-bg);
    color: var(--ac-text);
    outline: none;
    box-sizing: border-box;
}

.ac-input:focus {
    border-color: #999;
}

.ac-wrapper.ac-open .ac-input {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Dropdown */
.ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: -1px;
    background: var(--ac-bg);
    border: 1px solid var(--ac-border);
    border-top: none;
    border-radius: 0 0 var(--ac-radius) var(--ac-radius);
    box-shadow: var(--ac-shadow);
    max-height: 400px;
    overflow-y: auto;
    z-index: var(--ac-z-index);
}

/* Items - COMPACT STYLE */
.ac-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;          /* Keskeny padding! */
    cursor: pointer;
    transition: background-color 0.1s;
    border-bottom: none;        /* Nincs border */
    line-height: 1.3;
}

.ac-item:hover,
.ac-item-active {
    background: var(--ac-bg-hover);
}

/* Trending item highlight */
.ac-item-trending {
    background: var(--ac-trending-bg);
}

.ac-item-trending:hover,
.ac-item-trending.ac-item-active {
    background: #ffe8dc;
}

/* Search icon before each item */
.ac-item::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 10px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Trending fire icon (replaces search icon) */
.ac-item-trending::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff6b35'%3E%3Cpath d='M12 2c-1.5 4-2 5-2 6 0 2.2 1.8 4 4 4s4-1.8 4-4c0-1-0.5-2-2-6-0.5 1-1 2-2 3-1-1-1.5-2-2-3zm0 18c-3.3 0-6-2.7-6-6 0-1.8 0.8-3.5 2.2-4.7 0.8 1.2 2.2 2 3.8 2 2.2 0 4-1.8 4-4 0-0.5-0.1-1-0.2-1.4C18.6 7.5 20 10 20 14c0 3.3-2.7 6-6 6z'/%3E%3C/svg%3E");
}

/* Item text */
.ac-item-text {
    flex: 1;
    font-size: var(--ac-font-size);
    color: var(--ac-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlighted/matched text - BOLD */
.ac-item-text strong {
    color: var(--ac-highlight);
    font-weight: 700;
}

/* NEW: Trending badge */
.ac-trending-badge {
    display: inline-block;
    font-size: 12px;
    margin-left: 4px;
    color: var(--ac-trending-color);
    animation: pulse 2s ease-in-out infinite;
    cursor: help;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Count badge (optional) */
.ac-item-count {
    margin-left: 10px;
    font-size: 11px;
    color: #999;
}

/* No results */
.ac-no-results {
    padding: 10px 12px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Scrollbar */
.ac-dropdown::-webkit-scrollbar {
    width: 6px;
}

.ac-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Mobile */
@media (max-width: 480px) {
    .ac-item {
        padding: 8px 12px;
    }

    :root {
        --ac-font-size: 15px;
    }

    .ac-trending-badge {
        font-size: 14px;
    }
}
