/* ============================================
   BankSys Theme - Animations
   ============================================ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes orbPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(51,102,255,0.7), 0 0 80px rgba(168,85,247,0.4); }
  50%      { transform: scale(1.12); box-shadow: 0 0 60px rgba(51,102,255,0.9), 0 0 120px rgba(168,85,247,0.6); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}
@keyframes lineFill {
  from { width: 0%; }
  to   { width: 100%; }
}
@keyframes barGrow {
  from { height: 0; opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes scanLine {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(2000%); opacity: 0; }
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Reusable animation classes ---------- */
.anim-fade-up { animation: fadeUp 500ms ease both; }
.anim-fade-in { animation: fadeIn 600ms ease both; }
.anim-scale-in { animation: scaleIn 400ms cubic-bezier(.2,.8,.2,1) both; }
.anim-float { animation: floatY 4s ease-in-out infinite; }

/* Stagger helpers */
.stagger > * { animation: fadeUp 500ms ease both; }
.stagger > *:nth-child(1) { animation-delay: 60ms; }
.stagger > *:nth-child(2) { animation-delay: 120ms; }
.stagger > *:nth-child(3) { animation-delay: 180ms; }
.stagger > *:nth-child(4) { animation-delay: 240ms; }
.stagger > *:nth-child(5) { animation-delay: 300ms; }
.stagger > *:nth-child(6) { animation-delay: 360ms; }
.stagger > *:nth-child(7) { animation-delay: 420ms; }
.stagger > *:nth-child(8) { animation-delay: 480ms; }

/* ---------- Skeleton shimmer ---------- */
.skeleton {
  background: linear-gradient(90deg, rgba(120,150,220,0.06) 25%, rgba(120,150,220,0.16) 37%, rgba(120,150,220,0.06) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r);
}

/* ---------- AI scanning effect ---------- */
.scan-overlay {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  border-radius: inherit;
}
.scan-overlay::before {
  content: ""; position: absolute; inset-inline: 0; top: 0;
  height: 3px; background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  box-shadow: 0 0 20px var(--accent-cyan);
  animation: scanLine 2.4s ease-in-out infinite;
}

/* ---------- Neural network background (login) ---------- */
.neural-bg {
  position: absolute; inset: 0; z-index: 0; opacity: 0.5; pointer-events: none;
}

/* ---------- Typing dots ---------- */
.typing-dots { display: inline-flex; gap: 4px; align-items: center; }
.typing-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand-400);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ---------- Pulse ring (status) ---------- */
.pulse-ring { position: relative; }
.pulse-ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: currentColor; animation: ping 1.6s ease-out infinite;
}

/* ---------- Gradient text animated ---------- */
.gradient-anim {
  background: linear-gradient(90deg, #3366ff, #a855f7, #22d3ee, #3366ff);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease infinite;
}

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