/* ═══════════════════════════════════════════════════════════════
   PRICE FLASH ENGINE v4.0 — Bloomberg-Like · OmniaCoin
   Prezzi LIVE: flash verde/rosso immediato ad ogni aggiornamento
   ═══════════════════════════════════════════════════════════════ */

.pr, .tkr-p {
  transition: color 0.4s ease-out;
  display: inline-block;
}

/* ── Flash prezzo — verde/rosso netto ── */
@keyframes pfUp {
  0%   { color: #00e68a; background: rgba(0,230,138,.18); border-radius: 3px; }
  30%  { color: #00e68a; background: rgba(0,230,138,.14); }
  100% { color: inherit; background: transparent; }
}
@keyframes pfDn {
  0%   { color: #ff4560; background: rgba(255,69,96,.18); border-radius: 3px; }
  30%  { color: #ff4560; background: rgba(255,69,96,.14); }
  100% { color: inherit; background: transparent; }
}

.pf-up { animation: pfUp 1.8s ease-out forwards !important; }
.pf-dn { animation: pfDn 1.8s ease-out forwards !important; }

/* ── Row highlight ── */
@keyframes pfRowUp {
  0%   { background-color: rgba(0,230,138,0.07); }
  100% { background-color: transparent; }
}
@keyframes pfRowDn {
  0%   { background-color: rgba(255,69,96,0.07); }
  100% { background-color: transparent; }
}

tr.pf-row-up { animation: pfRowUp 1.4s ease-out; }
tr.pf-row-dn { animation: pfRowDn 1.4s ease-out; }

/* ── Ticker item ── */
@keyframes tkrUp {
  0%   { background-color: rgba(0,230,138,0.10); }
  100% { background-color: transparent; }
}
@keyframes tkrDn {
  0%   { background-color: rgba(255,69,96,0.10); }
  100% { background-color: transparent; }
}

.tkr-i.tkr-flash-up { animation: tkrUp 1.4s ease-out; border-radius: 4px; }
.tkr-i.tkr-flash-dn { animation: tkrDn 1.4s ease-out; border-radius: 4px; }

/* ── Trend color persistente ── */
.pr.trend-up  { color: #00DCA0 !important; }
.pr.trend-dn  { color: #FF4560 !important; }
.tkr-p.trend-up { color: #00DCA0; }
.tkr-p.trend-dn { color: #FF4560; }

/* ── Live dot pulsante ── */
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}
.live-dot {
  animation: livePulse 2s ease-in-out infinite;
  font-size: 0.42em;
  vertical-align: middle;
  margin-left: 3px;
  color: #00DCA0;
  display: inline-block;
}

/* ── Change badge flash ── */
.ch.pf-up { animation: pfUp 1.8s ease-out; }
.ch.pf-dn { animation: pfDn 1.8s ease-out; }

/* ── Detail hero price ── */
.pf-hero-up { animation: pfUp 2.5s ease-out forwards !important; }
.pf-hero-dn { animation: pfDn 2.5s ease-out forwards !important; }

/* ── Static data indicator (prezzi non live) ── */
tr[data-static="true"] .pr { color: var(--tm) !important; opacity: .7; }
tr[data-static="true"] .pr::after { content: '—'; font-size: .6em; margin-left: 2px; }

/* ── Skeleton rows ── */
@keyframes skShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.sk-row-anim {
  height: 28px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: skShimmer 1.4s infinite;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .pf-up, .pf-dn, tr.pf-row-up, tr.pf-row-dn,
  .tkr-i.tkr-flash-up, .tkr-i.tkr-flash-dn,
  .ch.pf-up, .ch.pf-dn, .pf-hero-up, .pf-hero-dn,
  .live-dot { animation: none !important; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .pf-up, .pf-dn { animation-duration: 1.4s; }
  tr.pf-row-up, tr.pf-row-dn { animation-duration: 1.1s; }
}
