/* ============================================
   FUTURISTIC VISUAL EFFECTS & ANIMATIONS
   ============================================ */

/* Animated Grid Background */
.grid-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.03;
  background-image:
    linear-gradient(var(--color-accent-primary) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-accent-primary) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridScroll 20s linear infinite;
}

@keyframes gridScroll {
  0% {
    transform: perspective(500px) rotateX(60deg) translateY(0);
  }
  100% {
    transform: perspective(500px) rotateX(60deg) translateY(50px);
  }
}

/* Removed messy particle effects - replaced with subtle dot matrix canvas */

/* Glowing Border Animation */
.glow-border {
  position: relative;
  overflow: hidden;
}

.glow-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg,
    var(--color-accent-primary),
    var(--color-accent-secondary),
    var(--color-accent-primary)
  );
  background-size: 400%;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: glowRotate 3s linear infinite;
  pointer-events: none;
}

.glow-border:hover::before {
  opacity: 0.6;
}

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

/* Neon Text Glow - More intense with cyan */
.neon-text {
  text-shadow:
    0 0 10px rgba(0, 240, 255, 1),
    0 0 20px rgba(0, 240, 255, 0.8),
    0 0 30px rgba(0, 240, 255, 0.6),
    0 0 40px rgba(0, 240, 255, 0.4),
    0 0 60px rgba(0, 240, 255, 0.2);
  animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
  from {
    text-shadow:
      0 0 10px rgba(0, 240, 255, 1),
      0 0 20px rgba(0, 240, 255, 0.8),
      0 0 30px rgba(0, 240, 255, 0.6),
      0 0 40px rgba(0, 240, 255, 0.4),
      0 0 60px rgba(0, 240, 255, 0.2);
  }
  to {
    text-shadow:
      0 0 5px rgba(0, 240, 255, 1),
      0 0 15px rgba(0, 240, 255, 0.9),
      0 0 25px rgba(0, 240, 255, 0.7),
      0 0 35px rgba(0, 240, 255, 0.5),
      0 0 50px rgba(0, 240, 255, 0.3);
  }
}

/* Holographic Effect - Vibrant multi-color */
.holographic {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(0, 240, 255, 0.15) 0%,
    rgba(255, 0, 255, 0.15) 25%,
    rgba(0, 255, 159, 0.15) 50%,
    rgba(255, 255, 0, 0.15) 75%,
    rgba(0, 240, 255, 0.15) 100%
  );
  background-size: 400% 400%;
  animation: holoShift 4s ease infinite;
}

@keyframes holoShift {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 100%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 0%; }
  100% { background-position: 0% 50%; }
}

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

.card-3d:hover {
  transform: rotateY(5deg) rotateX(5deg) scale(1.02);
}

/* Disable 3D effects on mobile to prevent scroll issues */
@media (max-width: 767px) {
  .card-3d {
    transform-style: flat;
    transition: none;
  }
  
  .card-3d:hover {
    transform: none;
  }
}

/* Scan Line Effect */
.scanline {
  position: relative;
  overflow: hidden;
}

.scanline::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-accent-primary),
    transparent
  );
  opacity: 0.5;
  animation: scan 3s linear infinite;
  pointer-events: none;
  z-index: -1;
}

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

/* Digital Glitch Effect */
.glitch {
  position: relative;
  animation: glitch 1s linear infinite;
}

@keyframes glitch {
  2%, 64% {
    transform: translate(2px, 0) skew(0deg);
  }
  4%, 60% {
    transform: translate(-2px, 0) skew(0deg);
  }
  62% {
    transform: translate(0, 0) skew(5deg);
  }
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
  pointer-events: none;
  z-index: -1;
}

.glitch::before {
  animation: glitchBefore 0.3s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  color: var(--color-accent-primary);
}

.glitch::after {
  animation: glitchAfter 0.3s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  color: var(--color-accent-secondary);
}

@keyframes glitchBefore {
  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); }
}

@keyframes glitchAfter {
  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); }
}

/* Hexagon Grid Pattern - Bright cyan */
.hex-pattern {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0L93.3 25v50L50 100 6.7 75V25z' fill='none' stroke='rgba(0,240,255,0.2)' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  opacity: 0.5;
  animation: hexMove 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

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

/* Cyberpunk Borders */
.cyber-border {
  position: relative;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--color-bg-elevated), var(--color-bg-elevated)) padding-box,
    linear-gradient(45deg, var(--color-accent-primary), var(--color-accent-secondary)) border-box;
  clip-path: polygon(
    0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px,
    100% calc(100% - 10px), calc(100% - 10px) 100%,
    10px 100%, 0 calc(100% - 10px)
  );
}

/* Pulse Ring */
.pulse-ring {
  position: absolute;
  border: 2px solid var(--color-accent-primary);
  border-radius: 50%;
  animation: pulseRing 2s ease-out infinite;
  opacity: 0;
}

@keyframes pulseRing {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Floating Animation */
.float-animation {
  animation: floating 3s ease-in-out infinite;
}

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

/* Data Stream Effect */
.data-stream {
  position: absolute;
  width: 2px;
  height: 100px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--color-accent-primary),
    transparent
  );
  animation: dataFlow 2s linear infinite;
  opacity: 0.5;
}

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

/* Gradient Shift Background */
.gradient-shift {
  background: linear-gradient(
    -45deg,
    var(--color-bg-deep),
    var(--color-bg-mid),
    var(--color-bg-deep),
    var(--color-bg-elevated)
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

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

/* Tech Lines */
.tech-lines {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(90deg, var(--color-accent-primary) 1px, transparent 1px),
    linear-gradient(var(--color-accent-primary) 1px, transparent 1px);
  background-size: 100px 100px;
  opacity: 0.05;
  animation: techLineMove 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

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

/* Hover Lift Effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow:
    0 20px 40px rgba(0, 240, 255, 0.2),
    0 0 40px rgba(0, 240, 255, 0.1);
}

/* Disable hover lift on mobile to prevent scroll issues */
@media (max-width: 767px) {
  .hover-lift {
    transition: none;
  }
  
  .hover-lift:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Reveal on Scroll */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Interactive Cursor Trail */
.cursor-trail {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-accent-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.1s ease;
  mix-blend-mode: screen;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.8);
}

.cursor-trail.active {
  opacity: 0.8;
  transform: scale(1.5);
}

/* Vibrant Accent Classes */
.accent-cyan { color: #00F0FF; }
.accent-magenta { color: #FF00FF; }
.accent-green { color: #00FF9F; }
.accent-yellow { color: #FFFF00; }

/* Bright Glow Variants */
.glow-cyan {
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.7), 0 0 60px rgba(0, 240, 255, 0.4);
}

.glow-magenta {
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.7), 0 0 60px rgba(255, 0, 255, 0.4);
}

.glow-green {
  box-shadow: 0 0 30px rgba(0, 255, 159, 0.7), 0 0 60px rgba(0, 255, 159, 0.4);
}

/* Multi-color Border Animation */
.rainbow-border {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(var(--color-bg-elevated), var(--color-bg-elevated)) padding-box,
              linear-gradient(90deg, #00F0FF, #FF00FF, #00FF9F, #FFFF00, #00F0FF) border-box;
  animation: rainbowRotate 3s linear infinite;
  background-size: 300% 100%;
}

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