/* ═══════════════════════════════════════════════════════════════════════════════
   CUSTOM ANIMATIONS FOR SNIPERS-R-US DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Pulse Glow Effect ─────────────────────────────────────────────────────── */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 5px var(--accent-dim), 0 0 10px var(--accent-dim);
  }
  50% {
    box-shadow: 0 0 20px var(--accent), 0 0 30px var(--accent-dim);
  }
}

.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ── Live Trading Banner Animation ──────────────────────────────────────────── */
@keyframes liveBannerPulse {
  0%, 100% {
    background: linear-gradient(90deg, var(--red) 0%, var(--orange) 50%, var(--red) 100%);
    background-size: 200% 100%;
    transform: scale(1);
  }
  50% {
    background-position: 100% 0;
    transform: scale(1.02);
  }
}

.live-banner {
  animation: liveBannerPulse 3s ease-in-out infinite;
}

@keyframes liveDot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px var(--green), 0 0 20px var(--green);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.8);
    box-shadow: 0 0 5px var(--green), 0 0 10px var(--green);
  }
}

.live-banner-dot {
  animation: liveDot 1.5s ease-in-out infinite;
}

/* ── Price Flash Animation ─────────────────────────────────────────────────── */
@keyframes priceFlashGreen {
  0% { background-color: rgba(46, 213, 115, 0.3); }
  100% { background-color: transparent; }
}

@keyframes priceFlashRed {
  0% { background-color: rgba(255, 65, 108, 0.3); }
  100% { background-color: transparent; }
}

.price-flash-green {
  animation: priceFlashGreen 0.5s ease-out;
}

.price-flash-red {
  animation: priceFlashRed 0.5s ease-out;
}

/* ── Card Slide In Animation ──────────────────────────────────────────────── */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-animate-in {
  animation: cardSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Stagger Animation for Multiple Cards ─────────────────────────────────── */
.card-animate-in:nth-child(1) { animation-delay: 0s; }
.card-animate-in:nth-child(2) { animation-delay: 0.1s; }
.card-animate-in:nth-child(3) { animation-delay: 0.2s; }
.card-animate-in:nth-child(4) { animation-delay: 0.3s; }
.card-animate-in:nth-child(5) { animation-delay: 0.4s; }
.card-animate-in:nth-child(6) { animation-delay: 0.5s; }

/* ── Shake Animation for Errors ───────────────────────────────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* ── Bounce Animation for Success ─────────────────────────────────────────── */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.bounce {
  animation: bounce 0.6s ease-in-out;
}

/* ── Fade In Up ───────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Fade In Down ─────────────────────────────────────────────────────────── */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-down {
  animation: fadeInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Scale In Animation ───────────────────────────────────────────────────── */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Slide In Left ───────────────────────────────────────────────────────── */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Slide In Right ──────────────────────────────────────────────────────── */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Rotate In Animation ──────────────────────────────────────────────────── */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

.rotate-in {
  animation: rotateIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Flip Animation ───────────────────────────────────────────────────────── */
@keyframes flip {
  0% {
    transform: perspective(400px) rotateY(0);
  }
  100% {
    transform: perspective(400px) rotateY(360deg);
  }
}

.flip {
  animation: flip 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Typewriter Effect ─────────────────────────────────────────────────────── */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent);
  animation: typewriter 2s steps(40, end), blink 0.75s step-end infinite;
}

/* ── Wave Animation ───────────────────────────────────────────────────────── */
@keyframes wave {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-5px); }
  75% { transform: translateY(5px); }
}

.wave {
  animation: wave 1.5s ease-in-out infinite;
}

/* ── Glow Border Animation ────────────────────────────────────────────────── */
@keyframes glowBorder {
  0%, 100% {
    border-color: var(--accent-dim);
    box-shadow: 0 0 5px var(--accent-dim);
  }
  50% {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent), 0 0 30px var(--accent-dim);
  }
}

.glow-border {
  animation: glowBorder 2s ease-in-out infinite;
}

/* ── Loading Spinner Animation ─────────────────────────────────────────────── */
@keyframes spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

/* ── Progress Bar Animation ────────────────────────────────────────────────── */
@keyframes progressFill {
  from { width: 0%; }
}

.progress-bar-animate {
  animation: progressFill 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Notification Animation ────────────────────────────────────────────────── */
@keyframes notificationSlide {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  10% {
    transform: translateX(0);
    opacity: 1;
  }
  90% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

.notification-animate {
  animation: notificationSlide 4s ease-in-out forwards;
}

/* ── Hover Lift Effect ─────────────────────────────────────────────────────── */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ── Number Count Up Animation ─────────────────────────────────────────────── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.count-up {
  animation: countUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Ripple Effect ─────────────────────────────────────────────────────────── */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ripple 0.6s ease-out;
}

/* ── Gradient Shift Animation ─────────────────────────────────────────────── */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

/* ── Floating Animation ─────────────────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* ── Neon Flicker Effect ──────────────────────────────────────────────────── */
@keyframes neonFlicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow: 
      0 0 5px var(--accent),
      0 0 10px var(--accent),
      0 0 20px var(--accent);
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

.neon-flicker {
  animation: neonFlicker 2s ease-in-out infinite;
}

/* ── Smooth View Transitions ──────────────────────────────────────────────── */
.view {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.view.active {
  opacity: 1;
  transform: translateX(0);
}

.view:not(.active) {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
  position: absolute;
}
