
/* Friendse Smart Search — isolated styles; does not replace the existing theme. */
.fp-smart-search {
    position: relative;
    width: 100%;
    z-index: 120;
}

.fp-smart-search--header {
    width: min(380px, 32vw);
    flex: 0 1 min(380px, 32vw);
    min-width: 0;
    margin-left: .25rem;
}

.fp-smart-search--page {
    width: min(100%, 760px);
    margin: 0 auto;
}

.fp-smart-search__row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 5px 6px 5px 13px;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 15px;
    background: var(--c-surface, #fff);
    box-shadow: 0 5px 22px rgba(15, 23, 42, .06);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.fp-smart-search--page .fp-smart-search__row {
    min-height: 52px;
}

.fp-smart-search__row:focus-within {
    border-color: color-mix(in srgb, var(--c-primary, #4f46e5) 55%, var(--c-border, #e5e7eb));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-primary, #4f46e5) 10%, transparent), 0 8px 28px rgba(15, 23, 42, .08);
}

.fp-smart-search__icon {
    width: 26px;
    flex: 0 0 26px;
    text-align: center;
    font-size: 24px;
    line-height: 1;
    color: var(--c-text-muted, #64748b);
    transform: rotate(-15deg);
    pointer-events: none;
}

.fp-smart-search__input {
    min-width: 0;
    flex: 1 1 auto;
    height: 36px;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: var(--c-text) !important;
    font-size: 14px;
    font-weight: 500;
    box-shadow: none !important;
}

.fp-smart-search--page .fp-smart-search__input {
    font-size: 15px;
}

.fp-smart-search__input::placeholder {
    color: var(--c-text-muted, #64748b);
    opacity: .8;
}

.fp-smart-search__clear,
.fp-smart-search__submit {
    flex: 0 0 auto;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fp-smart-search__clear {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: transparent;
    color: var(--c-text-muted, #64748b);
    font-size: 21px;
}

.fp-smart-search__clear:hover {
    background: var(--c-bg, #f1f5f9);
}

.fp-smart-search__loader {
    width: 15px;
    height: 15px;
    border: 2px solid color-mix(in srgb, var(--c-primary, #4f46e5) 20%, transparent);
    border-top-color: var(--c-primary, #4f46e5);
    border-radius: 50%;
    animation: fp-search-spin .7s linear infinite;
}

@keyframes fp-search-spin { to { transform: rotate(360deg); } }

.fp-smart-search__filter-wrap {
    flex: 0 0 auto;
    border-left: 1px solid var(--c-border, #e5e7eb);
    padding-left: 7px;
}

.fp-smart-search__filter {
    height: 34px;
    max-width: 112px;
    border: 0;
    outline: 0;
    border-radius: 9px;
    padding: 0 26px 0 8px;
    background: var(--c-bg, #f8fafc);
    color: var(--c-text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.fp-smart-search__submit {
    width: 38px;
    height: 36px;
    border-radius: 10px;
    background: var(--c-primary, #4f46e5);
    color: #fff;
    font-size: 0;
}

.fp-smart-search__submit::before {
    content: '⌕';
    font-size: 22px;
    line-height: 1;
    transform: rotate(-15deg);
}

.fp-smart-search__submit:hover {
    filter: brightness(.96);
    transform: translateY(-1px);
}

.fp-smart-search__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: min(560px, 70vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 16px;
    background: var(--c-surface, #fff);
    box-shadow: 0 18px 55px rgba(15, 23, 42, .16);
    padding: 6px;
}

.fp-smart-search--page .fp-smart-search__panel {
    max-height: 520px;
}

.fp-smart-search__panel-head {
    padding: 9px 11px 7px;
    color: var(--c-text-muted, #64748b);
    font-size: 11px;
    font-weight: 600;
}

.fp-smart-search__section + .fp-smart-search__section {
    border-top: 1px solid var(--c-border, #e5e7eb);
}

.fp-smart-search__section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 5px;
    color: var(--c-text-muted, #64748b);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.fp-smart-search__section-title span:last-child {
    opacity: .55;
}

.fp-smart-search__item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 6px 9px;
    border-radius: 11px;
    text-decoration: none !important;
    color: var(--c-text) !important;
}

.fp-smart-search__item:hover,
.fp-smart-search__item.is-active {
    background: color-mix(in srgb, var(--c-primary, #4f46e5) 7%, var(--c-surface, #fff));
}

.fp-smart-search__avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--c-bg, #f1f5f9);
}

.fp-smart-search__avatar--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--c-primary, #4f46e5);
    font-size: 15px;
    font-weight: 800;
}

.fp-smart-search__item-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fp-smart-search__item-copy strong,
.fp-smart-search__item-copy small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-smart-search__item-copy strong {
    font-size: 13px;
    font-weight: 700;
}

.fp-smart-search__item-copy small {
    color: var(--c-text-muted, #64748b);
    font-size: 11px;
}

.fp-smart-search__arrow {
    color: var(--c-text-muted, #64748b);
    font-size: 18px;
    opacity: .55;
}

.fp-smart-search__footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px 7px;
    margin-top: 4px;
    border-top: 1px solid var(--c-border, #e5e7eb);
    background: color-mix(in srgb, var(--c-surface, #fff) 96%, transparent);
    backdrop-filter: blur(10px);
    color: var(--c-text-muted, #64748b);
    font-size: 10px;
}

.fp-smart-search__footer button {
    border: 0;
    background: transparent;
    color: var(--c-primary, #4f46e5);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

/* Search results page */
.fp-explore-search-shell {
    width: 100%;
    margin: 0 auto 18px;
}

.fp-search-summary,
.fp-search-results-card,
.fp-search-empty,
.fp-search-posts-label {
    width: min(100%, 760px);
    margin-left: auto;
    margin-right: auto;
}

.fp-search-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 13px;
    padding: 2px 2px 4px;
}

.fp-search-summary__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--c-primary, #4f46e5);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.fp-search-summary h1 {
    margin: 0;
    color: var(--c-text);
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
}

.fp-search-summary__count {
    flex: 0 0 auto;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 999px;
    padding: 6px 9px;
    color: var(--c-text-muted, #64748b);
    background: var(--c-surface, #fff);
    font-size: 10px;
    font-weight: 700;
}

.fp-search-results-card {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 15px;
    background: var(--c-surface, #fff);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .035);
}

.fp-search-results-card__head,
.fp-search-posts-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.fp-search-results-card__head {
    margin-bottom: 8px;
}

.fp-search-results-card__head h2,
.fp-search-posts-label h2 {
    margin: 0;
    color: var(--c-text);
    font-size: 14px;
    font-weight: 800;
}

.fp-search-results-card__head span,
.fp-search-posts-label span {
    color: var(--c-text-muted, #64748b);
    font-size: 10px;
    font-weight: 700;
}

.fp-search-people-grid,
.fp-search-simple-grid,
.fp-search-video-grid,
.fp-search-market-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.fp-search-person,
.fp-search-simple-item,
.fp-search-video,
.fp-search-market {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 11px;
    text-decoration: none !important;
    color: var(--c-text) !important;
    background: var(--c-bg, #f8fafc);
}

.fp-search-person:hover,
.fp-search-simple-item:hover,
.fp-search-video:hover,
.fp-search-market:hover {
    border-color: color-mix(in srgb, var(--c-primary, #4f46e5) 30%, var(--c-border, #e5e7eb));
    transform: translateY(-1px);
}

.fp-search-person img,
.fp-search-simple-item img {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--c-bg, #f1f5f9);
}

.fp-search-simple-item img { border-radius: 10px; }

.fp-search-person span,
.fp-search-simple-item span,
.fp-search-video span:last-child,
.fp-search-market span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fp-search-person strong,
.fp-search-simple-item strong,
.fp-search-video strong,
.fp-search-market strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.fp-search-person small,
.fp-search-simple-item small,
.fp-search-video small,
.fp-search-market small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--c-text-muted, #64748b);
    font-size: 10px;
}

.fp-search-fallback,
.fp-search-video__icon,
.fp-search-market__icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--c-primary, #4f46e5) 9%, var(--c-bg, #f8fafc));
    font-size: 16px;
}

.fp-search-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.fp-search-hashtags a {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--c-primary, #4f46e5) 8%, var(--c-bg, #f8fafc));
    color: var(--c-primary, #4f46e5) !important;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none !important;
}

.fp-search-posts-label {
    margin-top: 18px;
    margin-bottom: 8px;
}

.fp-search-empty {
    padding: 36px 18px;
    text-align: center;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 15px;
    background: var(--c-surface, #fff);
}

.fp-search-empty__icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--c-primary, #4f46e5) 8%, var(--c-bg, #f8fafc));
    color: var(--c-primary, #4f46e5);
    font-size: 27px;
}

.fp-search-empty h2 { margin: 0 0 3px; font-size: 15px; color: var(--c-text); }
.fp-search-empty p { margin: 0; font-size: 11px; color: var(--c-text-muted, #64748b); }

@media (max-width: 1100px) {
    .fp-smart-search--header { width: min(300px, 27vw); }
}

@media (max-width: 820px) {
    .fp-smart-search--header {
        width: 100%;
        flex: 1 1 auto;
        margin: 0;
    }

    .fp-smart-search--header .fp-smart-search__row {
        min-height: 44px;
    }

    .fp-smart-search--page {
        width: 100%;
    }

    .fp-smart-search__panel {
        position: absolute;
        max-height: 62vh;
        border-radius: 14px;
    }

    .fp-smart-search__footer span { display: none; }
    .fp-smart-search__footer button { width: 100%; text-align: center; }

    .fp-search-people-grid,
    .fp-search-simple-grid,
    .fp-search-video-grid,
    .fp-search-market-grid {
        grid-template-columns: 1fr;
    }

    .fp-search-summary h1 { font-size: 16px; }
    .fp-search-summary { align-items: flex-start; }
}

@media (max-width: 520px) {
    .fp-smart-search__row {
        min-height: 48px;
        padding-left: 10px;
        border-radius: 13px;
    }

    .fp-smart-search--page .fp-smart-search__input {
        font-size: 14px;
    }

    .fp-smart-search__filter {
        max-width: 84px;
        font-size: 11px;
    }

    .fp-smart-search__submit {
        width: 36px;
    }

    .fp-smart-search__panel {
        top: calc(100% + 6px);
        left: -2px;
        right: -2px;
    }

    .fp-search-results-card {
        padding: 10px;
        border-radius: 13px;
    }
}
