/* ============================================================================
 * vela-live.css — "signs of life" layer for the Vela pool dashboard.
 * Additive only: no Material-Dashboard rules are overridden destructively.
 * Rollback: remove the <link> from index.html (full backup exists in
 * /home/marcel/backups/vela-frontend-backup-20260911-pre-facelift.tar.gz)
 * ========================================================================== */

:root {
  --qtc-orange: #FF6B35;
  --qtc-orange-soft: rgba(255, 107, 53, .12);
  --qtc-green: #4CAF50;
}

/* ---- animated gradient hairline across the very top of the page ---- */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 2000;
  background: linear-gradient(90deg,
    #FF6B35 0%, #ffb347 25%, #e91e63 50%, #ffb347 75%, #FF6B35 100%);
  background-size: 200% 100%;
  animation: qtc-shimmer 6s linear infinite;
  pointer-events: none;
}
@keyframes qtc-shimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ---- pulsing LIVE dot ---- */
.qtc-live {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--qtc-green);
  vertical-align: middle;
  margin-left: .5rem;
}
.qtc-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--qtc-green);
  position: relative;
}
.qtc-live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--qtc-green);
  animation: qtc-ping 1.6s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes qtc-ping {
  0%   { transform: scale(1);   opacity: .8; }
  80%, 100% { transform: scale(2.8); opacity: 0; }
}

/* ---- value-updated flash (JS adds .qtc-flash on text change) ---- */
.qtc-flash {
  animation: qtc-flash-anim 1.1s ease-out;
  border-radius: .25rem;
}
@keyframes qtc-flash-anim {
  0%   { background-color: var(--qtc-orange-soft); box-shadow: 0 0 12px rgba(255,107,53,.45); }
  100% { background-color: transparent;            box-shadow: none; }
}

/* (removed 2026-09-11 per Marcel: no gradient/orange ink on the big stat
   numbers — they render in the theme's normal text color again) */

/* ---- cards respond to the cursor: lift + orange glow ---- */
.card {
  transition: transform .22s ease, box-shadow .22s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -6px rgba(52, 71, 103, .18),
              0 0 0 1px rgba(255, 107, 53, .18),
              0 4px 14px -4px rgba(255, 107, 53, .22) !important;
}

/* stat icons pick up the brand color on card hover */
.card:hover .icon-shape.bg-gradient-dark {
  background-image: linear-gradient(195deg, var(--qtc-orange) 0%, #d84315 100%) !important;
  transition: background-image .25s ease;
}

/* ---- ticking "last block ago" line ---- */
.qtc-lastblock {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  color: #67748e;
}
.qtc-lastblock b { color: var(--qtc-orange); font-variant-numeric: tabular-nums; }
.qtc-lastblock .qtc-pick { animation: qtc-swing 2.4s ease-in-out infinite; display: inline-block; transform-origin: 70% 30%; }
@keyframes qtc-swing {
  0%, 100% { transform: rotate(0deg); }
  40%      { transform: rotate(-14deg); }
  70%      { transform: rotate(8deg); }
}

/* ---- newest block row slides in with a glow ---- */
.qtc-block-new {
  animation: qtc-block-in .9s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes qtc-block-in {
  0%   { transform: translateX(-14px); opacity: 0; box-shadow: 0 0 18px rgba(255,107,53,.55); }
  60%  { box-shadow: 0 0 18px rgba(255,107,53,.35); }
  100% { transform: translateX(0);    opacity: 1; box-shadow: none; }
}

/* ---- effort badge heartbeat when the round runs hot (>100%) ---- */
.qtc-effort-hot {
  animation: qtc-heartbeat 1.8s ease-in-out infinite;
  color: var(--qtc-orange) !important;
  font-weight: 700;
}
@keyframes qtc-heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.12); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.09); }
}

/* respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
  body::before, .qtc-live-dot::after, .qtc-lastblock .qtc-pick,
  .qtc-flash, .qtc-block-new, .qtc-effort-hot { animation: none !important; }
  .card, .card:hover { transform: none; }
}

/* ============================================================================
 * YourStats page liveness (2026-09-11) — balance growth, payout countdown,
 * worker online pulse, progress shimmer.
 * ========================================================================== */

/* floating "+0.0012 VELA" when the balance grows */
.qtc-delta {
  position: absolute;
  font-size: .8rem;
  font-weight: 700;
  color: var(--qtc-green);
  text-shadow: 0 0 8px rgba(76, 175, 80, .35);
  pointer-events: none;
  animation: qtc-float-up 2.4s ease-out forwards;
  white-space: nowrap;
  z-index: 50;
}
@keyframes qtc-float-up {
  0%   { opacity: 0; transform: translateY(4px)  scale(.9); }
  15%  { opacity: 1; transform: translateY(-2px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-34px) scale(1); }
}

/* balance progress bar: smooth growth + moving shimmer stripe */
.balance-progress-bar {
  transition: width 1.2s cubic-bezier(.25, .8, .3, 1);
  background-image: linear-gradient(110deg,
    rgba(255,255,255,0) 30%, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 70%) !important;
  background-size: 200% 100%;
  background-color: var(--qtc-orange) !important;
  animation: qtc-bar-shimmer 2.6s linear infinite;
}
@keyframes qtc-bar-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* worker Online badges get a pulsing dot */
#workerTableBody .badge.bg-gradient-success::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: .3rem;
  border-radius: 50%;
  background: #fff;
  vertical-align: middle;
  animation: qtc-worker-pulse 1.6s ease-in-out infinite;
}
@keyframes qtc-worker-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.7); }
}

/* payout countdown line */
.qtc-payout-eta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  color: #67748e;
}
.qtc-payout-eta b { color: var(--qtc-orange); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .qtc-delta, .balance-progress-bar,
  #workerTableBody .badge.bg-gradient-success::before { animation: none !important; }
}
