/* 
TACHYON ANIMATIONS SYSTEM
Quantum-inspired animations for loading indicators and UI effects
Particle physics-based visual feedback system
*/

/* Keyframe Definitions */

/* Tachyon Particle Animation */
@keyframes tachyon-particle {
  0% {
    transform: translateX(-100px) translateY(0) scale(0);
    opacity: 0;
  }
  20% {
    transform: translateX(-50px) translateY(-10px) scale(0.5);
    opacity: 0.7;
  }
  50% {
    transform: translateX(0) translateY(0) scale(1);
    opacity: 1;
  }
  80% {
    transform: translateX(50px) translateY(10px) scale(0.5);
    opacity: 0.7;
  }
  100% {
    transform: translateX(100px) translateY(0) scale(0);
    opacity: 0;
  }
}

/* Neutrino Flow Animation */
@keyframes neutrino-flow {
  0% {
    transform: translateX(-50px) skewX(-15deg);
    opacity: 0;
  }
  25% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
  75% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(150px) skewX(-15deg);
    opacity: 0;
  }
}

/* Quantum Entangled Pulse */
@keyframes quantum-entangled {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.5;
  }
  25% {
    transform: scale(1.1) rotate(90deg);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 1;
  }
  75% {
    transform: scale(1.1) rotate(270deg);
    opacity: 0.8;
  }
}

/* Particle Stream */
@keyframes particle-stream {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) scale(0);
    opacity: 0;
  }
}

/* Quantum Shimmer */
@keyframes quantum-shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Loading Spinner */
@keyframes tachyon-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

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

/* Slide In Animation */
@keyframes tachyon-slide-in {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Bounce Animation */
@keyframes tachyon-bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

/* Loading Indicators */

/* Tachyon Particle Loader */
.tachyon-particle-loader {
  position: relative;
  width: 60px;
  height: 20px;
  margin: 20px auto;
}

.tachyon-particle-loader::before,
.tachyon-particle-loader::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--tachyon-gradient-primary);
  border-radius: 50%;
  animation: tachyon-particle 2s infinite;
}

.tachyon-particle-loader::after {
  animation-delay: 0.5s;
}

/* Neutrino Progress Bar */
.tachyon-neutrino-progress {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--tachyon-gray-200);
  border-radius: 2px;
  overflow: hidden;
}

.tachyon-neutrino-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50px;
  width: 100px;
  height: 100%;
  background: var(--tachyon-gradient-tertiary);
  animation: neutrino-flow 1.5s infinite;
}

/* Quantum Entangled Spinner */
.tachyon-quantum-spinner {
  position: relative;
  width: 40px;
  height: 40px;
  margin: 20px auto;
}

.tachyon-quantum-spinner::before,
.tachyon-quantum-spinner::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--tachyon-primary);
  border-radius: 50%;
  animation: quantum-entangled 2s infinite;
}

.tachyon-quantum-spinner::before {
  top: 0;
  left: 0;
}

.tachyon-quantum-spinner::after {
  bottom: 0;
  right: 0;
  animation-delay: 1s;
}

/* Particle Stream Background */
.tachyon-particle-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.tachyon-particle-bg::before,
.tachyon-particle-bg::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 20px;
  background: var(--tachyon-gradient-primary);
  border-radius: 1px;
  opacity: 0.3;
  animation: particle-stream 5s infinite;
}

.tachyon-particle-bg::before {
  left: 20%;
  animation-delay: 0s;
}

.tachyon-particle-bg::after {
  left: 80%;
  animation-delay: 2.5s;
}

/* Button Animations */
.tachyon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--tachyon-space-sm) var(--tachyon-space-lg);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--tachyon-radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  text-decoration: none;
}

.tachyon-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.tachyon-btn:hover::before {
  left: 100%;
}

.tachyon-btn-primary {
  background: var(--tachyon-gradient-primary);
  color: var(--tachyon-white);
}

.tachyon-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--tachyon-shadow-lg);
}

.tachyon-btn-secondary {
  background: var(--tachyon-gradient-secondary);
  color: var(--tachyon-white);
}

.tachyon-btn-quantum {
  background: var(--tachyon-gradient-quantum);
  background-size: 400% 400%;
  animation: quantum-shimmer 3s ease infinite;
  color: var(--tachyon-white);
}

/* Card Animations */
.tachyon-card {
  background: var(--tachyon-white);
  border-radius: var(--tachyon-radius-lg);
  padding: var(--tachyon-space-lg);
  box-shadow: var(--tachyon-shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tachyon-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--tachyon-gradient-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tachyon-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--tachyon-shadow-xl);
}

.tachyon-card:hover::before {
  transform: scaleX(1);
}

/* Loading States */
.tachyon-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.tachyon-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--tachyon-gray-300);
  border-top: 2px solid var(--tachyon-primary);
  border-radius: 50%;
  animation: tachyon-spin 1s linear infinite;
}

/* Quantum Shimmer Effect */
.tachyon-shimmer {
  background: linear-gradient(
    90deg,
    var(--tachyon-gray-200) 25%,
    var(--tachyon-gray-100) 50%,
    var(--tachyon-gray-200) 75%
  );
  background-size: 200% 100%;
  animation: quantum-shimmer 1.5s infinite;
}

/* Progress Animations */
.tachyon-progress {
  width: 100%;
  height: 8px;
  background: var(--tachyon-gray-200);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.tachyon-progress-bar {
  height: 100%;
  background: var(--tachyon-gradient-primary);
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
}

.tachyon-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: quantum-shimmer 2s infinite;
}

/* Notification Animations */
.tachyon-notification {
  transform: translateX(100%);
  animation: tachyon-slide-in 0.3s ease forwards;
}

.tachyon-notification.tachyon-notification-exit {
  animation: tachyon-slide-in 0.3s ease reverse forwards;
}

/* Modal Animations */
.tachyon-modal {
  opacity: 0;
  transform: scale(0.9);
  animation: tachyon-fade-in 0.3s ease forwards;
}

.tachyon-modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
  animation: tachyon-fade-in 0.3s ease;
}

/* Utility Animation Classes */
.tachyon-animate-spin {
  animation: tachyon-spin 1s linear infinite;
}

.tachyon-animate-pulse {
  animation: tachyon-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.tachyon-animate-bounce {
  animation: tachyon-bounce 1s infinite;
}

.tachyon-animate-fade-in {
  animation: tachyon-fade-in 0.5s ease;
}

.tachyon-animate-slide-in {
  animation: tachyon-slide-in 0.3s ease;
}

/* Performance Optimizations */
.tachyon-will-change {
  will-change: transform, opacity;
}

.tachyon-gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .tachyon-particle-loader::before,
  .tachyon-particle-loader::after,
  .tachyon-neutrino-progress::before,
  .tachyon-quantum-spinner::before,
  .tachyon-quantum-spinner::after,
  .tachyon-particle-bg::before,
  .tachyon-particle-bg::after {
    animation: none;
  }
  
  .tachyon-btn:hover,
  .tachyon-card:hover {
    transform: none;
  }
  
  .tachyon-btn::before {
    display: none;
  }
}