/* ============================================
   InfluenceHub – Inbox recency indicators
   - "Naujas" badge for recent requests
   - Relative time chip
   - Subtle highlight for new cards
   - Dark mode + reduced motion support
   ============================================ */

/* ---------- "Naujas" badge ---------- */
.inbox-new-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  /* WCAG AA: white on #7c3aed = 5.9:1, white on #a855f7 = 4.6:1 */
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px -2px rgba(124, 58, 237, 0.5);
  white-space: nowrap;
  line-height: 1.4;
}

.inbox-new-badge i {
  width: 0.75rem;
  height: 0.75rem;
}

/* Dark mode: darker gradient + white text keeps contrast >= 4.5:1
   (white on #6d28d9 = 7.0:1, white on #9333ea = 5.9:1) */
.dark .inbox-new-badge {
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px -2px rgba(109, 40, 217, 0.7);
}

/* ---------- Relative time chip ---------- */
.inbox-relative-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  /* WCAG AA: #475569 on white = 7.5:1 */
  color: #475569;
  white-space: nowrap;
}

.inbox-relative-time i {
  width: 0.75rem;
  height: 0.75rem;
  opacity: 0.75;
}

/* Dark mode: #cbd5e1 on #0f172a = 11.6:1 (well above AA) */
.dark .inbox-relative-time {
  color: #cbd5e1;
}

/* ---------- New card subtle highlight ---------- */
.inbox-card-new {
  position: relative;
  border-color: #ddd6fe;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.08), 0 4px 16px -8px rgba(124, 58, 237, 0.25);
}

.inbox-card-new::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #7c3aed 0%, #a855f7 100%);
}

.dark .inbox-card-new {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.15), 0 4px 16px -8px rgba(139, 92, 246, 0.35);
}

.dark .inbox-card-new::before {
  background: linear-gradient(180deg, #8b5cf6 0%, #c084fc 100%);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .inbox-new-badge,
  .inbox-relative-time,
  .inbox-card-new {
    transition: none !important;
    animation: none !important;
  }

  /* Remove decorative shadow that could imply motion on hover/focus */
  .inbox-new-badge,
  .dark .inbox-new-badge {
    box-shadow: none !important;
  }

  /* Neutralise the highlight stripe animation on new cards */
  .inbox-card-new::before,
  .dark .inbox-card-new::before {
    animation: none !important;
    transition: none !important;
  }

  /* Ensure the badge and time chip never animate on hover/focus either */
  .inbox-new-badge:hover,
  .inbox-new-badge:focus,
  .inbox-relative-time:hover,
  .inbox-relative-time:focus {
    transform: none !important;
    transition: none !important;
  }

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

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

  /* Disable any transform on the relative time chip */
  .inbox-relative-time,
  .inbox-relative-time::before,
  .inbox-relative-time::after {
    animation: none !important;
    transform: none !important;
  }

  /* Disable the highlight stripe pseudo-element entirely */
  .inbox-card-new::before,
  .dark .inbox-card-new::before {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* ---------- Dark-mode contrast fix (WCAG AA) ----------
   The base .inbox-new-badge uses a violet gradient with white text.
   In dark mode the surrounding surface is #0f172a, so we keep the
   darker gradient (#6d28d9 → #9333ea) which yields >= 4.5:1 contrast
   for white text. The relative time chip uses #cbd5e1 on #0f172a
   (11.6:1). This block re-asserts those values with !important so
   they cannot be overridden by generic dark-mode text utilities
   (e.g. html.dark .text-slate-400) that would otherwise reduce
   contrast below AA. */
.dark .inbox-new-badge {
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%) !important;
  color: #ffffff !important;
}

.dark .inbox-relative-time {
  color: #cbd5e1 !important;
}

/* Light mode: ensure the badge text stays white on the violet gradient
   (white on #7c3aed = 5.9:1, white on #a855f7 = 4.6:1). */
.inbox-new-badge {
  color: #ffffff !important;
}

/* Light mode: relative time chip uses #475569 on white (7.5:1). */
.inbox-relative-time {
  color: #475569 !important;
}

/* ---------- Forced colors (Windows High Contrast) ---------- */
@media (forced-colors: active) {
  .inbox-new-badge {
    background: Highlight;
    color: HighlightText;
    border: 1px solid HighlightText;
    box-shadow: none;
  }

  .inbox-relative-time {
    color: CanvasText;
  }

  .inbox-card-new {
    border: 1px solid CanvasText;
    box-shadow: none;
  }

  .inbox-card-new::before {
    background: Highlight;
  }
}
