/* ── FOMO Ticker Bar — Task #1319523 ──────────────────────────────────────
   Dark scrolling activity ticker below the sticky header.
   Pure CSS marquee (no JS scroll), 60fps on mobile.
   prefers-reduced-motion: ticker pauses, messages stay static.
   ─────────────────────────────────────────────────────────────────────── */

/* ── Container ────────────────────────────────────────────────────── */
#fomo-ticker {
  position: relative;
  z-index: 890;
  width: 100%;
  background: #0f172a;
  border-bottom: 1px solid rgba(212,175,55,0.25);
  overflow: hidden;
  height: 34px;
  display: flex;
  align-items: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* Compensate for sticky header so ticker is always visible below it */
}

/* ── Inner track — the scrolling strip ───────────────────────────── */
.fomo-ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: 0;
  /* Infinite marquee: duplicated set of messages scrolls seamlessly */
  animation: fomoScroll 60s linear infinite;
  will-change: transform;
}

/* ── Each message pill ────────────────────────────────────────────── */
.fomo-ticker-msg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 0 1.5rem 0 0;
  cursor: default;
}

.fomo-ticker-msg a {
  color: #f0c040;
  text-decoration: none;
  transition: color 0.15s;
}
.fomo-ticker-msg a:hover { color: #ffd700; }

/* Numbers / highlights */
.fomo-ticker-num {
  color: #f0c040;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Separator dot between messages */
.fomo-ticker-sep {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(212,175,55,0.5);
  margin: 0 1.25rem;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── LIVE pulse indicator ─────────────────────────────────────────── */
.fomo-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 0 1rem 0 0.85rem;
  margin-right: 0.35rem;
  border-right: 1px solid rgba(212,175,55,0.3);
  position: relative;
  z-index: 2;
  background: #0f172a;
  /* Stays fixed at left while track scrolls */
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 3;
}

.fomo-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
  animation: fomoLivePulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* Flash brighter when new activity fires */
.fomo-live-dot--flash {
  background: #4ade80;
  box-shadow: 0 0 0 6px rgba(74,222,128,0);
  animation: fomoLiveFlash 0.6s ease-out forwards, fomoLivePulse 2s ease-in-out 0.6s infinite;
}

/* ── Keyframes ────────────────────────────────────────────────────── */
@keyframes fomoScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes fomoLivePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

@keyframes fomoLiveFlash {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.8); }
  100% { box-shadow: 0 0 0 10px rgba(74,222,128,0); }
}

/* Float-up "+1" animation when a new claim fires */
@keyframes fomoFloatUp {
  0%   { opacity: 1; transform: translateY(0); }
  80%  { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(-18px); }
}

.fomo-plus-one {
  display: inline-block;
  animation: fomoFloatUp 1s ease-out forwards;
  color: #4ade80;
  font-weight: 800;
  font-size: 0.7rem;
  margin-left: 2px;
  vertical-align: super;
  pointer-events: none;
}

/* ── prefers-reduced-motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .fomo-ticker-track {
    animation: none;
  }
  .fomo-live-dot {
    animation: none;
    box-shadow: none;
  }
  .fomo-live-dot--flash {
    animation: none;
  }
}

/* ── Mobile compact ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  #fomo-ticker {
    height: 30px;
  }
  .fomo-ticker-msg {
    font-size: 0.72rem;
  }
  .fomo-live-badge {
    font-size: 0.65rem;
    padding: 0 0.7rem 0 0.65rem;
  }
}

/* ── Settlement Urgency Badges — Task #1319523 ────────────────────
   Countdown badges on settlement detail pages.
   ─────────────────────────────────────────────────────────────────── */

/* Base urgency badge */
.sr-urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

/* < 7 days — yellow "Closing Soon" */
.sr-urgency-badge--yellow {
  background: #fef3c7;
  color: #92400e;
  border: 1.5px solid #fbbf24;
}

/* < 3 days — red pulsing */
.sr-urgency-badge--red {
  background: #fef2f2;
  color: #991b1b;
  border: 1.5px solid #f87171;
  animation: srBadgePulse 1.8s ease-in-out infinite;
}

/* < 24 hours — solid red "CLOSES TODAY" */
.sr-urgency-badge--critical {
  background: #dc2626;
  color: #fff;
  border: 1.5px solid #b91c1c;
  animation: srBadgePulse 1.2s ease-in-out infinite;
}

/* Closed — gray */
.sr-urgency-badge--closed {
  background: #f3f4f6;
  color: #6b7280;
  border: 1.5px solid #d1d5db;
  opacity: 0.85;
}

@keyframes srBadgePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .sr-urgency-badge--red,
  .sr-urgency-badge--critical { animation: none; }
}

/* Countdown timer inside badge */
.sr-urgency-countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.03em;
}

/* ── Capacity / Filling Up bar — Task #1319523 ────────────────────── */
.sr-capacity-wrap {
  margin-top: 0.75rem;
}
.sr-capacity-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
}
.sr-capacity-bar-track {
  background: #f3f4f6;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.sr-capacity-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #22c55e 0%, #f59e0b 60%, #ef4444 90%);
  transition: width 0.6s ease;
}
.sr-capacity-bar-fill--critical {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
  animation: srCapacityPulse 1.5s ease-in-out infinite;
}

@keyframes srCapacityPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

@media (prefers-reduced-motion: reduce) {
  .sr-capacity-bar-fill--critical { animation: none; }
}

/* ── "X people filed today" micro badge on settlement cards ─────── */
.sr-card-filed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #059669;
  background: #d1fae5;
  border-radius: 10px;
  padding: 2px 7px;
  margin-left: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Pulsing "File Now" CTA when < 24h ───────────────────────────── */
.sr-cta-urgent-pulse {
  animation: srCtaPulse 1.4s ease-in-out infinite;
}

@keyframes srCtaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}
