/* ── TUMAN ADMIN — animations.css ── */

/* ── Keyframes ─────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  from { transform: scale(1);    opacity: 0.7; }
  to   { transform: scale(1.08); opacity: 1;   }
}

@keyframes shakeX {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}

@keyframes checkDraw {
  from { stroke-dashoffset: 50; opacity: 0; }
  to   { stroke-dashoffset: 0;  opacity: 1; }
}

@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 0 40px; }
}

@keyframes spinWheel {
  to { transform: rotate(360deg); }
}

@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page section animations ────────────────────────────────────────── */
.anim-fadein {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.35s ease forwards;
}
.anim-fadein[style*="--delay"] { animation-delay: var(--delay, 0ms); }

/* Pre-assigned delays for dashboard sections */
.anim-s1 { animation: fadeInUp 0.35s ease 0ms   forwards; opacity: 0; }
.anim-s2 { animation: fadeInUp 0.35s ease 80ms  forwards; opacity: 0; }
.anim-s3 { animation: fadeInUp 0.35s ease 160ms forwards; opacity: 0; }
.anim-s4 { animation: fadeInUp 0.35s ease 200ms forwards; opacity: 0; }

/* Table row stagger (applied via JS) */
.tr-anim {
  opacity: 0;
  animation: fadeInUp 0.25s ease forwards;
}

/* ── Login grid background ────────────────────────────────────────── */
.login-grid-bg {
  background-image:
    linear-gradient(var(--border-base) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-base) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.18;
  position: absolute; inset: 0;
  animation: gridDrift 20s linear infinite;
  pointer-events: none;
}

/* ── Input shake on auth error ────────────────────────────────────── */
.shake { animation: shakeX 0.3s ease; }

/* ── Success check animation ─────────────────────────────────────── */
.check-svg { width: 56px; height: 56px; }
.check-svg circle { fill: rgba(45,212,170,0.15); stroke: none; }
.check-svg path {
  fill: none;
  stroke: var(--accent-teal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: checkDraw 0.5s ease 0.2s forwards;
}

/* ── Modal open animation ─────────────────────────────────────────── */
.modal-enter { animation: scaleIn 0.2s ease; }

/* ── Lucky spin wheel ─────────────────────────────────────────────── */
.spin-wheel-container {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
}
.spin-wheel-wrap {
  position: relative; width: 320px; height: 320px;
}
.spin-pointer {
  position: absolute; top: -14px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 20px solid var(--accent-amber);
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
#spinCanvas {
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--border-base), 0 8px 32px rgba(0,0,0,0.5);
}
.spin-center-btn {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-l2);
  border: 3px solid var(--border-bright);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; z-index: 5;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 800;
  letter-spacing: 1px; color: var(--accent-blue);
  transition: border-color 150ms, background 150ms;
  box-shadow: var(--shadow);
}
.spin-center-btn:hover { border-color: var(--accent-blue); background: rgba(74,143,255,0.1); }
.spin-center-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Leaderboard ──────────────────────────────────────────────────── */
.leaderboard-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(46,54,80,0.5);
  font-size: 13px;
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-item__rank {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  width: 22px; text-align: center; flex-shrink: 0;
}
.leaderboard-item:nth-child(1) .leaderboard-item__rank { color: var(--accent-amber); }
.leaderboard-item:nth-child(2) .leaderboard-item__rank { color: var(--accent-blue); }
.leaderboard-item:nth-child(3) .leaderboard-item__rank { color: var(--accent-teal); }
.leaderboard-item__name { flex: 1; font-weight: 500; }
.leaderboard-item__count { font-family: var(--font-mono); color: var(--text-muted); font-size: 12px; }

/* ── Drag handle ─────────────────────────────────────────────────── */
.drag-handle {
  cursor: grab; color: var(--text-muted); font-size: 14px;
  padding: 4px 6px;
}
.drag-handle:active { cursor: grabbing; }
.dragging { opacity: 0.5; }
