/* QWAMOS Animation Library */
/* ======================= */

/* Keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 
      inset 0 0 10px rgba(15, 255, 234, 0.2),
      0 0 20px rgba(15, 255, 234, 0.3);
  }
  50% {
    box-shadow: 
      inset 0 0 20px rgba(15, 255, 234, 0.4),
      0 0 40px rgba(15, 255, 234, 0.5);
  }
}

@keyframes typing-cursor {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

@keyframes quantum-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes data-stream {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0;
  }
}

@keyframes hex-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-10px) rotate(120deg);
  }
  66% {
    transform: translateY(5px) rotate(240deg);
  }
}

@keyframes neon-flicker {
  0%, 100% {
    text-shadow: 
      0 0 10px var(--accent-cyan),
      0 0 20px var(--accent-cyan),
      0 0 30px var(--accent-cyan);
  }
  50% {
    text-shadow: 
      0 0 5px var(--accent-cyan),
      0 0 15px var(--accent-cyan),
      0 0 25px var(--accent-cyan);
  }
}

/* Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.slide-in-left {
  animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out forwards;
}

.scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

/* Stagger animations */
.stagger-children > * {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* Mouse Trail */
.mouse-trail {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--accent-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  opacity: 0.6;
  transition: all 0.5s ease-out;
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Quantum Loader */
.quantum-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loader-inner {
  position: relative;
  width: 80px;
  height: 80px;
}

.quantum-particle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent-cyan);
}

.quantum-particle:nth-child(1) {
  top: 0;
  left: 30px;
  animation: quantum-spin 1s linear infinite;
}

.quantum-particle:nth-child(2) {
  top: 30px;
  left: 0;
  animation: quantum-spin 1s linear infinite reverse;
  animation-delay: 0.3s;
}

.quantum-particle:nth-child(3) {
  top: 30px;
  right: 0;
  animation: quantum-spin 1s linear infinite;
  animation-delay: 0.6s;
}

.loader-text {
  margin-top: 2rem;
  font-family: var(--font-code);
  color: var(--accent-cyan);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.8;
}

.loader-text::after {
  content: '';
  animation: typing-cursor 1s infinite;
}

/* Fade out animation */
.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-effect 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Typing Effect */
.typing-complete::after {
  content: '|';
  animation: typing-cursor 1s infinite;
  color: var(--accent-cyan);
  font-weight: 300;
}

/* Parallax Layers */
.parallax-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.parallax-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
  background-size: cover;
  background-position: center;
  will-change: transform;
}

/* 3D Transform */
.transform-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease-out;
}

/* Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  z-index: 10000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Data Stream Effect */
.data-stream {
  position: absolute;
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  opacity: 0.3;
  animation: data-stream 10s linear infinite;
  pointer-events: none;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
  
  .mouse-trail,
  .quantum-loader,
  .data-stream {
    display: none;
  }
}