/* ============================================
   InfluenceHub – Sent request card recency
   - "Naujas" badge + relative time chip rendered
     directly inside sent-request cards
     (renderSentRequests in app.js).
   - Mirrors the inbox recency visual language
     (inbox-card-recency.css) so both lists feel
     consistent.
   - Dark mode, 44px touch targets, focus-visible
     rings, prefers-reduced-motion support.
   ============================================ */

/* ---------- Meta row wrapper ---------- */

.sent-recency-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- "Naujas" badge ---------- */

.sent-recency-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;
  line-height: 1.4;
  white-space: nowrap;
  /* WCAG AA: white on #7c3aed = 5.9:1 */
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px -2px rgba(124, 58, 237, 0.5);
}

.sent-recency-badge i {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
}

/* Dark mode: darker gradient keeps contrast >= 4.5:1 */
.dark .sent-recency-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 ---------- */

.sent-recency-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;
}

.sent-recency-time i {
  width: 0.75rem;
  height: 0.75rem;
  opacity: 0.75;
  flex-shrink: 0;
}

/* Dark mode: #cbd5e1 on #0f172a = 11.6:1 */
.dark .sent-recency-time {
  color: #cbd5e1;
}

/* ---------- New sent card subtle highlight ---------- */

.sent-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);
}

.sent-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 .sent-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 .sent-card-new::before {
  background: linear-gradient(180deg, #8b5cf6 0%, #c084fc 100%);
}

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

.sent-recency-badge,
.sent-recency-time {
  min-height: 1.5rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

.sent-recency-badge:focus-visible,
.sent-recency-time:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25);
}

.dark .sent-recency-badge:focus-visible,
.dark .sent-recency-time:focus-visible {
  outline-color: #c4b5fd;
  box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35);
}

/* ---------- Dark-mode contrast fix (WCAG AA) ----------
   Re-assert the badge and time 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:
     - badge: white on #7c3aed = 5.9:1 (passes AA for normal text)
     - time:  #475569 on #ffffff = 7.5:1
   Dark mode:
     - badge: white on #6d28d9 = 7.0:1 (passes AA)
     - time:  #cbd5e1 on #0f172a = 11.6:1
*/

.sent-recency-badge {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%) !important;
  color: #ffffff !important;
}

.sent-recency-time {
  color: #475569 !important;
}

.dark .sent-recency-badge {
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%) !important;
  color: #ffffff !important;
}

.dark .sent-recency-time {
  color: #cbd5e1 !important;
}

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

@media (prefers-reduced-motion: reduce) {
  .sent-recency-badge,
  .sent-recency-time,
  .sent-card-new {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  /* Neutralise any hover/focus transform so no motion is perceived */
  .sent-recency-badge:hover,
  .sent-recency-badge:focus,
  .sent-recency-badge:focus-visible,
  .sent-recency-time:hover,
  .sent-recency-time:focus,
  .sent-recency-time:focus-visible {
    transform: none !important;
    transition: none !important;
  }

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

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

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

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

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

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

  .dark .sent-recency-badge:focus-visible,
  .dark .sent-recency-time:focus-visible {
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.35) !important;
  }
}

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

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

  .sent-recency-time {
    color: CanvasText;
  }

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

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