/* ══════════════════════════════════════════════════════════════════════
   search.css  —  Search page overrides on top of explore.css
   All place-card, card-body, cat-chip, filter-bar styles come from
   explore.css. Only search-specific layout & component styles are here.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Layout — 50/50 split ────────────────────────────────────────── */

#searchPage .explore-right {
    width: 50%;
    min-width: 0;        /* remove explore's 380px floor */
    min-height: 400px;
}

/* left panel takes the remaining 50% */
#searchPage .explore-left {
    flex: 1 1 50%;
    max-width: 50%;
}

@media (max-width: 1023px) {
    /* on mobile the split collapses to full-width as usual */
    #searchPage .explore-left  { max-width: 100%; flex: 1 1 100%; }
    #searchPage .explore-right { width: 100%; }
}

/* ── Sticky header ──────────────────────────────────────────────── */

.search-sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #0d1117;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ── Autocomplete dropdown ──────────────────────────────────────── */
/* .search-dropdown comes from explore.css — override z so it clears sticky header */
#searchAutocomplete.search-dropdown {
    left: 1rem;
    right: 1rem;
    top: 0;
    z-index: 30;
}

/* ── Active filter chips below filter bar ───────────────────────── */
.search-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 1rem 8px;
}
.search-active-filters.hidden { display: none; }
.search-af-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 6px 3px 10px;
    background: rgba(224,90,43,.15);
    border: 1px solid #E05A2B;
    border-radius: 999px;
    font-size: 11px;
    color: #f2a07d;
}
.search-af-chip button {
    background: none; border: none; color: inherit; cursor: pointer;
    width: 15px; height: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
}

/* ── Results grid — 2-column, matches explore mobile grid ───────── */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 0.75rem 1rem 80px;
}

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

/* In the grid, cards fill their column (no fixed width from explore's card-row) */
.search-results-grid .place-card {
    width: 100%;
    flex-shrink: unset;
}

/* ── Trending guide cards ────────────────────────────────────────── */
.search-guide-card {
    flex: 0 0 200px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform .15s ease;
}
.search-guide-card:hover { transform: translateY(-2px); }
.search-guide-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.search-guide-card-body { padding: 8px 10px 10px; }
.search-guide-card-title {
    font-size: 13px; font-weight: 600; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-guide-card-meta { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 3px; }

/* ── Zero state ─────────────────────────────────────────────────── */
.search-zero {
    grid-column: 1 / -1;
    padding: 48px 16px;
    text-align: center;
    color: rgba(255,255,255,.65);
}
.search-zero h4 { font-size: 16px; margin: 0 0 6px; color: #fff; }
.search-zero p  { font-size: 13px; margin: 0 0 16px; }
.search-related { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.search-related-btn {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    padding: 8px 18px; border-radius: 8px; color: #fff; cursor: pointer; font-size: 13px;
}
.search-related-btn:hover { background: rgba(224,90,43,.15); border-color: #E05A2B; }

/* ── "Search this area" pill ────────────────────────────────────── */
.search-this-area {
    position: absolute;
    top: 14px; left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: #E05A2B;
    color: white;
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 5;
    white-space: nowrap;
}
.search-this-area.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.search-this-area.hidden { display: none; }

/* popup-v2 styles come from explore.css — no overrides needed here */

/* ══════════════════════════════════════════════════════════════════
   LIGHT MODE  (html:not(.dark))
   ══════════════════════════════════════════════════════════════════ */

html:not(.dark) .search-sticky-header {
    background: rgba(255,255,255,.97);
    border-bottom-color: rgba(0,0,0,.07);
}
html:not(.dark) #searchAutocomplete.search-dropdown {
    background: #fff;
    border-color: rgba(0,0,0,.08);
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
html:not(.dark) .search-af-chip {
    background: rgba(224,90,43,.10); border-color: #E05A2B; color: #b8451f;
}
html:not(.dark) .search-guide-card {
    background: #fff; border-color: rgba(0,0,0,.08);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
html:not(.dark) .search-guide-card-title { color: #111827; }
html:not(.dark) .search-guide-card-meta  { color: rgba(0,0,0,.55); }
html:not(.dark) .search-zero h4 { color: #111827; }
html:not(.dark) .search-zero   { color: rgba(0,0,0,.6); }
html:not(.dark) .search-related-btn {
    background: #fff; border-color: rgba(0,0,0,.10); color: #111827;
}
html:not(.dark) .search-related-btn:hover {
    background: rgba(224,90,43,.08); border-color: #E05A2B;
}
/* popup-v2 light mode handled by explore.css .dark / html:not(.dark) rules */
