/* ==========================================================================
   ValueStats · Search
   ========================================================================== */

.search-page {
    --search-canvas: var(--vs-color-canvas);
    --search-surface: var(--vs-color-surface);
    --search-surface-muted: var(--vs-color-surface-muted);
    --search-border: var(--vs-color-border);
    --search-border-strong: var(--vs-color-border-strong);
    --search-ink: var(--vs-color-ink);
    --search-muted: var(--vs-color-muted);
    --search-primary: var(--vs-color-primary-emphasis);
    min-height: 100vh;
    color: var(--search-ink);
    background: var(--search-canvas);
}

.search-page-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(61, 108, 86, .18);
    background:
        radial-gradient(circle at 82% 12%, rgba(21, 150, 106, .13), transparent 29%),
        linear-gradient(142deg, #f4f7f5 0%, #e7eee9 62%, #dfe9e3 100%);
    box-shadow: 0 10px 28px rgba(25, 52, 38, .08);
}

.search-page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .06;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(8, 74, 49, .3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 74, 49, .3) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: linear-gradient(90deg, #000, transparent 88%);
    mask-image: linear-gradient(90deg, #000, transparent 88%);
}

.search-page-hero::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, #15966a, rgba(21, 150, 106, .18) 42%, transparent 82%);
}

.search-page-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 13.5rem;
    grid-template-columns: minmax(0, .85fr) minmax(25rem, 1fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    width: 100%;
    padding: clamp(1.8rem, 3.4vw, 3.15rem) clamp(1rem, 3.4vw, 3rem);
}

.search-page-hero-copy h1 {
    margin: 0;
    color: #14241b;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 720;
    letter-spacing: -.055em;
    line-height: 1;
}

.search-page-hero-copy p {
    max-width: 37rem;
    margin: .85rem 0 0;
    color: #607168;
    font-size: .9rem;
    line-height: 1.6;
}

.search-page-form {
    min-width: 0;
}

.search-page-form label {
    position: relative;
    display: block;
}

.search-page-form label > svg {
    position: absolute;
    top: 50%;
    left: 1rem;
    width: 1.2rem;
    height: 1.2rem;
    color: #73837a;
    pointer-events: none;
    transform: translateY(-50%);
}

.search-page-form input[type="search"] {
    width: 100%;
    min-height: 3.35rem;
    padding: .7rem 1rem .7rem 3rem;
    border: 1px solid rgba(8, 122, 85, .22);
    border-radius: .42rem;
    color: #26372e;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 12px 30px rgba(25, 55, 39, .08);
    font-size: .88rem;
    outline: none;
}

.search-page-form input[type="search"]:focus {
    border-color: #15966a;
    box-shadow: 0 0 0 3px rgba(21, 150, 106, .12), 0 12px 30px rgba(25, 55, 39, .08);
}

.search-page-form p {
    display: flex;
    gap: .4rem;
    align-items: center;
    margin: .55rem 0 0;
    color: #718078;
    font-size: .66rem;
}

.search-page-form p i {
    color: #15966a;
}

.search-page-shell {
    width: 100%;
    padding: 1rem clamp(.75rem, 1.7vw, 1.5rem) 2.5rem;
}

.search-page-panel {
    overflow: hidden;
    border: 1px solid var(--search-border);
    border-radius: .52rem;
    background: var(--search-surface);
    box-shadow: 0 8px 24px rgba(25, 45, 35, .055), 0 1px 2px rgba(25, 45, 35, .04);
}

.search-page-filters {
    min-height: 3.7rem;
    padding: .65rem .8rem;
    border-bottom: 1px solid var(--search-border);
    background: var(--search-surface-muted);
}

.search-page-filters > div {
    display: flex;
    overflow-x: auto;
    gap: .35rem;
}

.search-page-filters a {
    display: inline-flex;
    min-height: 2.3rem;
    align-items: center;
    padding: .45rem .8rem;
    border: 1px solid transparent;
    border-radius: .3rem;
    color: #607168;
    background: transparent;
    font-size: .73rem;
    font-weight: 680;
    white-space: nowrap;
}

.search-page-filters a:hover {
    color: #075f45;
    background: #eaf4ef;
}

.search-page-filters a.is-active {
    border-color: rgba(8, 122, 85, .16);
    color: #075f45;
    background: #e1f1e9;
}

.search-page-status {
    min-height: 3.2rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--search-border);
    color: var(--search-muted);
    background: var(--search-surface);
}

.search-page-status p {
    margin: 0;
    font-size: .72rem !important;
}

.search-page-results {
    display: grid;
}

.search-page-result {
    border-bottom: 1px solid var(--search-border);
    border-radius: 0 !important;
    background: var(--search-surface) !important;
    box-shadow: none !important;
}

.search-page-result:last-child {
    border-bottom: 0;
}

.search-page-result:hover {
    background: #eff6f2 !important;
}

.search-page-result > a > div,
.search-page-result > div {
    min-height: 4.65rem;
    padding: .6rem 1rem !important;
}

.search-page-result img.h-8,
.search-page-result img.sm\:h-14 {
    width: 2.75rem !important;
    height: 2.75rem !important;
    border: 1px solid var(--search-border) !important;
    border-radius: .34rem !important;
    background: #fff;
    object-fit: contain;
}

.search-page-result h3 {
    color: #1f3027 !important;
    font-size: .82rem !important;
    font-weight: 690 !important;
}

.search-page-result .text-gray-500 {
    color: #73837a !important;
    font-size: .7rem !important;
}

.search-page-result .bg-gray-50 {
    background: transparent !important;
}

.search-page-result .rounded-full,
.search-page-result .rounded-lg {
    border-radius: .25rem !important;
}

.search-page-empty {
    border-radius: 0 !important;
    background: var(--search-surface) !important;
    box-shadow: none !important;
}

.search-page-empty h3 {
    color: var(--search-ink) !important;
}

.search-page-empty p {
    color: var(--search-muted) !important;
}

.search-page-pagination {
    margin-top: 0 !important;
    border-color: var(--search-border) !important;
    background: var(--search-surface-muted) !important;
}

.search-page-pagination nav > * {
    border-radius: 0 !important;
}

.search-page-pagination p {
    color: var(--search-muted) !important;
    font-size: .7rem !important;
}

/* Dark mode */
[data-theme="dark"] .search-page {
    color-scheme: dark;
    background: var(--search-canvas);
}

[data-theme="dark"] .search-page-hero {
    border-bottom-color: rgba(151, 190, 171, .17);
    background:
        radial-gradient(circle at 82% 10%, rgba(52, 211, 153, .15), transparent 28%),
        linear-gradient(142deg, #0b241b 0%, #081c15 62%, #061711 100%);
    box-shadow: 0 12px 32px rgba(3, 18, 13, .18);
}

[data-theme="dark"] .search-page-hero::before {
    opacity: .09;
    background-image:
        linear-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .16) 1px, transparent 1px);
}

[data-theme="dark"] .search-page-hero-copy h1,
[data-theme="dark"] .search-page-result h3,
[data-theme="dark"] .search-page-empty h3 {
    color: #e8f1ec !important;
}

[data-theme="dark"] .search-page-hero-copy p,
[data-theme="dark"] .search-page-form p {
    color: #a9bbb1;
}

[data-theme="dark"] .search-page-form input[type="search"] {
    border-color: rgba(207, 229, 218, .18);
    color: #e1ebe5;
    background: rgba(255, 255, 255, .05);
}

[data-theme="dark"] .search-page-form input[type="search"]::placeholder {
    color: #82958b;
}

[data-theme="dark"] .search-page-filters a {
    color: #9aaca2;
}

[data-theme="dark"] .search-page-filters a:hover,
[data-theme="dark"] .search-page-filters a.is-active {
    border-color: rgba(52, 211, 153, .18);
    color: #9df0c9;
    background: #143526;
}

[data-theme="dark"] .search-page-result:hover {
    background: #13281e !important;
}

[data-theme="dark"] .search-page-result img.h-8,
[data-theme="dark"] .search-page-result img.sm\:h-14 {
    border-color: #344a3e !important;
    background: rgba(255, 255, 255, .92);
}

[data-theme="dark"] .search-page-result .text-gray-500,
[data-theme="dark"] .search-page-result .text-gray-400 {
    color: #91a39a !important;
}

[data-theme="dark"] .search-page-pagination .bg-white,
[data-theme="dark"] .search-page-pagination a,
[data-theme="dark"] .search-page-pagination span {
    border-color: var(--search-border-strong) !important;
    color: #a6b7ae !important;
    background: #101d17 !important;
}

[data-theme="dark"] .search-page-pagination .bg-green-600 {
    color: #071810 !important;
    background: #34d399 !important;
}

@media (max-width: 767px) {
    .search-page-hero-inner {
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
        gap: 1.2rem;
        padding: 1.55rem 1rem 1.7rem;
    }

    .search-page-hero-copy h1 {
        font-size: 2rem;
    }

    .search-page-hero-copy p {
        margin-top: .65rem;
        font-size: .8rem;
        line-height: 1.55;
    }

    .search-page-form input[type="search"] {
        min-height: 3rem;
    }

    .search-page-shell {
        padding: .75rem .6rem 5.5rem;
    }

    .search-page-filters {
        padding: .55rem;
    }

    .search-page-filters > div {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .search-page-filters a {
        justify-content: center;
        padding: .4rem .45rem;
        font-size: .67rem;
    }

    .search-page-status {
        min-height: 2.8rem;
        padding: .7rem .8rem;
    }

    .search-page-result > a > div,
    .search-page-result > div {
        min-height: 4.15rem;
        padding: .5rem .7rem !important;
    }

    .search-page-result img.h-8,
    .search-page-result img.sm\:h-14 {
        width: 2.35rem !important;
        height: 2.35rem !important;
    }

    .search-page-pagination {
        padding: .7rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .search-page * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
