/**
 * Seya Group - Advanced Animations & Effects
 * Separate file for performance optimization
 */

/* ==========================================================================
   Advanced CSS Animations
   ========================================================================== */

/* Gradient Animation Background */
@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-bg {
  background: linear-gradient(-45deg, #2563eb, #7c3aed, #10b981, #f59e0b);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

/* Floating Elements */
@keyframes floatUp {
  0% {
    transform: translateY(0px);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px);
    opacity: 0;
  }
}

.floating-element {
  animation: floatUp 3s ease-in-out infinite;
}

/* Text Reveal Effect */
@keyframes textReveal {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

.text-reveal {
  position: relative;
  overflow: hidden;
}

.text-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #2563eb, transparent);
  animation: textReveal 2s ease-in-out;
}

/* Ripple Effect */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* Card Flip Effect */
.flip-card {
  background-color: transparent;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Magnetic Effect */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic:hover {
  transform: translate(var(--mouse-x, 0), var(--mouse-y, 0));
}

/* Glitch Effect */
@keyframes glitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}

.glitch:hover {
  animation: glitch 0.3s linear infinite;
}

/* Neon Glow Effect */
@keyframes neonGlow {
  0%, 100% {
    text-shadow: 
      0 0 5px #2563eb,
      0 0 10px #2563eb,
      0 0 15px #2563eb,
      0 0 20px #2563eb;
  }
  50% {
    text-shadow: 
      0 0 2px #2563eb,
      0 0 5px #2563eb,
      0 0 8px #2563eb,
      0 0 12px #2563eb;
  }
}

.neon-text {
  color: #2563eb;
  animation: neonGlow 2s ease-in-out infinite alternate;
}

/* Particle Trail */
@keyframes particleTrail {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-50px) scale(0);
    opacity: 0;
  }
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #2563eb;
  border-radius: 50%;
  animation: particleTrail 1s ease-out forwards;
  pointer-events: none;
}

/* Liquid Button Effect */
.liquid-btn {
  position: relative;
  overflow: hidden;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.liquid-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all 0.5s ease;
  transform: translate(-50%, -50%);
}

.liquid-btn:hover::before {
  width: 200%;
  height: 200%;
}

/* Typewriter Effect Enhanced */
@keyframes typewriterCursor {
  from { border-right-color: rgba(37, 99, 235, 0.75); }
  to { border-right-color: transparent; }
}

.typewriter {
  border-right: 2px solid rgba(37, 99, 235, 0.75);
  animation: typewriterCursor 1s infinite;
}

/* 3D Card Effect */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.card-3d:hover {
  transform: rotateX(5deg) rotateY(5deg) translateZ(20px);
}

/* Wave Animation */
@keyframes wave {
  0% {
    transform: rotate(0deg);
  }
  10% {
    transform: rotate(14deg);
  }
  20% {
    transform: rotate(-8deg);
  }
  30% {
    transform: rotate(14deg);
  }
  40% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.wave {
  animation: wave 2s ease-in-out infinite;
  transform-origin: 70% 70%;
}

/* Zoom In/Out on Scroll */
.zoom-on-scroll {
  transition: transform 0.3s ease;
}

.zoom-on-scroll.zoomed {
  transform: scale(1.05);
}

/* Rainbow Text */
@keyframes rainbow {
  0% { color: #ff0000; }
  14% { color: #ff7f00; }
  28% { color: #ffff00; }
  42% { color: #00ff00; }
  57% { color: #0000ff; }
  71% { color: #4b0082; }
  85% { color: #9400d3; }
  100% { color: #ff0000; }
}

.rainbow-text {
  animation: rainbow 3s linear infinite;
}

/* Matrix Rain Effect */
@keyframes matrixRain {
  0% {
    transform: translateY(-100vh);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

.matrix-char {
  position: absolute;
  color: #2563eb;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  animation: matrixRain 3s linear infinite;
}

/* Breathing Animation */
@keyframes breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.breathe {
  animation: breathe 3s ease-in-out infinite;
}

/* Slide and Fade */
@keyframes slideAndFade {
  0% {
    transform: translateX(-100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-fade {
  animation: slideAndFade 0.8s ease-out;
}

/* Elastic Bounce */
@keyframes elasticBounce {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  75% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.elastic-bounce {
  animation: elasticBounce 0.8s ease-out;
}

/* Utility Classes for Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

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

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
