/* ============================================
   InfluenceHub – Inbox birthday count badge
   - Enhances the "Gimtadieniai" filter chip in the
     influencer inbox tabs with a live count badge.
   - The chip is hidden entirely when the influencer
     has zero birthday requests.
   - Badge pulses subtly when the count increases
     (respects prefers-reduced-motion).
   - Dark mode, 44px touch targets, focus-visible
     rings, forced-colors support.
   ============================================ */

/* ---------- Chip base (extends .inbox-tab-birthday) ---------- */

.inbox-tab-birthday {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

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

/* ---------- Count badge ---------- */

.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);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

/* When the chip is active, invert the badge so it stays legible on the
   violet gradient background. */
.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-birthday-count-badge {
  background: #a78bfa;
  color: #1e1b4b;
  box-shadow: 0 1px 3px rgba(167, 139, 250, 0.45);
}

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

/* ---------- Pulse animation on count increase ---------- */

.inbox-birthday-count-badge.is-bumped {
  animation: inbox-birthday-count-bump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes inbox-birthday-count-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);
  }
}

/* ---------- 44px touch target for the chip ---------- */

#inbox-tabs .inbox-tab-birthday {
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

#inbox-tabs .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 .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-birthday-count-badge {
    transition: none !important;
  }

  .inbox-birthday-count-badge.is-bumped {
    animation: none !important;
  }
}

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

@media (forced-colors: active) {
  .inbox-birthday-count-badge {
    background: Highlight;
    color: HighlightText;
    border: 1px solid HighlightText;
    box-shadow: none;
  }

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