/* ======================================================
   SEARCH AUTOCOMPLETE MODULE (v4, без hint)
   Reusable Google-style autocomplete suggestions.
   Attaches elements to <body> to avoid clipping, high z-index.
   ====================================================== */

/* ---------- Suggestion dropdown ---------- */
.search-suggestions {
    position: fixed;          /* JS задаст координаты */
    top: 0;
    left: 0;
    width: auto;
    min-width: 220px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(32, 33, 36, 0.28);
    border: 1px solid #dadce0;
    max-height: 360px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    padding: 6px 0;
    margin: 0;
    list-style: none;
    font-family: Arial, sans-serif;
}

.search-suggestions.visible {
    display: block;
    animation: searchSuggestionsFadeIn 0.15s ease-out;
}

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

/* ---------- Individual suggestion item ---------- */
.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #202124;
    line-height: 1.3;
    user-select: none;
    transition: background 0.1s ease;
    border-radius: 0;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background: #f1f3f4;
}

.search-suggestion-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    font-size: 12px;
}

.search-suggestion-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.search-suggestion-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestion-meta {
    font-size: 12px;
    color: #70757a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestion-arrow {
    flex-shrink: 0;
    margin-left: auto;
    color: #9aa0a6;
    font-size: 12px;
}

/* ---------- Mobile adjustments ---------- */
@media (max-width: 768px) {
    .search-suggestion-item {
        padding: 6px 10px;
        font-size: 13px;
    }
    .search-suggestion-meta {
        font-size: 11px;
    }
}