/**
 * FunnelCraftPro - Futuristic Animations CSS
 * Advanced animations and futuristic effects for the marketing funnel service
 */

/* Glow Effects */
.glow-effect {
  position: relative;
  z-index: 1;
}

.glow-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  filter: blur(15px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  border-radius: inherit;
}

.glow-effect:hover::before {
  opacity: 0.3;
}

/* Futuristic Button Animations */
.btn-futuristic {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border: none;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: white;
  z-index: 1;
}

.btn-futuristic::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.2), rgba(255,255,255,0));
  transform: skewX(-25deg);
  transition: all 0.5s ease;
  z-index: -1;
}

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

.btn-futuristic::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color), var(--primary-color));
  background-size: 200% 100%;
  animation: gradientMove 2s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-futuristic:hover::after {
  opacity: 1;
}

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

/* Futuristic Input Fields */
.input-futuristic {
  position: relative;
  border: 1px solid rgba(65, 88, 208, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  box-shadow: 0 0 0 0 rgba(65, 88, 208, 0);
}

.input-futuristic:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(65, 88, 208, 0.2);
}

.input-futuristic::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease, left 0.3s ease;
}

.input-futuristic:focus::after {
  width: 100%;
  left: 0;
}

/* Floating Elements */
.float-element {
  animation: float 6s ease-in-out infinite;
}

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

/* Gradient Border Animation */
.gradient-border {
  position: relative;
  border-radius: 15px;
  background: white;
  z-index: 1;
}

.gradient-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--primary-color));
  background-size: 300% 300%;
  animation: gradientBorder 3s ease infinite;
  border-radius: 16px;
  z-index: -1;
}

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

/* Typing Text Animation */
.typing-text {
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: typing 3.5s steps(40, end) forwards;
}

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

/* Shimmering Effect */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shimmerEffect 3s linear infinite;
}

@keyframes shimmerEffect {
  0% {
    transform: translateX(-100%) rotate(30deg);
  }
  100% {
    transform: translateX(100%) rotate(30deg);
  }
}

/* Pulsing Glow */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(65, 88, 208, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(65, 88, 208, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(65, 88, 208, 0);
  }
}

/* Neon Highlights */
.neon-highlight {
  position: relative;
}

.neon-highlight::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  color: var(--primary-color);
  filter: blur(8px);
  opacity: 0.7;
}

/* Particle Background Effect */
.particle-background {
  position: relative;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(65, 88, 208, 0.2);
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-100px) translateX(20px);
    opacity: 0;
  }
}

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

.card-3d:hover {
  transform: rotateY(5deg) rotateX(5deg);
  box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.1);
}

/* Animated underline for links */
.animated-underline {
  position: relative;
  text-decoration: none;
}

.animated-underline::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
}

.animated-underline:hover::after {
  width: 100%;
}

/* Futuristic Tab Selection */
.futuristic-tabs .tab {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.futuristic-tabs .tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(65, 88, 208, 0.1) 0%, rgba(200, 80, 192, 0.1) 100%);
  z-index: -1;
}

.futuristic-tabs .tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

/* Data Flow Animation */
.data-flow {
  position: relative;
  overflow: hidden;
}

.data-particle {
  position: absolute;
  width: 2px;
  height: 10px;
  background: var(--primary-color);
  opacity: 0.5;
  animation: dataFlow linear infinite;
}

@keyframes dataFlow {
  0% {
    transform: translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateY(100%) rotate(45deg);
  }
}

/* Futuristic Grid Background */
.grid-background {
  position: relative;
  overflow: hidden;
}

.grid-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(to right, rgba(65, 88, 208, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(65, 88, 208, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: -1;
}

/* Split Text Animation */
.split-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glitch Effect */
.glitch-effect {
  position: relative;
}

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

.glitch-effect::before {
  /* Blend mode creates the glitch */
  left: 2px;
  text-shadow: -1px 0 red;
  animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-effect::after {
  left: -2px;
  text-shadow: 2px 0 blue;
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% {
    clip-path: inset(20% 0 80% 0);
  }
  20% {
    clip-path: inset(60% 0 40% 0);
  }
  40% {
    clip-path: inset(40% 0 60% 0);
  }
  60% {
    clip-path: inset(80% 0 20% 0);
  }
  80% {
    clip-path: inset(10% 0 90% 0);
  }
  100% {
    clip-path: inset(30% 0 70% 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(10% 0 90% 0);
  }
  20% {
    clip-path: inset(30% 0 70% 0);
  }
  40% {
    clip-path: inset(70% 0 30% 0);
  }
  60% {
    clip-path: inset(20% 0 80% 0);
  }
  80% {
    clip-path: inset(50% 0 50% 0);
  }
  100% {
    clip-path: inset(80% 0 20% 0);
  }
}