/* ==========================================================================
   FortiEraser - Animations & Interactive Effects
   Modern Futuristic Animations
   ========================================================================== */

/* Keyframe Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
  }
}

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

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

@keyframes dataFlow {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Scroll Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.animate-left {
  transform: translateX(-50px);
}

.animate-left.animate {
  transform: translateX(0);
}

.animate-right {
  transform: translateX(50px);
}

.animate-right.animate {
  transform: translateX(0);
}

.animate-scale {
  transform: scale(0.8);
}

.animate-scale.animate {
  transform: scale(1);
}

/* Hero Section Animations */
.hero-content {
  animation: fadeInUp 1s ease-out;
}

.hero-badge {
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-title {
  animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-description {
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-features {
  animation: fadeInUp 1s ease-out 0.8s both;
}

.hero-actions {
  animation: fadeInUp 1s ease-out 1s both;
}

.hero-stats {
  animation: fadeInUp 1s ease-out 1.2s both;
}

/* Circuit Pattern Animation */
.circuit-pattern {
  animation: circuitFlow 20s linear infinite;
}

@keyframes circuitFlow {
  0% {
    transform: translate(0, 0);
    opacity: 0.3;
  }
  25% {
    opacity: 0.6;
  }
  50% {
    transform: translate(25px, 25px);
    opacity: 0.3;
  }
  75% {
    opacity: 0.6;
  }
  100% {
    transform: translate(50px, 50px);
    opacity: 0.3;
  }
}

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

.element-1 {
  animation-delay: 0s;
  animation-duration: 6s;
}

.element-2 {
  animation-delay: 2s;
  animation-duration: 8s;
}

.element-3 {
  animation-delay: 4s;
  animation-duration: 7s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.4;
  }
  25% {
    transform: translateY(-20px) rotate(90deg);
    opacity: 1;
  }
  50% {
    transform: translateY(-10px) rotate(180deg);
    opacity: 0.7;
  }
  75% {
    transform: translateY(-30px) rotate(270deg);
    opacity: 1;
  }
}

/* Button Hover Effects */
.btn {
  position: relative;
  overflow: hidden;
}

.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;
}

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

.btn-primary {
  position: relative;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.btn-primary:active::after {
  width: 300px;
  height: 300px;
}

/* Card Hover Effects */
.feature-card,
.algorithm-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before,
.algorithm-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s;
  opacity: 0;
}

.feature-card:hover::before,
.algorithm-card:hover::before {
  animation: dataFlow 0.6s ease-in-out;
  opacity: 1;
}

/* Icon Animations */
.feature-icon-large,
.algorithm-icon {
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon-large,
.algorithm-card:hover .algorithm-icon {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.5));
}

/* Text Animations */
.hero-title .title-accent {
  background: linear-gradient(45deg, var(--accent-cyan), var(--accent-green), var(--accent-cyan));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
}

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

/* Loading Animations */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}

/* Typing Effect */
.typing-effect {
  overflow: hidden;
  border-right: 2px solid var(--accent-cyan);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* Glitch Effect */
.glitch {
  position: relative;
  color: var(--text-primary);
  animation: glitch 2s infinite;
}

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

.glitch::before {
  animation: glitch-1 0.5s infinite;
  color: var(--accent-cyan);
  z-index: -1;
}

.glitch::after {
  animation: glitch-2 0.5s infinite;
  color: var(--accent-green);
  z-index: -2;
}

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

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

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

/* Matrix Rain Background */
.matrix-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.1;
}

.matrix-column {
  position: absolute;
  top: -100px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent-cyan);
  animation: matrixRain 10s linear infinite;
}

.matrix-column:nth-child(odd) {
  color: var(--accent-green);
  animation-duration: 12s;
}

.matrix-column:nth-child(3n) {
  animation-duration: 8s;
}

/* Data Stream Effect */
.data-stream {
  position: relative;
  overflow: hidden;
}

.data-stream::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.1), transparent);
  animation: dataStream 2s infinite;
}

@keyframes dataStream {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Pulse Animation for CTAs */
.btn-primary,
.pricing-card.featured {
  animation: glow 2s infinite;
}

/* Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Parallax Effect */
.parallax {
  transform: translateZ(0);
  transition: transform 0.1s ease-out;
}

/* Stagger Animation for Lists */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  animation: staggerIn 0.6s ease-out forwards;
}

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

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

/* Magnetic Hover Effect */
.magnetic {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.magnetic:hover {
  transform: scale(1.05);
}

/* Neon Glow Effect */
.neon-glow {
  text-shadow: 
    0 0 5px var(--accent-cyan),
    0 0 10px var(--accent-cyan),
    0 0 15px var(--accent-cyan),
    0 0 20px var(--accent-cyan);
  animation: neonFlicker 2s infinite alternate;
}

@keyframes neonFlicker {
  0%, 100% {
    text-shadow: 
      0 0 5px var(--accent-cyan),
      0 0 10px var(--accent-cyan),
      0 0 15px var(--accent-cyan),
      0 0 20px var(--accent-cyan);
  }
  50% {
    text-shadow: 
      0 0 2px var(--accent-cyan),
      0 0 5px var(--accent-cyan),
      0 0 8px var(--accent-cyan),
      0 0 12px var(--accent-cyan);
  }
}

/* Cyber Grid Animation */
.cyber-grid {
  background-image: 
    linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: cyberMove 20s linear infinite;
}

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

/* Hologram Effect */
.hologram {
  position: relative;
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.hologram::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
  animation: hologramScan 3s infinite;
}

@keyframes hologramScan {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Responsive Animation Adjustments */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .floating-elements .element {
    display: none;
  }
  
  .circuit-pattern {
    opacity: 0.1;
    animation-duration: 30s;
  }
  
  .btn::before {
    display: none;
  }
}

/* High Performance Animations */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Accessibility - Respect User Preferences */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .hero-content > *,
  .feature-card,
  .algorithm-card,
  .btn,
  .circuit-pattern,
  .floating-elements .element {
    animation: none !important;
    transition: none !important;
  }
  
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Print Styles - Remove Animations */
@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .floating-elements,
  .circuit-pattern,
  .matrix-rain {
    display: none !important;
  }
}