/* ==========================================================================
   Plague Brasil - Animations & Keyframes
   pulse-glow, float, fade-in, shimmer, grain, and more
   ========================================================================== */

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */

/* ---- Pulse Glow (Crimson - Plague Tier) ---- */
@keyframes pulse-glow-crimson {
  0%, 100% {
    box-shadow:
      0 0 15px rgba(139, 0, 0, 0.25),
      0 0 45px rgba(139, 0, 0, 0.08);
  }
  50% {
    box-shadow:
      0 0 25px rgba(139, 0, 0, 0.45),
      0 0 80px rgba(139, 0, 0, 0.2),
      0 0 120px rgba(220, 20, 60, 0.08);
  }
}

/* ---- Pulse Glow (Silver - Elite Tier) ---- */
@keyframes glow-silver {
  0%, 100% {
    box-shadow:
      0 0 12px rgba(192, 192, 192, 0.15),
      0 0 40px rgba(192, 192, 192, 0.06);
  }
  50% {
    box-shadow:
      0 0 20px rgba(192, 192, 192, 0.3),
      0 0 60px rgba(192, 192, 192, 0.12);
  }
}

/* ---- Pulse Glow (Bronze - Supporter Tier) ---- */
@keyframes glow-bronze {
  0%, 100% {
    box-shadow:
      0 0 12px rgba(205, 127, 50, 0.2),
      0 0 40px rgba(205, 127, 50, 0.06);
  }
  50% {
    box-shadow:
      0 0 20px rgba(205, 127, 50, 0.35),
      0 0 60px rgba(205, 127, 50, 0.12);
  }
}

/* ---- Pulse Glow (Amber - Generic) ---- */
@keyframes pulse-glow-amber {
  0%, 100% {
    box-shadow:
      0 0 15px rgba(255, 140, 0, 0.2),
      0 0 45px rgba(255, 140, 0, 0.06);
  }
  50% {
    box-shadow:
      0 0 25px rgba(255, 140, 0, 0.35),
      0 0 80px rgba(255, 140, 0, 0.12);
  }
}

/* ---- Float (Subtle hover effect) ---- */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ---- Float Subtle (Smaller range) ---- */
@keyframes float-subtle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* ---- Fade In ---- */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---- Fade In Up ---- */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Fade In Down ---- */
@keyframes fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Fade In Scale ---- */
@keyframes fade-in-scale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* ---- Slide In Right ---- */
@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---- Shimmer (Loading / highlight effect) ---- */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ---- Grain (Film noise animation) ---- */
@keyframes grain {
  0% { transform: translate(0, 0); }
  10% { transform: translate(-2%, -3%); }
  20% { transform: translate(3%, 1%); }
  30% { transform: translate(-1%, 3%); }
  40% { transform: translate(2%, -2%); }
  50% { transform: translate(-3%, 1%); }
  60% { transform: translate(1%, -1%); }
  70% { transform: translate(-2%, 3%); }
  80% { transform: translate(3%, -3%); }
  90% { transform: translate(-1%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ---- Pulse (Simple scale) ---- */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

/* ---- Border Glow Sweep ---- */
@keyframes border-glow-sweep {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ---- Skeleton Loading ---- */
@keyframes skeleton {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ---- Count Up (Number ticker feel) ---- */
@keyframes count-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}


/* ==========================================================================
   UTILITY CLASSES (Animation Application)
   ========================================================================== */

/* ---- Apply Animations ---- */
.animate-fade-in {
  animation: fade-in var(--transition-slow) ease both;
}

.animate-fade-in-up {
  animation: fade-in-up var(--transition-slow) ease both;
}

.animate-fade-in-down {
  animation: fade-in-down var(--transition-slow) ease both;
}

.animate-fade-in-scale {
  animation: fade-in-scale var(--transition-slow) ease both;
}

.animate-slide-in-left {
  animation: slide-in-left var(--transition-slow) ease both;
}

.animate-slide-in-right {
  animation: slide-in-right var(--transition-slow) ease both;
}

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

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

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

.animate-pulse-dot {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ---- Shimmer Effect (Loading skeleton) ---- */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    rgba(58, 58, 58, 0.6) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.8s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* ---- Animation Delays ---- */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }
.delay-1000 { animation-delay: 1000ms; }

/* ---- Animation Durations ---- */
.duration-fast { animation-duration: 150ms; }
.duration-base { animation-duration: 300ms; }
.duration-slow { animation-duration: 600ms; }
.duration-slower { animation-duration: 1000ms; }

/* ---- Stagger Children (via CSS custom property) ---- */
.stagger-children > * {
  animation: fade-in-up var(--transition-slow) ease both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 80ms; }
.stagger-children > *:nth-child(3) { animation-delay: 160ms; }
.stagger-children > *:nth-child(4) { animation-delay: 240ms; }
.stagger-children > *:nth-child(5) { animation-delay: 320ms; }
.stagger-children > *:nth-child(6) { animation-delay: 400ms; }
.stagger-children > *:nth-child(7) { animation-delay: 480ms; }
.stagger-children > *:nth-child(8) { animation-delay: 560ms; }
.stagger-children > *:nth-child(9) { animation-delay: 640ms; }
.stagger-children > *:nth-child(10) { animation-delay: 720ms; }

/* ---- Scroll-triggered (pair with JS IntersectionObserver) ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity var(--transition-slower),
    transform var(--transition-slower);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity var(--transition-slower),
    transform var(--transition-slower);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ---- Hover Transitions ---- */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.hover-glow-crimson:hover {
  box-shadow: var(--shadow-glow-crimson);
}

.hover-glow-amber:hover {
  box-shadow: var(--shadow-glow-amber);
}

.hover-glow-silver:hover {
  box-shadow: var(--shadow-glow-silver);
}
