/* Profile-search pill — drop-in cross-profile typeahead.
 * Mounts wherever a `.profile-search` element exists. */

.profile-search {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 320px;
    max-width: 100%;
}
.profile-search-input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: var(--white, #fff);
    font: 500 0.875rem/1 'DM Sans', system-ui, sans-serif;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.profile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}
.profile-search-input:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
}
.profile-search-input:focus {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}
.profile-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
}
.profile-search-pop {
    /* Fixed positioning so the dropdown escapes ancestor overflow:hidden
     * (e.g. .hero on profile pages). JS sets --pop-top / --pop-right from
     * the input's viewport rect on focus, and re-positions on resize. */
    position: fixed;
    top: var(--pop-top, 56px);
    right: var(--pop-right, 16px);
    width: 420px;
    max-width: calc(100vw - 32px);
    z-index: 1100;
    background: #0e1230;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
    max-height: 380px;
    overflow-y: auto;
    display: none;
    padding: 6px;
}
.profile-search.is-open .profile-search-pop {
    display: block;
}
.profile-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--white, #fff);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.3;
}
.profile-search-row:hover,
.profile-search-row.is-active {
    background: rgba(139, 92, 246, 0.14);
}
.profile-search-row .name {
    font-weight: 500;
    flex: 0 0 auto;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-search-row .sub {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 480px) {
    .profile-search-row .sub { display: none; }
}
.profile-search-row .type {
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}
.profile-search-row .type.t-investor  { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.profile-search-row .type.t-university{ background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.profile-search-row .type.t-sector    { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.profile-search-row .type.t-city      { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.profile-search-row .type.t-country   { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.profile-search-row .type.t-region    { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.profile-search-row .type.t-person    { background: rgba(34, 211, 238, 0.15); color: #67e8f9; }
.profile-search-empty {
    padding: 16px 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8125rem;
    text-align: center;
}
@media (max-width: 720px) {
    .profile-search { width: 100%; flex: 1 1 auto; }
    /* On mobile, span the dropdown to the viewport edges (overrides the
     * desktop right-anchor + 420px width). */
    .profile-search-pop {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: 60vh;
    }
}
