/* ===== CSS MOTION GALLERY - ADVANCED ANIMATIONS ===== */

/* Keyframe Animations */
@keyframes loadingProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0%); }
}

@keyframes particleFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes logoGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

@keyframes titleReveal {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardFloat {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes arrowBounce {
  0%, 100% { transform: translateX(-50%) rotate(45deg) translateY(0); }
  50% { transform: translateX(-50%) rotate(45deg) translateY(5px); }
}

/* Demo Element Animations */

/* Magnetic Hover Effect */
.magnetic-element {
  position: relative;
  padding: 1rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  overflow: hidden;
}

.magnetic-element::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--accent-coral), var(--accent-teal));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.magnetic-element:hover {
  transform: scale(1.05);
  border-color: var(--accent-coral);
  box-shadow: 0 0 30px rgba(255, 122, 89, 0.4);
}

.magnetic-element:hover::before {
  opacity: 0.1;
}

/* Glitch Text Effect */
.glitch-text {
  position: relative;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  animation: glitch 3s infinite;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  color: var(--accent-coral);
  animation: glitchTop 3s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch-text::after {
  color: var(--accent-pink);
  animation: glitchBottom 3s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch {
  0%, 90%, 100% { transform: translate(0); }
  10% { transform: translate(-2px, 2px); }
  20% { transform: translate(-2px, -2px); }
  30% { transform: translate(2px, 2px); }
  40% { transform: translate(2px, -2px); }
  50% { transform: translate(-1px, 2px); }
  60% { transform: translate(-1px, -2px); }
  70% { transform: translate(3px, 1px); }
  80% { transform: translate(3px, -1px); }
}

@keyframes glitchTop {
  0%, 90%, 100% { transform: translate(0); }
  10% { transform: translate(-2px, -2px); }
  20% { transform: translate(-2px, 2px); }
  30% { transform: translate(2px, -2px); }
  40% { transform: translate(2px, 2px); }
  50% { transform: translate(-1px, -2px); }
  60% { transform: translate(-1px, 2px); }
  70% { transform: translate(3px, -1px); }
  80% { transform: translate(3px, 1px); }
}

@keyframes glitchBottom {
  0%, 90%, 100% { transform: translate(0); }
  10% { transform: translate(2px, 2px); }
  20% { transform: translate(2px, -2px); }
  30% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  50% { transform: translate(1px, 2px); }
  60% { transform: translate(1px, -2px); }
  70% { transform: translate(-3px, 1px); }
  80% { transform: translate(-3px, -1px); }
}

/* Glass Morphism Effect */
.glass-panel {
  width: 120px;
  height: 80px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-smooth);
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(-45deg);
  transition: transform 0.6s ease;
}

.glass-panel:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.glass-panel:hover::before {
  transform: rotate(-45deg) translate(50%, 50%);
}

.glass-content {
  position: relative;
  z-index: 2;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Neon Button Effect */
.neon-button {
  padding: 0.8rem 1.5rem;
  background: transparent;
  border: 2px solid var(--accent-teal);
  border-radius: 8px;
  color: var(--accent-teal);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    0 0 10px var(--accent-teal),
    inset 0 0 10px rgba(45, 149, 150, 0.1);
  animation: neonPulse 2s ease-in-out infinite alternate;
}

.neon-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(45, 149, 150, 0.2), transparent);
  transition: left 0.5s ease;
}

.neon-button:hover::before {
  left: 100%;
}

.neon-button:hover {
  background: rgba(45, 149, 150, 0.1);
  box-shadow: 
    0 0 20px var(--accent-teal),
    0 0 40px var(--accent-teal),
    inset 0 0 20px rgba(45, 149, 150, 0.2);
}

@keyframes neonPulse {
  from {
    box-shadow: 
      0 0 10px var(--accent-teal),
      inset 0 0 10px rgba(45, 149, 150, 0.1);
  }
  to {
    box-shadow: 
      0 0 20px var(--accent-teal),
      0 0 30px var(--accent-teal),
      inset 0 0 20px rgba(45, 149, 150, 0.2);
  }
}

/* Orbital Loader */
.orbital-loader {
  position: relative;
  width: 60px;
  height: 60px;
}

.orbit {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

.orbit-1 {
  width: 60px;
  height: 60px;
  border-top: 2px solid var(--accent-coral);
  animation-duration: 2s;
}

.orbit-2 {
  width: 40px;
  height: 40px;
  top: 10px;
  left: 10px;
  border-top: 2px solid var(--accent-yellow);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.orbit-3 {
  width: 20px;
  height: 20px;
  top: 20px;
  left: 20px;
  border-top: 2px solid var(--accent-teal);
  animation-duration: 1s;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Button Lab Animations */

/* Liquid Fill Button */
.btn-liquid {
  position: relative;
  padding: 1rem 2rem;
  background: transparent;
  border: 2px solid var(--accent-coral);
  border-radius: 50px;
  color: var(--accent-coral);
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
}

.liquid {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent-coral);
  transition: top 0.4s var(--ease-smooth);
  z-index: -1;
}

.btn-liquid:hover .liquid {
  top: 0;
}

.btn-liquid:hover {
  color: var(--text-primary);
  border-color: var(--accent-coral);
}

/* Magnetic Button */
.btn-magnetic {
  position: relative;
  padding: 1rem 2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  overflow: hidden;
}

.magnetic-field {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, var(--accent-yellow) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.4s var(--ease-smooth);
  opacity: 0;
}

.btn-magnetic:hover .magnetic-field {
  width: 200px;
  height: 200px;
  opacity: 0.3;
}

.btn-magnetic:hover {
  transform: scale(1.05);
  border-color: var(--accent-yellow);
}

/* Neon Glow Button */
.btn-neon-glow {
  padding: 1rem 2rem;
  background: transparent;
  border: 2px solid var(--accent-cyan);
  border-radius: 8px;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
}

.btn-neon-glow:hover {
  background: rgba(34, 211, 238, 0.1);
  box-shadow: 
    0 0 20px var(--accent-cyan),
    0 0 40px var(--accent-cyan),
    inset 0 0 20px rgba(34, 211, 238, 0.1);
  text-shadow: 0 0 10px var(--accent-cyan);
}

/* Particle Burst Button */
.btn-particle-burst {
  position: relative;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  border: none;
  border-radius: 12px;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
}

.particles-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.btn-particle-burst:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.4);
}

/* Border Trace Button */
.btn-border-trace {
  position: relative;
  padding: 1rem 2rem;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
}

.border-trace {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple), var(--accent-pink), var(--accent-cyan));
  background-size: 400% 400%;
  animation: borderTrace 3s ease infinite;
  z-index: -1;
}

.border-trace::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: var(--bg-primary);
  border-radius: 10px;
}

@keyframes borderTrace {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-border-trace:hover {
  transform: scale(1.05);
}

/* Holographic Button */
.btn-holographic {
  position: relative;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, 
    rgba(77, 166, 255, 0.1), 
    rgba(139, 92, 246, 0.1), 
    rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
}

.holo-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, 
    transparent, 
    rgba(255, 255, 255, 0.1), 
    transparent);
  transform: rotate(-45deg);
  transition: transform 0.6s ease;
}

.btn-holographic:hover .holo-shine {
  transform: rotate(-45deg) translate(50%, 50%);
}

.btn-holographic:hover {
  background: linear-gradient(135deg, 
    rgba(77, 166, 255, 0.2), 
    rgba(139, 92, 246, 0.2), 
    rgba(236, 72, 153, 0.2));
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

/* Text Animation Effects */

/* Split Text Animation */
.split-text {
  font-size: 2rem;
  font-weight: 700;
  overflow: hidden;
}

.split-text .char {
  display: inline-block;
  transform: translateY(100%);
  animation: charReveal 0.8s var(--ease-smooth) forwards;
}

@keyframes charReveal {
  to { transform: translateY(0); }
}

/* Typewriter Effect */
.typewriter-text {
  font-size: 1.25rem;
  color: var(--text-secondary);
  border-right: 2px solid var(--accent-blue);
  white-space: nowrap;
  overflow: hidden;
  animation: typewriter 3s steps(30) 1s forwards, blink 1s infinite;
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 50% { border-color: var(--accent-blue); }
  51%, 100% { border-color: transparent; }
}

/* Wave Text Animation */
.wave-text {
  font-size: 1.5rem;
  font-weight: 600;
}

.wave-text span {
  display: inline-block;
  animation: wave 2s ease-in-out infinite;
}

.wave-text span:nth-child(2) { animation-delay: 0.1s; }
.wave-text span:nth-child(3) { animation-delay: 0.2s; }
.wave-text span:nth-child(4) { animation-delay: 0.3s; }
.wave-text span:nth-child(5) { animation-delay: 0.4s; }
.wave-text span:nth-child(6) { animation-delay: 0.5s; }
.wave-text span:nth-child(7) { animation-delay: 0.6s; }
.wave-text span:nth-child(8) { animation-delay: 0.7s; }
.wave-text span:nth-child(9) { animation-delay: 0.8s; }
.wave-text span:nth-child(10) { animation-delay: 0.9s; }

@keyframes wave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Gradient Text Animation */
.gradient-text {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(45deg, 
    var(--accent-blue), 
    var(--accent-purple), 
    var(--accent-pink), 
    var(--accent-cyan));
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Loader Animations */

/* Spinning Rings */
.spinning-rings {
  position: relative;
  width: 60px;
  height: 60px;
}

.ring {
  position: absolute;
  border: 3px solid transparent;
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

.ring-1 {
  width: 60px;
  height: 60px;
  border-top: 3px solid var(--accent-coral);
  animation-duration: 2s;
}

.ring-2 {
  width: 40px;
  height: 40px;
  top: 10px;
  left: 10px;
  border-top: 3px solid var(--accent-yellow);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.ring-3 {
  width: 20px;
  height: 20px;
  top: 20px;
  left: 20px;
  border-top: 3px solid var(--accent-teal);
  animation-duration: 1s;
}

/* Morphing Blob */
.morphing-blob {
  width: 60px;
  height: 60px;
  position: relative;
}

.blob-shape {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, var(--accent-coral), var(--accent-teal));
  border-radius: 50%;
  animation: blobMorph 2s ease-in-out infinite;
}

@keyframes blobMorph {
  0%, 100% { 
    border-radius: 50%;
    transform: scale(1);
  }
  25% { 
    border-radius: 60% 40% 30% 70%;
    transform: scale(1.1);
  }
  50% { 
    border-radius: 30% 60% 70% 40%;
    transform: scale(0.9);
  }
  75% { 
    border-radius: 40% 30% 60% 50%;
    transform: scale(1.05);
  }
}

/* Wave Bars */
.wave-bars {
  display: flex;
  gap: 4px;
  align-items: end;
  height: 40px;
}

.bar {
  width: 6px;
  background: linear-gradient(to top, var(--accent-coral), var(--accent-yellow));
  border-radius: 3px;
  animation: waveBar 1.5s ease-in-out infinite;
}

.bar:nth-child(1) { animation-delay: 0s; }
.bar:nth-child(2) { animation-delay: 0.1s; }
.bar:nth-child(3) { animation-delay: 0.2s; }
.bar:nth-child(4) { animation-delay: 0.3s; }
.bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes waveBar {
  0%, 100% { height: 10px; }
  50% { height: 40px; }
}

/* Matrix Loader */
.matrix-loader {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 40px;
  height: 40px;
}

.matrix-dot {
  width: 16px;
  height: 16px;
  background: var(--accent-teal);
  border-radius: 50%;
  animation: matrixPulse 1.5s ease-in-out infinite;
}

.matrix-dot:nth-child(1) { animation-delay: 0s; }
.matrix-dot:nth-child(2) { animation-delay: 0.2s; }
.matrix-dot:nth-child(3) { animation-delay: 0.4s; }
.matrix-dot:nth-child(4) { animation-delay: 0.6s; }

@keyframes matrixPulse {
  0%, 100% { 
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% { 
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Performance Optimizations */
.animation-card,
.floating-card,
.btn,
.magnetic-element,
.glitch-text,
.glass-panel,
.neon-button {
  will-change: transform;
}

.blob,
.grid-overlay,
.orbital-loader,
.spinning-rings {
  will-change: transform;
}

/* 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;
  }
  
  .cursor {
    display: none;
  }
}