/* HOPn Models — Search & filter page */

.search-page-wrap {
    min-height: 50vh;
    padding-bottom: 6rem;
}

.page-search main {
    position: relative;
    z-index: 0;
}

.page-search .hopn-footer {
    position: relative;
    z-index: 1;
}

.page-search .hopn-footer .footer-social {
    gap: 1rem !important;
}

/* Compact bar disabled — filters scroll with page; only navbar stays sticky */
.search-compact-bar {
    display: none !important;
}

.search-compact-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    min-height: 48px;
}

.search-compact-count {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.875rem;
    color: var(--hopn-muted);
}

.search-compact-sort {
    flex: 0 1 150px;
    min-width: 120px;
}

.search-filters-sentinel {
    height: 1px;
    margin: 0;
    pointer-events: none;
}

/* Page grid */
.search-layout {
    align-items: stretch;
}

.search-layout > [class*="col-"] {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.search-sidebar-col {
    position: static;
    align-self: auto;
    max-height: none;
}

.search-results-column {
    flex: 1;
    min-width: 0;
}

/* Toolbar / quick filters */
.search-toolbar {
    background: var(--hopn-surface);
    border: 1px solid var(--hopn-border-subtle);
    border-radius: 12px;
}

.search-results-meta {
    border-top: 1px solid var(--hopn-border-subtle);
}

.search-result-count {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--hopn-cream);
}

.search-meta-actions .search-quick-sort {
    min-width: 150px;
}

.search-meta-actions .form-select {
    background-color: var(--hopn-surface-elevated);
    border-color: var(--hopn-border);
    color: var(--hopn-cream);
}

/* Sidebar filters */
.search-sidebar {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: inherit;
    padding: 1.25rem;
    background: var(--hopn-surface);
    border: 1px solid var(--hopn-border-subtle);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
}

.search-sidebar.hopn-card {
    overflow: hidden;
}

.search-sidebar.hopn-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--hopn-border-subtle);
}

.search-sidebar-title {
    flex-shrink: 0;
    margin-bottom: 1rem;
    color: var(--hopn-cream);
}

.search-sidebar .search-filter-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.search-filter-fields {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.35rem;
    margin-right: -0.35rem;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--hopn-border) 70%, transparent) transparent;
}

.search-filter-fields::-webkit-scrollbar {
    width: 5px;
}

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

.search-filter-fields::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--hopn-border) 75%, transparent);
    border-radius: 999px;
}

.search-filter-fields::-webkit-scrollbar-thumb:hover {
    background: var(--hopn-border);
}

.search-filter-section {
    border-bottom: 1px solid var(--hopn-border-subtle);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.search-filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.search-filter-section-body .form-label {
    margin-bottom: 0.35rem;
    margin-top: 0.25rem;
    color: var(--hopn-cream-muted);
    font-size: 0.85rem;
}

.search-filter-section-body .form-control,
.search-filter-section-body .form-select {
    margin-bottom: 0.75rem;
    background-color: var(--hopn-surface-elevated);
    border-color: var(--hopn-border);
    color: var(--hopn-cream);
}

.search-filter-section-body .form-control:focus,
.search-filter-section-body .form-select:focus {
    background-color: var(--hopn-surface-elevated);
    border-color: var(--hopn-gold);
    color: var(--hopn-cream);
    box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--hopn-gold) 20%, transparent);
}

.search-filter-section-body .form-control:last-child,
.search-filter-section-body .form-select:last-child {
    margin-bottom: 0;
}

.search-filter-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    color: var(--hopn-cream);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.35rem 0;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.search-filter-section-toggle i {
    transition: transform 0.2s;
    opacity: 0.6;
}

.search-filter-section.collapsed .search-filter-section-toggle i {
    transform: rotate(-90deg);
}

.search-filter-section.collapsed .search-filter-section-body {
    display: none;
}

.search-filter-checkgrid {
    display: grid;
    gap: 0.35rem;
}

.search-filter-scroll {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--hopn-border) 70%, transparent) transparent;
}

.search-filter-actions {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--hopn-border-subtle);
    background: var(--hopn-surface);
}

.search-filter-offcanvas .search-filter-actions {
    position: static;
    margin-top: 1rem;
}

/* Quick filter pills */
.search-pills-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.search-pills-row:last-of-type {
    margin-bottom: 0;
}

.search-pills-label {
    flex: 0 0 auto;
    min-width: 4.25rem;
    padding-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--hopn-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.search-pills {
    display: flex;
    gap: 0.4rem;
    padding-block: 0.1rem;
}

.search-pill {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 1px solid var(--hopn-border);
    background: transparent;
    color: var(--hopn-cream-muted);
    border-radius: 999px;
    padding: 0.32rem 0.75rem;
    font-size: 0.78rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.search-pill:hover {
    background: var(--hopn-accent-bg-soft);
    color: var(--hopn-cream);
    border-color: var(--hopn-border-strong);
}

.search-pill.active {
    background: var(--hopn-gold);
    color: var(--hopn-btn-primary-text, #111);
    border-color: var(--hopn-gold);
    font-weight: 600;
}

.search-filter-badge {
    font-size: 0.65rem;
    min-width: 1.25rem;
}

.search-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.search-active-filters.d-none,
.search-active-filters:empty {
    display: none !important;
    margin-bottom: 0;
}

.search-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--hopn-border-strong);
    background: var(--hopn-accent-bg-soft);
    color: var(--hopn-cream);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
}

.search-filter-chip:hover {
    background: var(--hopn-accent-bg-hover);
    color: var(--hopn-cream);
}

.search-filter-chip-clear {
    border-style: dashed;
    opacity: 0.85;
}

/* Results grid */
.search-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: stretch;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.search-result-item > .talent-card {
    flex: 1;
    width: 100%;
}

@media (min-width: 576px) {
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .search-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .search-results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.search-results-grid.search-results-list {
    grid-template-columns: 1fr;
}

.search-result-item-list .talent-card {
    display: flex;
    flex-direction: row;
}

.search-result-item-list .talent-card-cover {
    width: 140px;
    min-width: 140px;
    flex-shrink: 0;
}

.search-result-item-list .talent-card-body {
    flex: 1;
}

.search-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1.25rem;
    min-height: 220px;
    max-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--hopn-surface);
    border: 1px dashed var(--hopn-border);
    border-radius: 12px;
}

.search-empty-state-icon {
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--hopn-accent-bg-soft);
    color: var(--hopn-gold);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.search-skeleton {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 576px) {
    .search-skeleton {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .search-skeleton {
        grid-template-columns: repeat(3, 1fr);
    }
}

.search-skeleton-card {
    height: 280px;
    border-radius: 12px;
    background: linear-gradient(
        90deg,
        var(--hopn-accent-bg-soft) 25%,
        var(--hopn-accent-bg) 50%,
        var(--hopn-accent-bg-soft) 75%
    );
    background-size: 200% 100%;
    animation: searchShimmer 1.2s infinite;
}

@keyframes searchShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.search-filter-offcanvas {
    max-height: 85vh;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background: var(--hopn-surface);
    border-top: 1px solid var(--hopn-border-subtle);
}

.search-filter-offcanvas .offcanvas-body {
    overflow-y: auto;
    padding-bottom: 2rem;
}

.search-filter-offcanvas .search-filter-form {
    display: flex;
    flex-direction: column;
    max-height: none;
}

.search-filter-offcanvas .search-filter-fields {
    overflow: visible;
    flex: none;
}

.search-view-toggle .btn.active {
    background: var(--hopn-gold);
    color: var(--hopn-btn-primary-text, #111);
    border-color: var(--hopn-gold);
}

#searchResultsWrap[aria-busy="true"] #searchResultsContent {
    opacity: 0.45;
    pointer-events: none;
}

/* Talent card consistency on search page */
.search-page .talent-card {
    transition: transform .25s, box-shadow .25s, border-color .25s;
    overflow: hidden;
}

.search-page .talent-card:has(.talent-card-link) {
    cursor: pointer;
}

.search-page .talent-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    font-size: 0;
    line-height: 0;
    color: transparent;
    text-indent: -9999px;
    overflow: hidden;
}

.search-page .talent-card-link:focus-visible {
    outline: 2px solid var(--hopn-gold);
    outline-offset: 2px;
}

.search-page .talent-card:hover,
.search-page .talent-card:has(.talent-card-link:focus-visible) {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
    border-color: rgba(var(--hopn-accent-rgb), 0.35) !important;
}

.search-page .talent-card-body {
    position: relative;
    z-index: 0;
}

.search-page .talent-card-tags {
    min-height: 1.5rem;
}

.search-page .talent-card-actions {
    width: 100%;
    position: relative;
    z-index: 2;
}

.search-page .talent-card .badge.bg-dark-subtle {
    background: var(--hopn-accent-bg-soft) !important;
    color: var(--hopn-cream-muted) !important;
    border: 1px solid var(--hopn-border-subtle);
}

/* Concierge FAB — keep above content, clear of footer */
.page-search .hopn-concierge-fab {
    z-index: 1035;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0));
}

.page-search.has-cookie-banner .hopn-concierge-fab {
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0));
}

body.search-filter-open .hopn-concierge-fab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
    transition: opacity 0.2s, transform 0.2s;
}

/* Theme-safe toolbar inputs */
[data-theme="light"] .search-toolbar,
[data-theme="light"] .search-sidebar,
[data-theme="light"] .search-filter-offcanvas {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .search-pill {
    background: #f8f6f2;
    border-color: rgba(0, 0, 0, 0.12);
    color: #444;
}

[data-theme="light"] .search-pill.active {
    background: var(--hopn-gold);
    color: #111;
}

[data-theme="premium"] .search-sidebar.hopn-card:hover {
    border-color: var(--hopn-border-subtle);
}

@media (max-width: 767.98px) {
    .search-toolbar-meta .search-meta-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-page-header h1 {
        font-size: 1.35rem;
    }

    .search-toolbar {
        padding: 0.75rem !important;
    }

    .search-page-wrap {
        padding-bottom: 7rem;
    }

    .search-pills-label {
        min-width: 3.5rem;
    }
}

/* RTL */
[dir="rtl"] .search-filter-section-toggle i {
    transform: scaleX(-1);
}

[dir="rtl"] .search-filter-fields {
    padding-right: 0;
    padding-left: 0.35rem;
    margin-right: 0;
    margin-left: -0.35rem;
}

[dir="rtl"] .search-result-item-list .talent-card-cover {
    order: 2;
}

.filter-strip-more-link {
    white-space: nowrap;
    font-size: 0.85rem;
}

/* Filter areas scroll with page — only navbar may stay sticky */
.search-toolbar,
.search-quick-filters,
.search-sidebar-col,
.search-sidebar,
.search-compact-bar {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}
