/*
 * isa-filter-v1.css — the search filter (phone overlay, /all-escorts sidebar,
 * active-filter chips, results states, pagination, top phone bar buttons).
 * Every colour comes from isa-theme-v1.css. Load this AFTER common-new.css,
 * tailwind.css and all-escorts.css so it wins.
 * Phone first: base rules are for phones, wider screens are added below.
 */

/* ---------- shared bits ---------- */
.isa-sr {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.isa-flt :focus-visible,
.isa-side :focus-visible,
.isa-tags :focus-visible,
.isa-pages :focus-visible,
.isa-topbtn:focus-visible,
.isa-state :focus-visible {
  outline: 3px solid var(--flt-focus);
  outline-offset: 2px;
}
body.isa-flt-lock { overflow: hidden; }

/* ---------- phone top bar buttons (Menu / Filters / Galleries / Search) ---------- */
.isa-topbtn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 48px; min-height: 44px; padding: 0 4px;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.isa-topbtn-icon { position: relative; display: block; width: 24px; height: 24px; }
.isa-topbtn-icon img { width: 24px; height: 24px; display: block; }
.isa-flt-dot {
  position: absolute; top: -2px; right: -6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--flt-ok);
}
.isa-flt-dot[hidden] { display: none; }
#global-search-input-mobile { font-size: 16px; }   /* no iOS zoom */

/* ---------- the phone overlay ---------- */
.isa-flt {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; flex-direction: column;
  background: var(--flt-bg); color: var(--flt-text);
  font-size: 15px; line-height: 1.35;
  transform: translateX(-100%);
  transition: transform .25s ease-out;
  visibility: hidden;
}
.isa-flt.is-open { transform: none; visibility: visible; }
.isa-flt[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .isa-flt { transition: none; } }
@media (min-width: 1024px) { .isa-flt { display: none !important; } }

.isa-flt-head {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px;
  padding-top: max(6px, env(safe-area-inset-top));
  background: var(--flt-head);
  border-bottom: 1px solid var(--flt-border);
}
.isa-flt-hright { display: flex; gap: 6px; }
.isa-flt-hbtn {
  min-height: 44px; min-width: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--flt-btn); color: #fff;
  border: 0; border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.isa-flt-hbtn-go { background: var(--flt-accent); color: var(--flt-accent-fg); }
@media (hover: hover) {
  .isa-flt-hbtn:hover { background: var(--flt-btn-hover); }
  .isa-flt-hbtn-go:hover { background: var(--flt-accent-hover); color: var(--flt-accent-fg); }
}
.isa-flt-body { flex: 1 1 auto; min-height: 0; display: flex; }

.isa-flt-foot {
  flex-shrink: 0;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: var(--flt-foot);
  border-top: 1px solid var(--flt-border);
  text-align: center;
}
.isa-flt-note { margin: 0 0 6px; font-size: 14px; color: var(--flt-muted); }
.isa-flt-go {
  width: 100%; min-height: 48px;
  background: var(--flt-accent); color: var(--flt-accent-fg);
  border: 0; border-radius: 8px;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.isa-flt-go:active { filter: brightness(.95); }
@media (hover: hover) {
  .isa-flt-go:hover { background: var(--flt-accent-hover); color: var(--flt-accent-fg); }
}
/* very narrow phones: shorter labels on the top bar */
@media (max-width: 359px) {
  .isa-flt-hbtn { padding: 0 8px; }
  .isa-flt-hide-xs { display: none; }
}
/* phone turned sideways: keep the top+bottom bars small (list gets the room) */
@media (max-height: 500px) {
  .isa-flt-foot { display: none; }
  .isa-flt-head { padding-top: 4px; padding-bottom: 4px; }
}

/* ---------- the panel (used by the overlay AND the desktop sidebar) ---------- */
.flt-panel { display: flex; width: 100%; min-height: 0; flex: 1 1 auto; }
.flt-groups {
  width: 40%; flex-shrink: 0;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--flt-groups);
  border-right: 1px solid var(--flt-border);
}
.flt-groups ul { list-style: none; margin: 0; padding: 0; }
.flt-group {
  width: 100%; min-height: 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px 8px 14px;
  background: none; color: var(--flt-group-text);
  border: 0; border-bottom: 1px solid var(--flt-panel);
  font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.flt-group[aria-current="true"] { background: var(--flt-active); color: #fff; font-weight: 600; }
@media (hover: hover) { .flt-group:hover { background: var(--flt-active); } }
.flt-badge {
  flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--flt-ok); color: #fff; font-size: 13px; font-weight: 700;
}
.flt-badge[hidden] { display: none; }

.flt-switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px; padding: 8px 10px 8px 14px;
  background: var(--flt-head); color: #fff;
  border-bottom: 1px solid var(--flt-panel);
  font-size: 15px; cursor: pointer;
}
.flt-switch {
  appearance: none; -webkit-appearance: none;
  position: relative; flex-shrink: 0;
  width: 46px; height: 28px; margin: 0; border-radius: 14px;
  background: var(--flt-off); cursor: pointer;
  transition: background .15s;
}
.flt-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  transition: transform .15s;
}
.flt-switch:checked { background: var(--flt-ok); }
.flt-switch:checked::after { transform: translateX(18px); }
.flt-switch:focus-visible { outline: 3px solid var(--flt-focus); outline-offset: 2px; }

.flt-more {
  width: 100%; min-height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 8px 14px;
  background: var(--flt-panel); color: var(--flt-group-text);
  border: 0; border-bottom: 1px solid var(--flt-border);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left;
}
.flt-more-arrow { transition: transform .15s; }
.flt-more[aria-expanded="true"] .flt-more-arrow { transform: rotate(180deg); }
.flt-more-list[hidden] { display: none; }

.flt-options {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--flt-panel);
}
.flt-options-title {
  margin: 0; padding: 10px 12px 4px;
  font-size: 14px; font-weight: 600; color: var(--flt-muted);
}
.flt-search {
  display: block; margin: 6px 10px; width: calc(100% - 20px); box-sizing: border-box;
  min-height: 44px; padding: 8px 12px;
  background: var(--flt-input-bg); color: #fff;
  border: 2px solid var(--flt-input-border); border-radius: 6px;
  font: inherit; font-size: 16px;  /* 16px = no iOS zoom */
}
.flt-search::placeholder { color: var(--flt-muted); }
.flt-search[hidden] { display: none; }
.flt-list {
  list-style: none; margin: 0; padding: 4px 6px 12px;
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
}
.flt-list li[hidden] { display: none; }
.flt-opt {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 6px 8px; margin-bottom: 2px;
  border-radius: 8px; color: var(--flt-text);
  font-size: 15px; cursor: pointer;
}
.flt-opt input {
  flex-shrink: 0; width: 20px; height: 20px; margin: 0;
  accent-color: var(--isa-theme); cursor: pointer;
}
.flt-opt-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.flt-opt-count { flex-shrink: 0; color: var(--flt-muted); font-size: 14px; }
.flt-opt.is-on { background: var(--flt-selected); color: #fff; font-weight: 600; }
.flt-opt.is-on .flt-opt-count { color: var(--flt-text); }
@media (hover: hover) { .flt-opt:hover { background: var(--flt-border); } .flt-opt.is-on:hover { background: var(--flt-selected); } }
.flt-msg { margin: 16px 12px; font-size: 14px; color: var(--flt-muted); text-align: center; }
.flt-msg[hidden] { display: none; }
.flt-msg-error { color: var(--flt-error); }
.flt-retry {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0 16px;
  background: var(--flt-btn); color: #fff; border: 0; border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}

/* phone sideways: the group list does not need 40% */
@media (max-height: 500px) and (orientation: landscape) {
  .flt-groups { width: 32%; }
  .flt-group, .flt-more, .flt-switch-row { min-height: 44px; }
}

/* ---------- desktop sidebar on /all-escorts ---------- */
.isa-side { display: none; }
@media (min-width: 1024px) {
  .isa-side {
    display: flex; flex-direction: column;
    width: 30%; flex-shrink: 0; align-self: flex-start;
    position: sticky; top: calc(var(--main-nav-height, 58px) + var(--summary-bar-height, 50px) + 8px);
    height: calc(100vh - var(--main-nav-height, 58px) - var(--summary-bar-height, 50px) - 24px);
    max-height: 640px; min-height: 360px;
    background: var(--isa-red-dark);
    border-radius: 2px; overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .3);
    z-index: 10;
  }
  .isa-side .flt-panel { min-height: 0; }
  .isa-side .flt-groups { width: 42%; }
  .isa-side .flt-group, .isa-side .flt-more, .isa-side .flt-switch-row { font-size: 14px; min-height: 44px; }
  .isa-side .flt-opt { font-size: 14px; min-height: 40px; }
}
.isa-side-head {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 12px; background: var(--isa-red); color: var(--isa-main);
  font-size: 14px;
}
.isa-side-clear {
  min-height: 44px; padding: 0 8px;
  background: none; border: 0; border-radius: 6px;
  color: var(--isa-main); font: inherit; font-size: 14px; cursor: pointer;
}
@media (hover: hover) { .isa-side-clear:hover { background: var(--isa-li-dark); color: var(--isa-amber); } }
.isa-side-head b { color: var(--isa-amber); }

/* ---------- /all-escorts: summary bar on phones ---------- */
@media (max-width: 1023.98px) {
  #isa-sumbar { margin-top: 77px; }  /* room for the fixed phone top bar */
}
#isa-count-line { font-size: 14px; }
#isa-count-line b { color: var(--isa-amber); font-weight: 600; }
@media (min-width: 640px) { #isa-count-line { font-size: 18px; } }
#isa-sumbar .summary-bar-select { min-height: 44px; font-size: 14px; }
#isa-sumbar .summary-bar-checkbox { width: 20px; height: 20px; }
#main-search-input { font-size: 16px; min-height: 40px; }
#isa-sumbar .summary-bar-checkbox-label { font-size: 14px; }
#isa-sumbar #hide-unavailable-checkbox + label { padding: 10px 0; }

/* ---------- active filter chips (only /all-escorts) ---------- */
.isa-tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 8px; color: var(--flt-text);
}
.isa-tags[hidden] { display: none; }
.isa-tag {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 36px; max-width: 100%;
  padding: 0 0 0 12px; border-radius: 6px;
  background: var(--flt-tag-bg); color: var(--flt-tag-fg);
  font-size: 14px; line-height: 1.2;
}
.isa-tag-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.isa-tag-x {
  width: 44px; height: 44px; margin: -4px 0;  /* 44px tap area, chip still looks 36px */
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 6px;
  color: var(--flt-tag-x); font-size: 22px; line-height: 1; cursor: pointer;
}
.isa-tags-clear {
  min-height: 44px; padding: 0 14px; margin-left: auto;
  background: var(--flt-btn); color: #fff; border: 0; border-radius: 6px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
@media (hover: hover) { .isa-tags-clear:hover { background: var(--flt-btn-hover); } }

/* ---------- results: empty / error / loading ---------- */
.isa-state { text-align: center; padding: 32px 16px; }
.isa-state[hidden] { display: none; }
.isa-state p { margin: 0 0 8px; font-size: 16px; color: var(--isa-main); }
.isa-state .isa-state-sub { font-size: 14px; color: var(--flt-muted); }
.isa-state-error p { color: var(--flt-error); }
.isa-state button {
  min-height: 44px; margin-top: 8px; padding: 0 20px;
  background: var(--flt-accent); color: var(--flt-accent-fg);
  border: 0; border-radius: 8px;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
#profiles-list-container.is-loading { opacity: .5; transition: opacity .15s; }
#page-main-heading { scroll-margin-top: 140px; }
@media (min-width: 1024px) { #page-main-heading { scroll-margin-top: 120px; } }

/* ---------- pagination ---------- */
.isa-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.isa-pages .pagination-button {
  min-width: 44px; min-height: 44px; padding: 0 12px;
  font-size: 15px;
}
.isa-pages .pagination-button[aria-current="page"] { background: var(--isa-main); color: #000; cursor: default; }
.isa-pages-gap { padding: 0 4px; color: var(--flt-muted); }
