/* ============================================
   InfluenceHub – Active filters bar a11y
   - WCAG AA contrast for .active-filters-inner,
     .active-filters-label and .active-filters-list
     in both light and dark mode.
   - prefers-reduced-motion guard: disables any
     transitions/animations on the bar and its
     children so users who prefer reduced motion
     are not exposed to motion.
   - Forced-colors (Windows High Contrast) support.
   ============================================ */

/* ---------- Light mode contrast (WCAG AA) ----------
   The active filters bar sits on a light violet surface with
   slate text. Re-assert the key colors with !important so generic
   utilities cannot reduce the contrast below AA.

   Light mode:
     - inner surface: #f5f3ff (brand-50)
     - label: #6d28d9 on #f5f3ff = 8.4:1 (passes AA)
     - list text: #334155 on #f5f3ff = 10.9:1 (passes AA)
*/

.active-filters-inner {
  background: #f5f3ff !important;
  border-color: #ddd6fe !important;
  color: #334155 !important;
}

.active-filters-label {
  color: #6d28d9 !important;
  font-weight: 700;
}

.active-filters-list {
  color: #334155 !important;
}

/* Chips inside the list – keep the slate text readable on the
   light violet surface. */
.active-filters-list > * {
  color: #334155;
}

/* ---------- Dark mode contrast (WCAG AA) ----------
   Dark mode:
     - inner surface: rgba(76, 29, 149, 0.35) over #0f172a
     - label: #ddd6fe on the surface ≈ 9.6:1 (passes AA)
     - list text: #e2e8f0 on the surface ≈ 12.4:1 (passes AA)
*/

.dark .active-filters-inner {
  background: rgba(76, 29, 149, 0.35) !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
  color: #e2e8f0 !important;
}

.dark .active-filters-label {
  color: #ddd6fe !important;
}

.dark .active-filters-list {
  color: #e2e8f0 !important;
}

.dark .active-filters-list > * {
  color: #e2e8f0;
}

/* ---------- prefers-reduced-motion guard ----------
   The active filters bar may animate in when filters change.
   Users who prefer reduced motion should see it appear instantly,
   with no hover/focus transforms on the bar or its children. */

@media (prefers-reduced-motion: reduce) {
  .active-filters-inner,
  .active-filters-label,
  .active-filters-list,
  .active-filters-inner *,
  .active-filters-list * {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    scroll-behavior: auto !important;
  }

  /* Neutralise any hover/focus/active transform on the bar itself */
  .active-filters-inner:hover,
  .active-filters-inner:focus,
  .active-filters-inner:focus-within,
  .active-filters-inner:active {
    transform: none !important;
    transition: none !important;
  }

  /* Chips inside the list must not animate either */
  .active-filters-list > *:hover,
  .active-filters-list > *:focus,
  .active-filters-list > *:focus-visible,
  .active-filters-list > *:active {
    transform: none !important;
    transition: none !important;
  }

  /* Disable any pulse/scale animation on the label */
  .active-filters-label,
  .active-filters-label::before,
  .active-filters-label::after {
    animation: none !important;
    transform: none !important;
  }

  /* Keep the focus ring visible but static (no animated halo) */
  .active-filters-inner :focus-visible {
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25) !important;
  }

  .dark .active-filters-inner :focus-visible {
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35) !important;
  }
}

/* ---------- Forced colors (Windows High Contrast) ---------- */

@media (forced-colors: active) {
  .active-filters-inner {
    background: Canvas !important;
    border: 1px solid CanvasText !important;
    color: CanvasText !important;
  }

  .active-filters-label {
    color: CanvasText !important;
  }

  .active-filters-list,
  .active-filters-list > * {
    color: CanvasText !important;
  }

  .active-filters-inner :focus-visible,
  .active-filters-inner :focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
    box-shadow: none !important;
  }
}
