/* Header search panel: All / Users / Solutions / Requests selector and the
   result lists js/search_overlay.js renders from search_api.php. Black and
   white only; the result rows reuse .search-item from styles/header.css. */

/* The panel scrolls (long result lists, "Load more"); the search box and
   the selector stay at the top. js/search_overlay.js sets the tabs' top
   offset to the search box's height. */
.search-overlay.active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.search-overlay .search-top {
    position: sticky;
    top: 0;
    z-index: 3;
}

#rlSearchTabs.rl-search-tabs {
    position: sticky;
    top: 66px;
    z-index: 2;
    padding-bottom: 10px;
}

.rl-search-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px 0;
    background: var(--light-surface-alt, #f5f5f5);
}

.rl-search-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 9px 6px;
    border: 1px solid #111;
    border-radius: 999px;
    background: transparent;
    color: #111;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.rl-search-tab.is-active {
    background: #111;
    color: #fff;
}

.rl-search-tab:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

@media (min-width: 768px) {
    .rl-search-tabs { padding: 14px 16px 0; }
    .rl-search-tab { flex: 0 0 auto; padding: 9px 22px; }
}

/* search.php: the same selector as links, centred above the results. */
.rl-search-tabs--page {
    background: transparent;
    justify-content: center;
    max-width: 640px;
    margin: 18px auto 0;
    padding: 0;
}

.rl-search-tabs--page .rl-search-tab {
    text-align: center;
    text-decoration: none;
}

.rl-search-tabs--page .rl-search-tab:hover { text-decoration: none; }
.rl-search-tabs--page .rl-search-tab:not(.is-active):hover { background: #f0f0f0; color: #111; }

.rl-search-page {
    padding: 8px 0 24px;
}

.rl-search-pager {
    display: flex;
    gap: 10px;
}

.rl-search-pager .rl-search-load-more {
    text-align: center;
}

.rl-search-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.rl-search-section-head h4 {
    margin: 0 !important;
}

.rl-search-see-all,
.rl-search-load-more,
.rl-search-retry {
    background: transparent;
    border: 0;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px 0;
}

.rl-search-load-more,
.rl-search-retry {
    display: block;
    width: 100%;
    margin: 6px 0 0;
    padding: 12px;
    border: 1px solid #111;
    border-radius: 8px;
    text-decoration: none;
}

.rl-search-load-more[disabled] {
    opacity: .5;
    cursor: default;
}

.search-item.rl-search-user img {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
}

.rl-search-noimg,
.rl-search-request-icon {
    width: 85px;
    height: 65px;
    min-width: 85px;
    border-radius: 6px;
    background: #e9e9e9;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.rl-search-request-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
}

.search-item .rl-search-meta {
    word-break: break-word;
}

.rl-search-verified {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #111;
    border-radius: 999px;
    padding: 0 6px;
    color: #111;
    vertical-align: middle;
}

.rl-search-status {
    padding: 18px 0;
    color: #555;
    font-size: 14px;
    text-align: center;
}

.rl-search-status.is-error {
    color: #b02a37;
}

.search-results.rl-busy-dim .search-section {
    opacity: .55;
    transition: opacity .15s;
}

@media (max-width: 600px) {
    .rl-search-noimg { width: 75px; height: 58px; min-width: 75px; }
}

/* Dark theme */
html.dark .rl-search-tabs { background: var(--dark-bg, #111); }
html.dark .rl-search-tabs--page { background: transparent; }
html.dark .rl-search-tab { border-color: #eee; color: #eee; }
html.dark .rl-search-tab.is-active { background: #fff; color: #111; }
html.dark .rl-search-tabs--page .rl-search-tab:not(.is-active):hover { background: #2b2b2b; color: #eee; }
html.dark .rl-search-tab:focus-visible { outline-color: #fff; }
html.dark .rl-search-see-all,
html.dark .rl-search-load-more,
html.dark .rl-search-retry { color: #eee; border-color: #eee; }
html.dark .rl-search-noimg,
html.dark .rl-search-request-icon { background: #2b2b2b; color: #eee; }
html.dark .rl-search-verified { border-color: #eee; color: #eee; }
html.dark .rl-search-status { color: #aaa; }
html.dark .rl-search-status.is-error { color: #ff8a8a; }
