/* ============================================
   InfluenceHub – Inbox birthday count live badge
   - Reinforces the "Gimtadieniai" chip count badge
     in the influencer inbox tabs.
   - Guarantees the chip is fully hidden (display:none)
     when the influencer has zero birthday requests,
     even if other modules only toggle aria-hidden.
   - Adds a subtle "live" pulse when the count
     increases via influencehub:birthday-request-created.
   - Dark mode, 44px touch targets, focus-visible
     rings, prefers-reduced-motion, forced-colors.
   ============================================ */

/* ---------- Chip hidden state (hard guarantee) ---------- */

#inbox-tabs [data-inbox-tab="birthday"].hidden,
#inbox-tabs [data-inbox-tab="birthday"][aria-hidden="true"] {
  display: none !important;
}

/* ---------- Chip visible state ---------- */

#inbox-tabs [data-inbox-tab="birthday"]:not(.hidden) {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Count badge (reinforces inbox-birthday-count-badge.css) ---------- */

#inbox-tabs [data-inbox-tab="birthday"] .inbox-birthday-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.4rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  /* WCAG AA: white on #7c3aed = 5.9:1 */
  background: #7c3aed;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.35);
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Active chip – invert badge so it stays legible on the violet gradient */
#inbox-tabs [data-inbox-tab="birthday"].inbox-tab-active .inbox-birthday-count-badge {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  box-shadow: none;
}

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

.dark #inbox-tabs [data-inbox-tab="birthday"] .inbox-birthday-count-badge {
  background: #a78bfa;
  color: #1e1b4b;
  box-shadow: 0 1px 3px rgba(167, 139, 250, 0.45);
}

.dark #inbox-tabs [data-inbox-tab="birthday"].inbox-tab-active .inbox-birthday-count-badge {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  box-shadow: none;
}

/* ---------- Live pulse on count increase ---------- */

#inbox-tabs [data-inbox-tab="birthday"] .inbox-birthday-count-badge.is-bumped {
  animation: inbox-birthday-count-live-bump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes inbox-birthday-count-live-bump {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.55);
  }
  40% {
    transform: scale(1.18);
    box-shadow: 0 0 0 6px rgba(124, 58, 237, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
  }
}

/* ---------- Focus-visible ring ---------- */

#inbox-tabs [data-inbox-tab="birthday"]:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
}

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

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

@media (prefers-reduced-motion: reduce) {
  #inbox-tabs [data-inbox-tab="birthday"] .inbox-birthday-count-badge {
    transition: none !important;
  }

  #inbox-tabs [data-inbox-tab="birthday"] .inbox-birthday-count-badge.is-bumped {
    animation: none !important;
  }
}

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

@media (forced-colors: active) {
  #inbox-tabs [data-inbox-tab="birthday"] .inbox-birthday-count-badge {
    background: Highlight;
    color: HighlightText;
    border: 1px solid HighlightText;
    box-shadow: none;
  }

  #inbox-tabs [data-inbox-tab="birthday"].inbox-tab-active .inbox-birthday-count-badge {
    background: HighlightText;
    color: Highlight;
    border-color: Highlight;
  }
}
