/* ============================================
   InfluenceHub – Catalog empty state action buttons
   focus-visible ring + 44px touch target
   - Reinforces #empty-clear-filters and #empty-show-all
     inside #influencers-empty so keyboard and mobile
     users can reliably recover from a zero-result search.
   - Complements catalog-empty-actions-a11y.css with a
     stronger, always-visible focus ring and guaranteed
     44x44px minimum touch targets (WCAG 2.5.5).
   - Dark mode, prefers-reduced-motion and forced-colors
     support.
   ============================================ */

/* ---------- Base: 44px minimum touch targets ---------- */

#influencers-empty #empty-clear-filters,
#influencers-empty #empty-show-all {
  /* WCAG 2.5.5 – minimum 44x44px touch target for mobile users */
  min-height: 44px;
  min-width: 44px;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* ---------- Focus-visible ring (keyboard) ---------- */

/* High-contrast, always-visible ring for keyboard users. The ring is
   drawn with both an outline and a box-shadow halo so it stays visible
   against the light button background and the dark-mode surface. */
#influencers-empty #empty-clear-filters:focus-visible,
#influencers-empty #empty-show-all:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
}

/* The primary "Išvalyti filtrus" button uses a dark slate background
   in light mode – add a white inner ring so the violet outline stays
   visible against the dark fill. */
#influencers-empty #empty-clear-filters:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 6px rgba(124, 58, 237, 0.35);
}

/* ---------- Dark mode ---------- */

.dark #influencers-empty #empty-clear-filters:focus-visible,
.dark #influencers-empty #empty-show-all:focus-visible {
  outline-color: #c4b5fd;
  box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35);
}

/* In dark mode the primary button uses the brand violet fill – add a
   dark inner ring so the light violet outline stays visible. */
.dark #influencers-empty #empty-clear-filters:focus-visible {
  outline-color: #c4b5fd;
  box-shadow:
    0 0 0 2px #0f172a,
    0 0 0 6px rgba(196, 181, 253, 0.45);
}

/* ---------- Fallback for browsers without :focus-visible ---------- */

@supports not selector(:focus-visible) {
  #influencers-empty #empty-clear-filters:focus,
  #influencers-empty #empty-show-all:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
  }

  #influencers-empty #empty-clear-filters:focus {
    box-shadow:
      0 0 0 2px #ffffff,
      0 0 0 6px rgba(124, 58, 237, 0.35);
  }

  .dark #influencers-empty #empty-clear-filters:focus,
  .dark #influencers-empty #empty-show-all:focus {
    outline-color: #c4b5fd;
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35);
  }

  .dark #influencers-empty #empty-clear-filters:focus {
    box-shadow:
      0 0 0 2px #0f172a,
      0 0 0 6px rgba(196, 181, 253, 0.45);
  }
}

/* ---------- Small screens: keep the 44px target when stacked ---------- */

@media (max-width: 480px) {
  #influencers-empty #empty-clear-filters,
  #influencers-empty #empty-show-all {
    min-height: 44px;
    min-width: 44px;
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  #influencers-empty #empty-clear-filters,
  #influencers-empty #empty-show-all {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  /* Neutralise any hover/focus transform so no motion is perceived */
  #influencers-empty #empty-clear-filters:hover,
  #influencers-empty #empty-clear-filters:focus,
  #influencers-empty #empty-clear-filters:active,
  #influencers-empty #empty-show-all:hover,
  #influencers-empty #empty-show-all:focus,
  #influencers-empty #empty-show-all:active {
    transform: none !important;
    transition: none !important;
  }

  /* Keep the focus ring visible but static (no animated halo) */
  #influencers-empty #empty-clear-filters:focus-visible,
  #influencers-empty #empty-show-all:focus-visible {
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25) !important;
  }

  #influencers-empty #empty-clear-filters:focus-visible {
    box-shadow:
      0 0 0 2px #ffffff,
      0 0 0 6px rgba(124, 58, 237, 0.35) !important;
  }

  .dark #influencers-empty #empty-clear-filters:focus-visible,
  .dark #influencers-empty #empty-show-all:focus-visible {
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35) !important;
  }

  .dark #influencers-empty #empty-clear-filters:focus-visible {
    box-shadow:
      0 0 0 2px #0f172a,
      0 0 0 6px rgba(196, 181, 253, 0.45) !important;
  }
}

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

@media (forced-colors: active) {
  #influencers-empty #empty-clear-filters,
  #influencers-empty #empty-show-all {
    border: 1px solid CanvasText;
    color: CanvasText;
    background: Canvas;
  }

  #influencers-empty #empty-clear-filters:hover,
  #influencers-empty #empty-show-all:hover {
    background: Highlight;
    color: HighlightText;
  }

  #influencers-empty #empty-clear-filters:focus-visible,
  #influencers-empty #empty-show-all:focus-visible,
  #influencers-empty #empty-clear-filters:focus,
  #influencers-empty #empty-show-all:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
    background: Highlight;
    color: HighlightText;
  }
}
