/* 
 * TRL Design System - Animations 
 * Animation keyframes and animated components
 */

@keyframes flashPulse {
  0% {
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  }
}

/* Alert pulse animation */
@keyframes alertPulse {
  0% {
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  }
}

/* Button bounce animation */
@keyframes buttonBounce {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 221, 0, 0.8);
  }
}

@keyframes formSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Text glow animation */
@keyframes textGlow {
  0% {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  }
  100% {
    text-shadow:
      0 0 10px rgba(255, 255, 255, 0.8),
      0 0 20px rgba(255, 255, 255, 0.5);
  }
}

/* Pulse effect */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

/* Slide-in animation */
@keyframes slideIn {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  60% {
    transform: translateX(-5%);
  }
  80% {
    transform: translateX(2%);
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Glow effect */
@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(255, 221, 0, 0.6);
  }
  100% {
    box-shadow:
      0 0 20px rgba(255, 221, 0, 0.8),
      0 0 30px rgba(255, 221, 0, 0.4);
  }
}

/* Ready pulse animation */
@keyframes readyPulse {
  0% {
    background-color: var(--trl-primary);
  }
  100% {
    background-color: #00aeff;
    box-shadow: 0 0 10px rgba(0, 164, 228, 0.8);
  }
}

/* Confetti fall animation */
@keyframes confettiFall {
  0% {
    transform: translateY(-5%) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(100%) rotate(360deg);
    opacity: 0;
  }
}

/* Spotlight scan animation */
@keyframes spotlightScan {
  0% {
    box-shadow:
      0 0 20px rgba(255, 255, 255, 0.8),
      0 0 30px rgba(255, 255, 255, 0.4);
  }
  25% {
    box-shadow:
      10px 0 20px rgba(255, 255, 255, 0.8),
      10px 0 30px rgba(255, 255, 255, 0.4);
  }
  50% {
    box-shadow:
      0 10px 20px rgba(255, 255, 255, 0.8),
      0 10px 30px rgba(255, 255, 255, 0.4);
  }
  75% {
    box-shadow:
      -10px 0 20px rgba(255, 255, 255, 0.8),
      -10px 0 30px rgba(255, 255, 255, 0.4);
  }
  100% {
    box-shadow:
      0 -10px 20px rgba(255, 255, 255, 0.8),
      0 -10px 30px rgba(255, 255, 255, 0.4);
  }
}

@keyframes successPulse {
  0% {
    background-color: rgba(0, 200, 100, 0.4);
  }
  100% {
    background-color: rgba(0, 200, 100, 0.1);
  }
}
@keyframes errorShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Apply animations to elements */
.trl-animated-button {
  animation: buttonBounce 1s infinite alternate;
}

.trl-animated-text {
  animation: textGlow 2s infinite alternate;
}

.trl-pulse {
  animation: pulse 1s infinite alternate;
}

.trl-slide-in {
  animation: slideIn 0.5s cubic-bezier(0.23, 1, 0.32, 1.2);
}

.trl-glow {
  animation: glow 2s infinite alternate;
}

/* Confetti container and particles */
.trl-confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.trl-confetti {
  position: absolute;
  top: -5%;
  width: var(--size, 8px);
  height: var(--size, 8px);
  background-color: var(--color, hsl(var(--hue, 0), 100%, 50%));
  opacity: 0.8;
  animation: confettiFall 2s var(--delay, 0s) forwards;
}
