/* live-status — trust-banner that polls /v1/status and shows freshness.
   Reusable across market-specific landing pages. Match the pixel/retro theme
   (sharp 1.5px border, drop-shadow, monospace, color tokens from styles.css). */

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--card-bg);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  box-shadow: 3px 3px 0 var(--ink);
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
}

/* Subtle scan-line texture for tech-cool feel. Animated upward so it never
   feels static, but slow enough not to be distracting. */
.live-status::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.02) 0px,
    rgba(0, 0, 0, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  animation: live-scan 12s linear infinite;
}

@keyframes live-scan {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* Healthy: green dot with expanding glow ring every 2s. */
.live-status-healthy .live-dot {
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: live-pulse-green 2.2s ease-out infinite;
}

@keyframes live-pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
  70%  { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* Degraded: amber, faster pulse to communicate "alert". */
.live-status-degraded .live-dot {
  background: #d97706;
  box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.6);
  animation: live-pulse-amber 1.1s ease-out infinite;
}

@keyframes live-pulse-amber {
  0%   { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

/* Unavailable: red, steady (no animation — broken should feel broken). */
.live-status-unavailable .live-dot {
  background: #dc2626;
  animation: live-blink 1.4s steps(2, jump-none) infinite;
}

@keyframes live-blink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.35; }
}

/* Unknown / loading: grey, steady. */
.live-status-unknown .live-dot,
.live-status-loading .live-dot {
  background: #94a3b8;
}

.live-label {
  font-weight: 800;
  letter-spacing: 0.1em;
  position: relative;
  z-index: 1;
}

.live-status-healthy .live-label     { color: #166534; }
.live-status-degraded .live-label    { color: #9a3412; }
.live-status-unavailable .live-label { color: #991b1b; }
.live-status-unknown .live-label,
.live-status-loading .live-label     { color: var(--ink-soft); }

.live-sep {
  opacity: 0.4;
  position: relative;
  z-index: 1;
}

.live-detail {
  font-weight: 500;
  font-variant-numeric: tabular-nums; /* keeps "142s ago" from jittering */
  position: relative;
  z-index: 1;
}

.live-detail b {
  font-weight: 700;
  color: var(--ink);
}

/* Mini tag like "LIVE" — extra emphasis on the leftmost label. */
.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Banner variant — wider, centered, sits inside the hero. */
.live-banner {
  display: inline-flex;
  margin-top: 18px;
}

/* Mobile: stack details, hide separators that would wrap awkwardly. */
@media (max-width: 540px) {
  .live-status {
    font-size: 11.5px;
    padding: 8px 12px;
    gap: 8px;
  }
  .live-status .live-sep {
    display: none;
  }
}
