/* ========================================
   Search Suggest / Autocomplete Dropdown
   ======================================== */

.search-suggest {
    position: relative;
    width: 100%;
}

.search-suggest__list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: 320px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.search-suggest__list.is-visible {
    display: block;
    animation: suggestFadeIn 0.15s ease-out;
}

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

.search-suggest__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.12s ease;
    font-size: 0.9rem;
    color: #333;
}

.search-suggest__item:hover,
.search-suggest__item.is-active {
    background-color: #f0f4ff;
}

.search-suggest__item-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: #6b7280;
    width: 20px;
    text-align: center;
}

.search-suggest__item:hover .search-suggest__item-icon,
.search-suggest__item.is-active .search-suggest__item-icon {
    color: var(--brand-primary, #0A66C2);
}

.search-suggest__item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: #1a1a2e;
}

.search-suggest__item-type {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #64748b;
}

/* Type-specific coloring */
.search-suggest__item[data-index] .search-suggest__item-type {
    /* Default is neutral — JS sets data-type if needed */
}

/* Scrollbar styling */
.search-suggest__list::-webkit-scrollbar {
    width: 5px;
}

.search-suggest__list::-webkit-scrollbar-track {
    background: transparent;
}

.search-suggest__list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

/* Ensure proper stacking above search bar elements */
.jobs-search {
    position: relative;
}

.search-bar {
    position: relative;
}

/* ── Responsive adjustments ────────────────────────── */
@media (max-width: 768px) {
    .search-suggest__list {
        border-radius: 8px;
        max-height: 250px;
    }

    .search-suggest__item {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .search-suggest__item-type {
        font-size: 0.65rem;
        padding: 1px 6px;
    }
}
