/* ═══════════════════════════════════════════════════════════════════════
   [AXION FRESHNESS v2] — Honest Data Status Badges
   ═══════════════════════════════════════════════════════════════════════

   Badge States:
     .axf-live      — Real API data < 60s old  (green, pulsing dot)
     .axf-delayed   — Real API data 1–15 min   (amber, "Last: HH:MM UTC")
     .axf-stale-v2  — Real API data > 15 min   (dim amber, "Xm ago")
     .axf-sim       — Simulation / no real API  (dark red, no pulse)
     .axf-err       — API unreachable            (red)

   DO NOT USE .axf-live for simulation data. Ever.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── BASE BADGE ─── */
.axf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8px;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
  text-transform: uppercase;
}

/* ─── DOT ─── */
.axf-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* ─── STATUS TEXT ─── */
.axf-status {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8px;
  letter-spacing: 0.4px;
}

/* ─────────────────────────────────────────
   LIVE — Real API, < 60 seconds old
   Green dot pulsing. DO NOT apply to SIM.
───────────────────────────────────────── */
.axf-live {
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.18);
  background: rgba(46, 204, 113, 0.06);
}
.axf-live .axf-dot {
  background: #2ecc71;
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.9), 0 0 12px rgba(46, 204, 113, 0.4);
  animation: axf-live-pulse 1.8s ease-in-out infinite;
}
.axf-live .axf-status {
  color: #2ecc71;
  font-weight: 600;
}

/* ─────────────────────────────────────────
   DELAYED — Real API, 1–15 min old
   Amber with timestamp "Last: HH:MM UTC"
───────────────────────────────────────── */
.axf-delayed {
  color: #f39c12;
  border-color: rgba(243, 156, 18, 0.15);
  background: rgba(243, 156, 18, 0.04);
}
.axf-delayed .axf-dot {
  background: #f39c12;
  opacity: 0.8;
}
.axf-delayed .axf-status {
  color: #f39c12;
}

/* ─────────────────────────────────────────
   STALE — Real API, > 15 min old
   Dim amber with "Xm ago"
───────────────────────────────────────── */
.axf-stale-v2 {
  color: rgba(243, 156, 18, 0.5);
  border-color: rgba(255, 255, 255, 0.04);
}
.axf-stale-v2 .axf-dot {
  background: rgba(243, 156, 18, 0.4);
}
.axf-stale-v2 .axf-status {
  color: rgba(243, 156, 18, 0.5);
}

/* ─────────────────────────────────────────
   SIM — Simulation / Math.random() data
   Dark red. No pulse. Honest label.
───────────────────────────────────────── */
.axf-sim {
  color: rgba(255, 100, 80, 0.7);
  border-color: rgba(255, 80, 60, 0.15);
  background: rgba(255, 60, 40, 0.04);
}
.axf-sim .axf-dot {
  background: rgba(255, 80, 60, 0.5);
  /* No animation — simulation data should not pulse like live data */
}
.axf-sim .axf-status {
  color: rgba(255, 100, 80, 0.7);
  font-weight: 400;
}

/* ─────────────────────────────────────────
   ERR — Endpoint unreachable
───────────────────────────────────────── */
.axf-err {
  color: rgba(255, 42, 85, 0.6);
  border-color: rgba(255, 42, 85, 0.12);
}
.axf-err .axf-dot {
  background: rgba(255, 42, 85, 0.5);
}
.axf-err .axf-status {
  color: rgba(255, 42, 85, 0.6);
}

/* ─────────────────────────────────────────
   LEGACY STATES (backward compatibility)
   Keep these for old .tag-based badges
───────────────────────────────────────── */
.axf-fresh {
  color: #C6E310;
  border-color: rgba(198, 227, 16, 0.15);
  background: rgba(198, 227, 16, 0.04);
}
.axf-fresh .axf-dot {
  background: #C6E310;
  box-shadow: 0 0 6px rgba(198, 227, 16, 0.8), 0 0 12px rgba(198, 227, 16, 0.3);
  animation: axf-pulse 1.5s ease-in-out infinite;
}
.axf-fresh .axf-time  { color: #C6E310; }
.axf-fresh .axf-status { color: #C6E310; font-weight: 600; }

.axf-warm {
  color: #C6E310;
  border-color: rgba(198, 227, 16, 0.08);
}
.axf-warm .axf-dot { background: #C6E310; opacity: 0.7; }
.axf-warm .axf-time { color: rgba(198, 227, 16, 0.85); }
.axf-warm .axf-status { color: rgba(198, 227, 16, 0.85); }

.axf-stale {
  color: var(--t3, #666);
  border-color: rgba(255, 255, 255, 0.04);
}
.axf-stale .axf-dot { background: var(--amber, #f59e0b); opacity: 0.5; }
.axf-stale .axf-time { color: var(--t3, #666); }
.axf-stale .axf-status { color: var(--amber, #f59e0b); opacity: 0.7; }

.axf-dead {
  color: var(--t3, #444);
  opacity: 0.5;
}
.axf-dead .axf-dot { background: var(--coral, #ff2a55); opacity: 0.3; }
.axf-dead .axf-time { color: var(--t3, #444); }
.axf-dead .axf-status { color: var(--coral, #ff2a55); opacity: 0.5; }

/* ─── INLINE TIMESTAMP (no badge wrapper) ─── */
.axf-inline {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8px;
  letter-spacing: 0.3px;
  transition: color 0.3s ease;
}
.axf-inline.axf-fresh  { color: #C6E310; }
.axf-inline.axf-warm   { color: rgba(198, 227, 16, 0.7); }
.axf-inline.axf-stale  { color: var(--t3, #666); }
.axf-inline.axf-dead   { color: var(--t3, #444); opacity: 0.5; }




/* ─── TAG GLOW (legacy) ─── */
.axf-glow {
  animation: axf-tag-glow 2s ease-in-out infinite;
}

/* ─── SUB-TAB DOT ─── */
.sub-tab .axf-sub-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.sub-tab .axf-sub-dot.axf-fresh  { background: #C6E310; box-shadow: 0 0 4px rgba(198, 227, 16, 0.6); }
.sub-tab .axf-sub-dot.axf-warm   { background: #C6E310; opacity: 0.5; }
.sub-tab .axf-sub-dot.axf-stale  { background: var(--amber, #f59e0b); opacity: 0.4; }
.sub-tab .axf-sub-dot.axf-dead   { background: var(--t3, #444); opacity: 0.3; }

/* ─── CHART FRESHNESS FOOTER ─── */
.axf-chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 6px;
  border-top: 1px solid var(--border, #111);
  margin-top: 4px;
}
.axf-chart-source {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 8px;
  color: var(--t3, #555);
  letter-spacing: 0.3px;
}
.axf-chart-source span {
  color: var(--t2, #888);
  margin-left: 4px;
}

/* ─── ANIMATIONS ─── */
@keyframes axf-live-pulse {
  0%, 100% {
    box-shadow: 0 0 4px rgba(46, 204, 113, 0.6), 0 0 8px rgba(46, 204, 113, 0.2);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 8px rgba(46, 204, 113, 1), 0 0 16px rgba(46, 204, 113, 0.5);
    opacity: 0.85;
  }
}

@keyframes axf-pulse {
  0%, 100% {
    box-shadow: 0 0 4px rgba(198, 227, 16, 0.6), 0 0 8px rgba(198, 227, 16, 0.2);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 8px rgba(198, 227, 16, 1), 0 0 16px rgba(198, 227, 16, 0.5);
    opacity: 0.85;
  }
}

@keyframes axf-tag-glow {
  0%, 100% { box-shadow: 0 0 3px rgba(198, 227, 16, 0.3); }
  50%       { box-shadow: 0 0 8px rgba(198, 227, 16, 0.6), 0 0 16px rgba(198, 227, 16, 0.2); }
}
