/* ═══════════════════════════════════════════════════════════════
   search.css — Topbar Search Dropdown
   ═══════════════════════════════════════════════════════════════ */

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px); left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    z-index: 200; overflow: hidden;
    display: none;
}

.search-dropdown.open { display: block; }

.search-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    text-decoration: none; color: inherit;
    transition: background 0.12s; cursor: pointer;
}

.search-result-item:hover,
.search-result-item.focused { background: #f5f3ff; }
.search-result-item:not(:last-child) { border-bottom: 1px solid #f3f4f6; }

.search-result-initial {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), #6d64cc);
    color: white; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.search-result-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.search-result-class { font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.search-empty        { padding: 14px; font-size: 12px; color: var(--text-faint); text-align: center; }
.search-loading      { padding: 14px; font-size: 12px; color: #c4bef5; text-align: center; }

@media (max-width: 768px) {
    /* Make the wrapper look like the input box */
    .topbar-search {
        position: relative;
        display: flex !important;
        align-items: center;
        width: 100%;
        max-width: 100% !important;
        margin: 0 0 0.4rem 0 !important;
        background: #f4f5f7;
        border: 1px solid var(--border-mid);
        border-radius: var(--radius-md);
        padding: 0 12px;
        height: 34px;
        box-sizing: border-box;
        order: 10;
        flex: 0 0 100%;
    }

    /* Icon sits as a flex child — no absolute needed */
    .topbar-search i {
        position: static !important;
        transform: none !important;
        flex-shrink: 0;
        margin-right: 8px;
        color: var(--text-faint);
        font-size: 12px;
        pointer-events: none;
    }

    /* Input fills remaining space, no own border/background */
    .topbar-search input {
        flex: 1;
        height: 100%;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        outline: none;
        font-size: 13px;
        color: var(--text-secondary);
        min-width: 0;
    }

    .topbar-search input:focus {
        background: transparent !important;
        border-color: transparent !important;
    }
}