﻿/* Search page ---------------------------------------------------- */
.search-page {
    --bg: #f3f6ff;
    --panel: #ffffff;
    --text: #0d1324;
    --muted: #5b678a;
    --primary: #7c5dff;
    --primary-contrast: #2a1f55;
    --accent: #1ac6ff;
    --danger: #ff5e7a;
    --ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.search {
    background: linear-gradient(135deg, #fafdff 0%, #edf1ff 65%, #e1e9ff 100%);
    color: var(--text);
}

body.search .site-header {
    z-index: 40;
}

.search-page .primary {
    background: linear-gradient(
        135deg,
        var(--primary-contrast),
        var(--primary)
    );
    box-shadow: 0 18px 40px rgba(42, 31, 85, 0.25);
}

.search-page .secondary {
    background: rgba(42, 31, 85, 0.9);
    border-color: rgba(124, 93, 255, 0.35);
    color: #fff;
    box-shadow: 0 10px 25px rgba(42, 31, 85, 0.25);
}

.search-page .ghost {
    border-color: rgba(42, 31, 85, 0.35);
    color: var(--primary-contrast);
}

.search-page .site-header {
    margin-bottom: clamp(1.2rem, 4vw, 2.2rem);
}

.search-page .site-header .header-meta {
    font-size: 0.78rem;
}

.search-page .site-nav .landing-link--active {
    color: var(--primary);
}

.search-shell {
    width: min(100%, 1200px);
    margin: clamp(1.5rem, 4vw, 2.5rem) auto clamp(2rem, 5vw, 3.5rem);
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 5vw, 3.5rem);
    position: relative;
    z-index: 2;
}

/* Hero ----------------------------------------------------------- */
.search-hero {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) minmax(220px, 1fr);
    gap: clamp(1.5rem, 4vw, 2.5rem);
    align-items: stretch;
    flex-wrap: wrap;
}

@media (max-width: 960px) {
    .search-hero {
        grid-template-columns: 1fr;
    }
}

.hero-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-radius: 30px;
    padding: clamp(1.5rem, 4vw, 2.4rem);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95),
        rgba(245, 249, 255, 0.9)
    );
    border: 1px solid rgba(124, 93, 255, 0.15);
    box-shadow: 0 20px 60px rgba(27, 39, 94, 0.12);
}

.hero-card__cta {
    align-self: flex-start;
    margin-top: 0.5rem;
}

.search-page .hero-demo-banner {
    border-radius: 22px;
    border: 1px dashed rgba(124, 93, 255, 0.35);
    padding: 0.9rem 1.1rem;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.search-page .hero-demo-banner__stats {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.search-page .hero-demo-banner__stats strong {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--primary);
}

.search-page .hero-demo-banner small {
    color: var(--muted);
}

.search-page .hero-demo-banner--compact {
    margin-top: 0.5rem;
}

.search-page [data-search-demo][data-demo-empty="true"] {
    opacity: 0.6;
}

.hero-card .hero-points {
    display: grid;
    gap: 0.45rem;
    padding-left: 1.2rem;
    list-style: disc;
    color: var(--muted);
}

.hero-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.hero-insight {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(124, 93, 255, 0.12);
    box-shadow: 0 16px 45px rgba(22, 33, 74, 0.1);
}

.hero-insight strong {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.hero-insight span {
    color: var(--muted);
}

.search-coverage {
    border-radius: 26px;
    padding: 1.2rem 1.4rem;
    border: 1px solid rgba(124, 93, 255, 0.15);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 50px rgba(22, 33, 92, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.coverage-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--muted);
}

.coverage-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(20px, 1fr));
    gap: 0.4rem;
}

.coverage-dot {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: rgba(124, 93, 255, 0.25);
    animation: coveragePulse 4s ease-in-out infinite;
    transform-origin: center;
}

.coverage-dot--medium {
    background: rgba(124, 93, 255, 0.4);
}

.coverage-dot--strong {
    background: rgba(122, 226, 255, 0.8);
    box-shadow: 0 0 16px rgba(122, 226, 255, 0.8);
}

.coverage-dot--low {
    background: rgba(124, 93, 255, 0.15);
}

.coverage-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--muted);
}

/* Search panel --------------------------------------------------- */
.search-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border-radius: 32px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(124, 93, 255, 0.15);
    box-shadow: 0 30px 80px rgba(25, 38, 92, 0.12);
}

.search-panel[data-sticky] {
    position: relative;
}

@media (min-width: 1100px) {
    .search-panel[data-sticky] {
        position: relative;
        top: auto;
        max-height: none;
        overflow: visible;
    }
}

.search-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-form label {
    font-weight: 600;
    letter-spacing: 0.05em;
}

.search-input {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-radius: 999px;
    background: rgba(124, 93, 255, 0.08);
    border: 1px solid rgba(124, 93, 255, 0.2);
    padding: 0.4rem 0.8rem 0.4rem 1.2rem;
}

.search-input input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 0.65rem 0;
    font-size: 1.05rem;
    color: var(--text);
}

.search-input input:focus {
    outline: none;
}

.search-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: flex-start;
}

.filter-status {
    border: 1px solid rgba(124, 93, 255, 0.18);
    border-radius: 18px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-status legend {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.filter-brand,
.filter-dates {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-brand select,
.filter-dates input {
    border-radius: 14px;
    border: 1px solid rgba(124, 93, 255, 0.25);
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
}

.search-status {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted);
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.filter-chip {
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    border: 1px solid rgba(124, 93, 255, 0.25);
    background: var(--muted);
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-chip--demo {
    border-color: rgba(26, 198, 255, 0.5);
    background: rgba(26, 198, 255, 0.12);
    color: var(--primary-contrast);
}

.filter-chip--demo.is-active {
    background: rgba(26, 198, 255, 0.22);
}

.filter-chip:hover,
.filter-chip:focus-visible,
.filter-chip.is-active {
    background: rgba(124, 93, 255, 0.12);
}

.search-reset {
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

/* Results -------------------------------------------------------- */
.campaign-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.results-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.campaign-groups {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.campaign-group {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.campaign-group__title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-contrast);
}

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.campaign-card {
    border-radius: 24px;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(124, 93, 255, 0.15);
    box-shadow: 0 16px 45px rgba(22, 33, 74, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    cursor: pointer;
    transition: transform 0.2s var(--ease-smooth),
        box-shadow 0.2s var(--ease-smooth);
}

.campaign-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(22, 33, 74, 0.18);
}

.campaign-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.campaign-card__logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(124, 93, 255, 0.12);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: var(--primary);
}

.campaign-card__tenant {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.campaign-card__meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.campaign-card__slug {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(50, 64, 102, 0.8);
}

.campaign-card__cta {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-pill {
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(124, 93, 255, 0.35);
    color: var(--primary);
}

.status-pill--upcoming {
    border-color: rgba(26, 198, 255, 0.4);
    color: var(--accent);
}

.status-pill--ended {
    border-color: rgba(255, 107, 107, 0.4);
    color: var(--danger);
}

.status-pill--demo {
    border-color: rgba(26, 198, 255, 0.6);
    color: var(--accent);
}

.campaign-card--demo {
    border-color: rgba(26, 198, 255, 0.4);
    box-shadow: 0 24px 60px rgba(42, 31, 85, 0.15);
}

.campaign-groups--skeleton {
    pointer-events: none;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.campaign-card--skeleton {
    border-style: dashed;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.skeleton-line {
    display: block;
    width: 100%;
    height: 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    position: relative;
}

.skeleton-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: skeletonPulse 1.6s infinite;
}

.skeleton-line--short {
    width: 60%;
}

.skeleton-line--long {
    width: 80%;
}

/* Empty state ---------------------------------------------------- */
.empty-state {
    margin-top: 2rem;
    border-radius: 24px;
    border: 1px dashed rgba(124, 93, 255, 0.35);
    padding: clamp(1.5rem, 3vw, 2rem);
    text-align: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 40px rgba(124, 93, 255, 0.05);
}

.empty-state span {
    color: var(--text);
    font-weight: 600;
}

.empty-illustration {
    width: 160px;
    height: 160px;
    position: relative;
}

.empty-illustration__wheel {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(#facc15, #7c5dff, #1ac6ff, #facc15);
    margin: 0 auto;
    animation: spinPreview 6s linear infinite;
}

.empty-illustration__base {
    width: 120px;
    height: 14px;
    border-radius: 999px;
    background: rgba(124, 93, 255, 0.2);
    margin: 0.6rem auto 0;
}

.empty-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Responsive ----------------------------------------------------- */
@media (max-width: 720px) {
    .search-toolbar {
        grid-template-columns: 1fr;
    }

    .campaign-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations ----------------------------------------------------- */
@keyframes skeletonPulse {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes coveragePulse {
    0% {
        transform: scale(0.85);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(0.85);
        opacity: 0.6;
    }
}

@media (prefers-reduced-motion: reduce) {
    .coverage-dot,
    .empty-illustration__wheel {
        animation: none;
    }
}
