/**
 * ============================================================
 *  MixPanel CS 1.6 — Animation Styles
 * ============================================================
 *  Template by Templuxo — https://templuxo.com
 * ============================================================
 */

/* ── Page Transitions ───────────────────────────────────────── */
@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Staggered Child Reveal ─────────────────────────────────── */
.stagger > * {
  animation: fade-up 0.4s var(--ease) both;
}
.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.16s; }
.stagger > *:nth-child(5) { animation-delay: 0.20s; }
.stagger > *:nth-child(6) { animation-delay: 0.24s; }
.stagger > *:nth-child(n+7) { animation-delay: 0.28s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Table Row Reveal ───────────────────────────────────────── */
@keyframes row-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
tbody tr {
  animation: row-in 0.3s var(--ease) both;
}
tbody tr:nth-child(1)  { animation-delay: 0.04s; }
tbody tr:nth-child(2)  { animation-delay: 0.08s; }
tbody tr:nth-child(3)  { animation-delay: 0.12s; }
tbody tr:nth-child(4)  { animation-delay: 0.16s; }
tbody tr:nth-child(5)  { animation-delay: 0.20s; }
tbody tr:nth-child(6)  { animation-delay: 0.24s; }
tbody tr:nth-child(n+7){ animation-delay: 0.28s; }

/* ── Number Counter (JS triggers this) ─────────────────────── */
@keyframes count-up {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
.stat-value {
  animation: count-up 0.5s var(--ease-back) both;
}

/* ── Pick Player Enter ──────────────────────────────────────── */
@keyframes player-in {
  from { opacity: 0; transform: translateX(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Chat Message ───────────────────────────────────────────── */
@keyframes msg-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Grid Background Pan ────────────────────────────────────── */
@keyframes grid-pan {
  from { background-position: 0 0; }
  to   { background-position: 40px 40px; }
}

/* ── Dot Pulse ──────────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.85); }
}

/* ── Spinner ────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Glow Pulse (warm amber) ───────────────────────────────── */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(77,159,255,0.2); }
  50%       { box-shadow: 0 0 28px rgba(77,159,255,0.4); }
}
.glow-accent { animation: glow-pulse 3s ease infinite; }

/* ── Blinking Cursor ────────────────────────────────────────── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.cursor-blink::after {
  content: '\2588';
  color: var(--accent2, var(--accent));
  animation: blink 1s step-start infinite;
  font-size: 0.85em;
}

/* ── Card Hover Shimmer ─────────────────────────────────────── */
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.card-shimmer {
  position: relative;
  overflow: hidden;
}
.card-shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(77,159,255,0.03), transparent);
  transform: translateX(-100%);
}
.card-shimmer:hover::after {
  animation: shimmer 0.7s var(--ease);
}

/* ── Progress Bar Animated Fill ─────────────────────────────── */
@keyframes fill-in {
  from { width: 0 !important; }
}
.progress-fill,
.map-vote-fill,
.elo-bar-fill {
  animation: fill-in 0.7s var(--ease) both;
}

/* ── Logo Icon Glow on Load ─────────────────────────────────── */
@keyframes logo-in {
  from { box-shadow: none; opacity: 0; transform: scale(0.8); }
  to   { box-shadow: 0 0 24px rgba(77,159,255,0.35); opacity: 1; transform: scale(1); }
}
.logo-icon { animation: logo-in 0.6s var(--ease-back) both 0.1s; }

/* ── Sidebar Item Stagger ───────────────────────────────────── */
.sidebar-nav .nav-item {
  animation: fade-up 0.4s var(--ease) both;
}
.sidebar-nav .nav-item:nth-child(1)  { animation-delay: 0.05s; }
.sidebar-nav .nav-item:nth-child(2)  { animation-delay: 0.10s; }
.sidebar-nav .nav-item:nth-child(3)  { animation-delay: 0.15s; }
.sidebar-nav .nav-item:nth-child(4)  { animation-delay: 0.20s; }
.sidebar-nav .nav-item:nth-child(5)  { animation-delay: 0.25s; }
.sidebar-nav .nav-item:nth-child(n+6){ animation-delay: 0.30s; }

/* ── Table Row Interactive ──────────────────────────────────── */
tbody tr { cursor: default; }
tbody tr:hover td { color: var(--tx-1); }

/* ── Button Ripple ──────────────────────────────────────────── */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-expand 0.5s linear;
  background: rgba(255,255,255,0.12);
  pointer-events: none;
}
@keyframes ripple-expand {
  to { transform: scale(4); opacity: 0; }
}

/* ── Warm Flicker (for live elements) ──────────────────────── */
@keyframes warm-flicker {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.92; }
}

/* ── Score Slam (for live score updates) ───────────────────── */
@keyframes score-slam {
  0%   { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── Reduce Motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
