/* ==========================================================================
   Member search (search.php): one big field, filters in a panel (a bottom
   sheet on phones), active filters as chips, results as rows or photo cards.
   Tokens from styles/modern.css; rows reuse .bc-row (styles/lists.css).
   ========================================================================== */

.bc-search { min-width: 0; max-width: 1080px; margin: 0 auto; padding: 0 4px; }

/* ---------- Hero with the search field ---------- */
.bc-search-hero {
  position: relative;
  margin: 0 0 18px;
  padding: 24px 24px 20px;
  border-radius: var(--bc-r-lg, 22px);
  background:
    radial-gradient(110% 140% at 100% 0%, rgba(3, 195, 227, 0.11), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(91, 75, 209, 0.08), transparent 60%),
    var(--bc-surface, #fff);
  box-shadow: var(--bc-shadow-2), 0 0 0 1px var(--bc-line);
}
.bc-search-title {
  margin: 0 !important;
  color: var(--bc-ink, #0b0b10);
  font-size: clamp(24px, 3vw, 32px) !important;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.bc-search-lead { margin: 6px 0 16px; color: var(--bc-muted, #6b6b76); font-size: 14px; }

.bc-search-bar { display: flex; align-items: stretch; gap: 8px; }
.bc-search-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  margin: 0;
  border-radius: 16px;
  background: var(--bc-surface, #fff);
  box-shadow: inset 0 0 0 1px var(--bc-line-strong), 0 1px 2px rgba(16, 16, 30, 0.04);
  transition: box-shadow 0.2s var(--bc-ease, ease);
}
.bc-search-field:focus-within { box-shadow: inset 0 0 0 1.5px var(--bc-accent, #5b4bd1), var(--bc-ring); }
.bc-search-field > i { position: absolute; left: 18px; color: var(--bc-faint, #9a9aa5); font-size: 16px; pointer-events: none; }
.bc-search-field input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 48px;
  border: 0 !important;
  outline: none;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--bc-ink, #0b0b10);
  font-size: 17px;
  font-weight: 500;
  -webkit-appearance: none;
  appearance: none;
}
.bc-search-field input::placeholder { color: var(--bc-faint, #9a9aa5); font-weight: 400; }
.bc-search-field input::-webkit-search-cancel-button { cursor: pointer; }

.bc-search-filterbtn,
.bc-search-go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s var(--bc-ease, ease), transform 0.15s var(--bc-ease, ease), box-shadow 0.2s var(--bc-ease, ease);
}
.bc-search-filterbtn { background: var(--bc-surface-2, #f6f6f8); color: var(--bc-ink-2, #3a3a44); box-shadow: inset 0 0 0 1px var(--bc-line); }
.bc-search-filterbtn:hover { background: var(--bc-surface-3, #eeeef2); }
.bc-search-filterbtn[aria-expanded="true"] { background: var(--bc-accent-soft, rgba(91, 75, 209, 0.1)); color: var(--bc-accent, #5b4bd1); box-shadow: inset 0 0 0 1px rgba(91, 75, 209, 0.25); }
.bc-search-filterbtn:focus-visible, .bc-search-go:focus-visible { outline: none; box-shadow: var(--bc-ring); }
.bc-search-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bc-accent, #5b4bd1);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}
.bc-search-go { background: var(--bc-ink, #0b0b10); color: var(--bc-on-ink); }
.bc-search-go:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(16, 16, 30, 0.6); }
.bc-search-go i { font-size: 12px; }

/* ---------- Filter panel ---------- */
.bc-search-panel {
  margin-top: 14px;
  padding: 18px;
  border-radius: 18px;
  background: var(--bc-surface-2, #f6f6f8);
  box-shadow: inset 0 0 0 1px var(--bc-line);
}
.bc-search-panel[hidden] { display: none !important; }
.bc-search-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.bc-search-fieldrow { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bc-search-fieldrow label,
.bc-search-status legend {
  margin: 0;
  color: var(--bc-muted, #6b6b76);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bc-search-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--bc-surface, #fff) !important;
  box-shadow: inset 0 0 0 1px var(--bc-line-strong) !important;
  color: var(--bc-ink, #0b0b10);
  font-size: 14px;
  outline: none;
  transition: box-shadow 0.2s var(--bc-ease, ease);
}
select.bc-search-input { padding-right: 32px; }
.bc-search-input:focus { box-shadow: inset 0 0 0 1.5px var(--bc-accent, #5b4bd1), var(--bc-ring) !important; }

.bc-search-status { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.bc-search-status legend { float: none; width: auto; margin-bottom: 6px; }
.bc-chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.bc-chip-radio { position: relative; margin: 0; cursor: pointer; }
.bc-chip-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bc-chip-radio span {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--bc-surface, #fff);
  box-shadow: inset 0 0 0 1px var(--bc-line-strong);
  color: var(--bc-ink-2, #3a3a44);
  font-size: 13px;
  font-weight: 550;
  transition: background-color 0.2s var(--bc-ease, ease), color 0.2s var(--bc-ease, ease);
}
.bc-chip-radio input:checked + span { background: var(--bc-ink, #0b0b10); box-shadow: none; color: var(--bc-on-ink); }
.bc-chip-radio input:focus-visible + span { box-shadow: var(--bc-ring); }

.bc-search-check { display: inline-flex; align-items: center; gap: 10px; margin: 16px 0 0; cursor: pointer; color: var(--bc-ink-2, #3a3a44); font-size: 14px; font-weight: 500; }
.bc-search-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bc-search-checkbox {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--bc-surface-3, #e3e3ea);
  box-shadow: inset 0 0 0 1px var(--bc-line-strong);
  transition: background-color 0.2s var(--bc-ease, ease);
}
.bc-search-checkbox::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bc-surface);
  box-shadow: 0 1px 3px rgba(16, 16, 30, 0.25);
  transition: transform 0.2s var(--bc-ease, ease);
}
.bc-search-check input:checked + .bc-search-checkbox { background: var(--bc-accent, #5b4bd1); }
.bc-search-check input:checked + .bc-search-checkbox::after { transform: translateX(16px); }
.bc-search-check input:focus-visible + .bc-search-checkbox { box-shadow: var(--bc-ring); }

.bc-search-panelfoot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 16px; }
.bc-search-clear { color: var(--bc-muted, #6b6b76) !important; font-size: 13px; font-weight: 600; text-decoration: none !important; }
.bc-search-clear:hover { color: var(--bc-ink, #0b0b10) !important; }

/* In the bottom sheet (phones) */
.bc-search-sheet .bc-search-panel { margin: 0; padding: 0; background: none; box-shadow: none; }
.bc-search-sheet .bc-search-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bc-search-sheet .bc-search-fieldrow:nth-child(n+3):nth-child(-n+4) { grid-column: 1 / -1; }
.bc-search-sheet .bc-search-input { height: 46px; font-size: 16px; }
.bc-search-sheet .bc-search-panelfoot {
  position: sticky;
  bottom: -1px;
  margin: 18px -20px -20px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--bc-surface, #fff);
  box-shadow: 0 -1px 0 var(--bc-line);
  justify-content: space-between;
}
.bc-search-sheet .bc-search-panelfoot .bc-btn-soft { flex: 1 1 auto; justify-content: center; height: 46px; font-size: 15px; }
.bc-search-sheet .bc-search-panelfoot .bc-search-clear { flex: 0 0 auto; }
/* jQuery UI suggestions above the sheet */
.ui-autocomplete.ui-front { z-index: 100100 !important; }

/* ---------- Active filter chips ---------- */
.bc-search-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.bc-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bc-accent-soft, rgba(91, 75, 209, 0.1));
  color: var(--bc-accent, #5b4bd1) !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.2s var(--bc-ease, ease);
}
.bc-search-chip:hover { background: rgba(91, 75, 209, 0.17); }
.bc-search-chipkey { color: rgba(91, 75, 209, 0.7); font-weight: 500; }
.bc-search-chipval { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-search-chip i { font-size: 11px; opacity: 0.75; }
.bc-search-chip--clear { background: transparent; color: var(--bc-muted, #6b6b76) !important; }
.bc-search-chip--clear:hover { background: var(--bc-surface-2, #f6f6f8); }

/* ---------- Results ---------- */
.bc-search-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 12px; }
.bc-search-count { margin: 0; color: var(--bc-muted, #6b6b76); font-size: 14px; }
.bc-search-count strong { color: var(--bc-ink, #0b0b10); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bc-search-range { margin-left: 6px; color: var(--bc-faint, #9a9aa5); font-size: 13px; }
.bc-search-tools { display: flex; align-items: center; gap: 8px; }
.bc-search-sort { position: relative; display: inline-flex; align-items: center; margin: 0; }
.bc-search-sort i { position: absolute; left: 12px; color: var(--bc-muted, #6b6b76); font-size: 12px; pointer-events: none; }
.bc-search-sort select {
  height: 38px;
  padding: 0 32px 0 32px;
  border: 0;
  border-radius: 12px;
  background-color: var(--bc-surface, #fff);
  box-shadow: inset 0 0 0 1px var(--bc-line-strong);
  color: var(--bc-ink-2, #3a3a44);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.bc-search-view { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bc-surface-3, #eeeef2); }
.bc-search-view a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  border-radius: 9px;
  color: var(--bc-muted, #6b6b76) !important;
  font-size: 13px;
  text-decoration: none !important;
}
.bc-search-view a.is-active { background: var(--bc-surface, #fff); color: var(--bc-ink, #0b0b10) !important; box-shadow: 0 1px 3px rgba(16, 16, 30, 0.1); }

.bc-search-listcard { margin: 0 0 16px !important; }
.bc-search-listcard .content { margin: 8px 10px !important; }
.bc-search-list { margin: 0; }
.bc-srow { padding: 12px 14px 12px 12px; gap: 14px; }
.bc-srow .bc-row-avatar img, .bc-srow .bc-row-avatar .bc-av { width: 44px !important; height: 44px !important; }
.bc-srow .bc-row-name { font-size: 15px; }
.bc-srow-nick { color: var(--bc-muted, #6b6b76); font-weight: 500; }
.bc-srow-nick::before { content: "\201C"; }
.bc-srow-nick::after { content: "\201D"; }
.bc-srow .bc-row-sub { flex-wrap: nowrap; }
.bc-srow .bc-row-beltname { flex: 0 0 auto; }
.bc-srow-meta { flex: 1 1 auto; min-width: 0; }
.bc-srow-meta::before { content: "·"; margin: 0 6px 0 0; color: var(--bc-faint, #9a9aa5); }
.bc-row-sub > .bc-srow-meta:first-child::before { display: none; }
.bc-srow .bc-status { height: 26px; gap: 6px; padding: 0 10px; font-size: 12px; }
.bc-srow .bc-status i { font-size: 11px; }
/* Belt name hides first in narrow rows; the belt drawing stays */
@container (max-width: 520px) {
  .bc-srow .bc-row-beltname { display: none; }
  .bc-srow-meta::before { display: none; }
}

.bc-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.bc-search-grid .bc-spot { flex: none; width: auto; min-width: 0; }

.bc-search-pages { margin: 8px 0 24px; }
.bc-search-pages .pagination { flex-wrap: wrap; gap: 4px; }

/* Empty result */
.bc-search-emptycard { margin: 0 0 16px !important; }
.bc-search-tips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* ---------- Start state ---------- */
.bc-search-start { margin: 0 4px 24px; }
.bc-search-h2 { margin: 0 0 10px; color: var(--bc-muted, #6b6b76); font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.bc-search-starts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.bc-search-start-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bc-surface, #fff);
  box-shadow: var(--bc-shadow-1), 0 0 0 1px var(--bc-line);
  color: var(--bc-ink, #0b0b10) !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: transform 0.2s var(--bc-ease, ease), box-shadow 0.2s var(--bc-ease, ease);
}
.bc-search-start-item:hover { transform: translateY(-1px); box-shadow: var(--bc-shadow-2), 0 0 0 1px var(--bc-line-strong); }
.bc-search-start-icon { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--bc-accent-soft, rgba(91, 75, 209, 0.1)); color: var(--bc-accent, #5b4bd1); font-size: 14px; }
.bc-search-start-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-search-start-item > .fa-chevron-right { color: var(--bc-faint, #9a9aa5); font-size: 11px; }
.bc-search-hint { margin: 14px 2px 0; color: var(--bc-faint, #9a9aa5); font-size: 13px; }

/* ---------- Phones ---------- */
@media (max-width: 991.98px) {
  .bc-search-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .bc-search { padding: 0; }
  .bc-search-hero { margin: 0 0 14px; padding: 18px 16px 16px; border-radius: 18px; }
  .bc-search-lead { margin-bottom: 14px; font-size: 13.5px; }
  .bc-search-bar { flex-wrap: wrap; }
  .bc-search-field { flex: 1 1 100%; }
  .bc-search-field input { height: 52px; font-size: 16px; }
  .bc-search-filterbtn, .bc-search-go { flex: 1 1 0; height: 46px; border-radius: 14px; }
  .bc-search-chips { flex-wrap: nowrap; overflow-x: auto; margin: 12px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
  .bc-search-chips::-webkit-scrollbar { display: none; }
  .bc-search-chip { flex: 0 0 auto; max-width: 80vw; }
  .bc-search-toolbar { flex-wrap: wrap; margin: 0 2px 10px; }
  .bc-search-range { display: block; margin: 2px 0 0; }
  .bc-search-tools { width: 100%; }
  .bc-search-sort { flex: 1 1 auto; min-width: 0; }
  .bc-search-sort select { width: 100%; }
  .bc-search-listcard .content { margin: 4px 4px !important; }
  .bc-srow { padding: 11px 10px; gap: 12px; }
  .bc-srow-statuslabel { display: none; }
  .bc-srow .bc-status { width: 28px; padding: 0; justify-content: center; }
  .bc-search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bc-search-start { margin: 0 2px 20px; }
  .bc-search-starts { grid-template-columns: minmax(0, 1fr); }
}
