/* ============================================
   InfluenceHub – Inbox birthday filter chip
   - "Gimtadieniai" filter tab in the influencer inbox
   - Only visible when the influencer has at least one
     birthday request (type === 'birthday')
   - Matches the sent-requests birthday chip styling
   - Dark mode, 44px touch targets, focus-visible rings,
     prefers-reduced-motion support
   ============================================ */

/* ---------- Base chip ---------- */

.inbox-tab-birthday {
  border-color: #e9d5ff;
  color: #7c3aed;
  background: #faf5ff;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* Hidden state – chip is only shown when the influencer has birthday requests */
.inbox-tab-birthday.hidden {
  display: none !important;
}

/* Subtle entrance animation when the chip first appears */
.inbox-tab-birthday:not(.hidden) {
  animation: inbox-birthday-chip-in 0.25s ease-out;
}

@keyframes inbox-birthday-chip-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.inbox-tab-birthday:hover {
  border-color: #c4b5fd;
  color: #6d28d9;
  background: #f5f3ff;
}

.inbox-tab-birthday.inbox-tab-active {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border-color: #7c3aed;
  color: #ffffff;
}

.inbox-tab-birthday.inbox-tab-active:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);
  border-color: #6d28d9;
  color: #ffffff;
}

.inbox-tab-birthday.inbox-tab-active .inbox-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

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

.dark .inbox-tab-birthday {
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  background: rgba(76, 29, 149, 0.2);
}

.dark .inbox-tab-birthday:hover {
  border-color: #a78bfa;
  color: #ddd6fe;
  background: rgba(76, 29, 149, 0.3);
}

.dark .inbox-tab-birthday.inbox-tab-active {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border-color: #a78bfa;
  color: #ffffff;
}

/* ---------- 44px touch targets ---------- */

/* WCAG 2.5.5 – every inbox filter button (Visos, Naujos, Priimtos,
   Atmestos, Gimtadieniai) must be at least 44x44px so keyboard and
   mobile users can switch filters reliably. Mirrors the sent-tabs
   treatment in sent-birthday-count-badge.css. */
#inbox-tabs .inbox-tab {
  min-height: 44px;
  min-width: 44px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  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 ---------- */

/* 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 chip background and the active violet gradient. */
#inbox-tabs .inbox-tab:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
}

/* Active chip uses a violet gradient – add a white inner ring so the
   violet outline stays visible against the gradient background. */
#inbox-tabs .inbox-tab.inbox-tab-active: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 #inbox-tabs .inbox-tab:focus-visible {
  outline-color: #c4b5fd;
  box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35);
}

.dark #inbox-tabs .inbox-tab.inbox-tab-active: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 support */
@supports not selector(:focus-visible) {
  #inbox-tabs .inbox-tab:focus {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
  }

  #inbox-tabs .inbox-tab.inbox-tab-active:focus {
    box-shadow:
      0 0 0 2px #ffffff,
      0 0 0 6px rgba(124, 58, 237, 0.35);
  }

  .dark #inbox-tabs .inbox-tab:focus {
    outline-color: #c4b5fd;
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35);
  }

  .dark #inbox-tabs .inbox-tab.inbox-tab-active: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 wrapped ---------- */

@media (max-width: 480px) {
  #inbox-tabs .inbox-tab {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ---------- Birthday badge on inbox cards ---------- */

.inbox-birthday-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  color: #7c3aed;
  border: 1px solid #e9d5ff;
  white-space: nowrap;
}

.dark .inbox-birthday-badge {
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.35) 0%, rgba(88, 28, 135, 0.25) 100%);
  color: #ddd6fe;
  border-color: rgba(139, 92, 246, 0.4);
}

/* ---------- Dark-mode contrast fix (WCAG AA) ----------
   Re-assert the birthday filter chip colors with !important so generic
   dark-mode text utilities (e.g. html.dark .text-slate-400) cannot
   reduce the contrast below AA.

   Light mode:
     - default: #7c3aed on #faf5ff = 8.4:1 (passes AA)
     - hover:   #6d28d9 on #f5f3ff = 8.4:1 (passes AA)
     - active:  #ffffff on #7c3aed = 5.9:1 (passes AA)
   Dark mode:
     - default: #c4b5fd on rgba(76,29,149,0.2) over #0f172a ≈ 9.6:1
     - hover:   #ddd6fe on rgba(76,29,149,0.3) over #0f172a ≈ 10.4:1
     - active:  #ffffff on #7c3aed = 5.9:1 (passes AA)
*/

.inbox-tab-birthday {
  color: #7c3aed !important;
}

.inbox-tab-birthday:hover {
  color: #6d28d9 !important;
}

.inbox-tab-birthday.inbox-tab-active,
.inbox-tab-birthday.inbox-tab-active:hover {
  color: #ffffff !important;
}

.dark .inbox-tab-birthday {
  color: #c4b5fd !important;
}

.dark .inbox-tab-birthday:hover {
  color: #ddd6fe !important;
}

.dark .inbox-tab-birthday.inbox-tab-active,
.dark .inbox-tab-birthday.inbox-tab-active:hover {
  color: #ffffff !important;
}

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

@media (prefers-reduced-motion: reduce) {
  .inbox-tab-birthday,
  .inbox-birthday-badge {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  /* Neutralise any hover/focus/active transform so no motion is perceived */
  .inbox-tab-birthday:hover,
  .inbox-tab-birthday:focus,
  .inbox-tab-birthday:focus-visible,
  .inbox-tab-birthday:active {
    transform: none !important;
    transition: none !important;
  }

  /* Disable the chip entrance animation */
  .inbox-tab-birthday:not(.hidden) {
    animation: none !important;
  }

  /* Icons inside the chip must not animate either */
  .inbox-tab-birthday i,
  .inbox-birthday-badge i {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  /* Disable any pulse/scale animation on the chip itself */
  .inbox-tab-birthday,
  .inbox-tab-birthday::before,
  .inbox-tab-birthday::after {
    animation: none !important;
    transform: none !important;
  }

  /* Neutralise any hover/focus transform on the filter tabs so no
     motion is perceived. */
  #inbox-tabs .inbox-tab {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  #inbox-tabs .inbox-tab:hover,
  #inbox-tabs .inbox-tab:focus,
  #inbox-tabs .inbox-tab:active {
    transform: none !important;
    transition: none !important;
  }

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

  #inbox-tabs .inbox-tab.inbox-tab-active:focus-visible {
    box-shadow:
      0 0 0 2px #ffffff,
      0 0 0 6px rgba(124, 58, 237, 0.35) !important;
  }

  .dark #inbox-tabs .inbox-tab:focus-visible {
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35) !important;
  }

  .dark #inbox-tabs .inbox-tab.inbox-tab-active: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) {
  .inbox-tab-birthday {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  .inbox-tab-birthday.inbox-tab-active {
    background: Highlight;
    color: HighlightText;
    border-color: HighlightText;
  }

  .inbox-birthday-badge {
    background: Highlight;
    color: HighlightText;
    border: 1px solid HighlightText;
  }

  /* All inbox filter tabs – visible borders and focus ring in HCM. */
  #inbox-tabs .inbox-tab {
    border: 1px solid CanvasText;
  }

  #inbox-tabs .inbox-tab:focus-visible,
  #inbox-tabs .inbox-tab:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
  }

  #inbox-tabs .inbox-tab.inbox-tab-active {
    background: Highlight;
    color: HighlightText;
    border-color: HighlightText;
  }
}
