/* ==========================================================================
   Elequate Hub — shared mobile "Filters" component (Pattern C)
   --------------------------------------------------------------------------
   Chrome borrowed from the OLC avatar dropdown (olc.html .profile-dropdown /
   .dropdown-head / .dropdown-cohort-title): --bg-deep #0d1e36 card, 16px radius,
   fade+scale-in animation, 10.5px caps section labels, cyan #2AABE2 accents.

   Scope: mobile-first. Pages mount this ONLY at <=700px and keep their existing
   desktop filter rows; the component simply isn't rendered on desktop. Every
   selector here is prefixed .filters-* / .fm-* so nothing leaks onto existing
   page selectors (.stats-row, .data-table, etc.).

   Paired module: shared/filters-menu.js  (window.ElequateFilters)
   ========================================================================== */

/* ── Trigger button — 48px pill ─────────────────────────────────────────── */
.filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 24px;                               /* 48px pill */
  background: var(--bg-deep, #0d1e36);
  border: 1px solid rgba(42, 171, 226, 0.35);        /* cyan-tinted */
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.filters-btn:hover { border-color: rgba(42, 171, 226, 0.6); }
.filters-btn:focus-visible {
  outline: 2px solid #2AABE2;
  outline-offset: 2px;
}
.filters-btn .filters-ico { color: #2AABE2; flex-shrink: 0; }

/* Active-count badge — hidden when 0 (JS toggles [hidden]) */
.filters-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #2AABE2;
  color: #0d1e36;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.filters-count[hidden] { display: none; }

/* ── Scrim ──────────────────────────────────────────────────────────────── */
.filters-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  animation: fmScrimIn 0.18s ease;
}
.filters-scrim[hidden] { display: none; }

/* ── Bottom sheet ───────────────────────────────────────────────────────── */
.filters-menu {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-height: min(70dvh, 560px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-deep, #0d1e36);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  /* safe-area breathing room above the home indicator */
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  transform-origin: bottom center;
  z-index: 1000;
  animation: fmIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.filters-menu[hidden] { display: none; }

@keyframes fmIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fmScrimIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Sections ───────────────────────────────────────────────────────────── */
.fm-section { margin-bottom: 20px; }
.fm-section:last-of-type { margin-bottom: 0; }

/* Section label — same recipe as olc.html .dropdown-cohort-title */
.fm-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

/* Section body — the page injects its own controls here */
.fm-body { display: block; }

/* ── Segmented control (full-width) ─────────────────────────────────────── */
.fm-seg {
  display: flex;
  width: 100%;
  padding: 4px;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}
.fm-seg button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.fm-seg button.active {
  background: #2AABE2;
  color: #fff;
  font-weight: 600;
}

/* ── Chip row ───────────────────────────────────────────────────────────── */
.fm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fm-chip {
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;                               /* 34px pill chip */
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.fm-chip.active {
  background: #2AABE2;
  border-color: #2AABE2;
  color: #0d1e36;
  font-weight: 600;
}

/* ── Styled select (not the native look) ────────────────────────────────── */
.fm-select {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 40px 0 14px;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* custom cyan chevron so it isn't the native control */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232AABE2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.15s ease;
}
.fm-select:hover, .fm-select:focus { border-color: rgba(42, 171, 226, 0.6); outline: none; }
.fm-select option { background: #0d1e36; color: #fff; }

/* ── Footer actions ─────────────────────────────────────────────────────── */
.fm-footer {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.fm-reset {
  flex: 1;
  height: 48px;
  border-radius: 24px;                               /* 48px pill */
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fm-reset:hover { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.04); }
.fm-apply {
  flex: 2;
  height: 48px;
  border-radius: 24px;                               /* 48px pill */
  background: #2AABE2;
  border: 0;
  color: #0d1e36;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(42, 171, 226, 0.35);   /* cyan glow */
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.fm-apply:hover { filter: brightness(1.06); box-shadow: 0 8px 26px rgba(42, 171, 226, 0.45); }
.fm-reset:focus-visible, .fm-apply:focus-visible {
  outline: 2px solid #2AABE2;
  outline-offset: 2px;
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .filters-menu { animation: none; }
  .filters-scrim { animation: none; }
}
