/*--------------------------------------------------------------
	ULTRACORP - Cyberpunk Animations & Effects
--------------------------------------------------------------*/

/* ============================================
   1. GLITCH EFFECT FOR TITLE
============================================ */
@keyframes glitch {
  0% {
    text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                -0.05em -0.025em 0 rgba(0, 255, 0, 0.75),
                -0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
  }
  14% {
    text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                -0.05em -0.025em 0 rgba(0, 255, 0, 0.75),
                -0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
  }
  15% {
    text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
                 0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
                -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
  }
  49% {
    text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
                 0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
                -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
  }
  50% {
    text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
                 0.05em 0 0 rgba(0, 255, 0, 0.75),
                 0 -0.05em 0 rgba(0, 0, 255, 0.75);
  }
  99% {
    text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
                 0.05em 0 0 rgba(0, 255, 0, 0.75),
                 0 -0.05em 0 rgba(0, 0, 255, 0.75);
  }
  100% {
    text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75),
                -0.025em -0.025em 0 rgba(0, 255, 0, 0.75),
                -0.025em -0.05em 0 rgba(0, 0, 255, 0.75);
  }
}

.glitch-effect {
  animation: glitch 1s linear infinite;
}

/* Subtle continuous glitch */
.glitch-subtle {
  animation: glitch 3s ease-in-out infinite;
}

/* Glitch on hover only */
.glitch-hover:hover {
  animation: glitch 0.5s linear 2;
}

/* ============================================
   2. EYE SCANNER EFFECT
============================================ */
@keyframes scan {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(100%);
    opacity: 0;
  }
}

.eye-scanner {
  position: relative;
  overflow: hidden;
}

.eye-scanner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00ffff, transparent);
  box-shadow: 0 0 10px #00ffff;
  animation: scan 3s ease-in-out infinite;
  z-index: 10;
}

/* ============================================
   3. NEON GLOW PULSE
============================================ */
@keyframes neon-pulse {
  0%, 100% {
    text-shadow: 0 0 10px #fff,
                 0 0 20px #fff,
                 0 0 30px #fff,
                 0 0 40px #00ffff,
                 0 0 70px #00ffff,
                 0 0 80px #00ffff;
  }
  50% {
    text-shadow: 0 0 5px #fff,
                 0 0 10px #fff,
                 0 0 15px #fff,
                 0 0 20px #00ffff,
                 0 0 35px #00ffff,
                 0 0 40px #00ffff;
  }
}

.neon-glow {
  animation: neon-pulse 2s ease-in-out infinite;
}

/* ============================================
   4. FLOATING PARTICLES BACKGROUND
============================================ */
@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100vh) translateX(20px);
    opacity: 0;
  }
}

.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #00ffff;
  box-shadow: 0 0 5px #00ffff;
  border-radius: 50%;
  animation: float linear infinite;
}

/* ============================================
   5. TYPING/TERMINAL EFFECT
============================================ */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: #00ffff;
  }
}

.typing-effect {
  overflow: hidden;
  border-right: 0.15em solid #00ffff;
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.15em;
  animation: typing 3s steps(40, end),
             blink-caret 0.75s step-end infinite;
}

/* ============================================
   6. HOVER EFFECTS FOR GAME CARDS
============================================ */
@keyframes glitch-hover {
  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);
  }
}

.game-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.game-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff);
  background-size: 400%;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
  animation: gradient-shift 3s ease infinite;
}

.game-card:hover::before {
  opacity: 0.5;
}

.game-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  animation: glitch-hover 0.3s ease;
}

.game-card:hover img {
  filter: brightness(1.2) contrast(1.1);
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ============================================
   7. NEURAL SCAN LOADER
============================================ */
@keyframes neural-pulse {
  0%, 100% {
    transform: scale(0.8);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes neural-connect {
  0% {
    stroke-dashoffset: 1000;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.neural-loader {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.neural-loader div {
  position: absolute;
  border: 4px solid #00ffff;
  opacity: 1;
  border-radius: 50%;
  animation: neural-pulse 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.neural-loader div:nth-child(2) {
  animation-delay: -0.5s;
}

/* ============================================
   8. SCANLINES OVERLAY
============================================ */
@keyframes scanlines {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(10px);
  }
}

.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 255, 255, 0.02) 51%
  );
  background-size: 100% 4px;
  z-index: 999;
  animation: scanlines 0.5s linear infinite;
  opacity: 0.3;
}

/* ============================================
   9. HOLOGRAM EFFECT
============================================ */
@keyframes hologram {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

.hologram-effect {
  animation: hologram 2s ease-in-out infinite;
  opacity: 0.95;
}

/* ============================================
   10. RGB SPLIT EFFECT
============================================ */
.rgb-split {
  position: relative;
  display: inline-block;
}

.rgb-split::before,
.rgb-split::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.rgb-split::before {
  color: #ff0000;
  animation: rgb-shift-red 3s ease-in-out infinite;
  z-index: -1;
}

.rgb-split::after {
  color: #00ffff;
  animation: rgb-shift-cyan 3s ease-in-out infinite;
  z-index: -1;
}

@keyframes rgb-shift-red {
  0%, 100% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(2px, -1px);
  }
  66% {
    transform: translate(-2px, 1px);
  }
}

@keyframes rgb-shift-cyan {
  0%, 100% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(-2px, 1px);
  }
  66% {
    transform: translate(2px, -1px);
  }
}

/* ============================================
   11. MATRIX RAIN (subtle)
============================================ */
@keyframes matrix-rain {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

.matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: 0.1;
}

.matrix-char {
  position: absolute;
  color: #00ffff;
  font-family: monospace;
  font-size: 14px;
  animation: matrix-rain linear infinite;
}

/* ============================================
   12. DIGITAL WIPE TRANSITION
============================================ */
@keyframes digital-wipe {
  0% {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

.digital-wipe {
  animation: digital-wipe 1s ease-out forwards;
}

/* ============================================
   13. HUD INTERFACE ELEMENTS
============================================ */
.hud-corner {
  position: relative;
}

.hud-corner::before,
.hud-corner::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid #00ffff;
}

.hud-corner::before {
  top: -5px;
  left: -5px;
  border-right: none;
  border-bottom: none;
}

.hud-corner::after {
  bottom: -5px;
  right: -5px;
  border-left: none;
  border-top: none;
}

/* ============================================
   14. RESPONSIVE ADJUSTMENTS
============================================ */
@media (max-width: 768px) {
  .glitch-effect {
    animation-duration: 2s;
  }

  .particle {
    width: 1px;
    height: 1px;
  }

  .scanlines {
    opacity: 0.15;
  }
}

/* ============================================
   15. PERFORMANCE OPTIMIZATIONS
============================================ */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}
