/* ═══════════════════════════════════════════════════════════════════
   IT VERSE - ENHANCED CYBERPUNK THEME
   Ultra-Modern Design with Performance-Optimized Animations
   ═══════════════════════════════════════════════════════════════════ */

/* ═══ ADVANCED PARTICLE SYSTEM ═══ */
@keyframes particle-float-1 {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0.6; }
  25% { transform: translate3d(10px, -15px, 0) rotate(90deg); opacity: 0.8; }
  50% { transform: translate3d(-5px, -30px, 0) rotate(180deg); opacity: 1; }
  75% { transform: translate3d(-15px, -15px, 0) rotate(270deg); opacity: 0.8; }
}

@keyframes particle-float-2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.5; }
  33% { transform: translate3d(-20px, 20px, 0) scale(1.2); opacity: 0.8; }
  66% { transform: translate3d(20px, -20px, 0) scale(0.8); opacity: 0.6; }
}

@keyframes particle-glow {
  0%, 100% { filter: brightness(1) blur(0px); }
  50% { filter: brightness(1.5) blur(2px); }
}

.particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  will-change: transform, opacity;
}

.particle-1 { 
  background: radial-gradient(circle, #00f5ff, transparent);
  animation: particle-float-1 20s ease-in-out infinite, particle-glow 4s ease-in-out infinite;
  top: 10%; left: 15%;
}

.particle-2 { 
  background: radial-gradient(circle, #8b5cf6, transparent);
  animation: particle-float-2 25s ease-in-out infinite, particle-glow 5s ease-in-out infinite 1s;
  top: 30%; left: 60%;
  width: 6px; height: 6px;
}

.particle-3 { 
  background: radial-gradient(circle, #ff006e, transparent);
  animation: particle-float-1 30s ease-in-out infinite reverse, particle-glow 6s ease-in-out infinite 2s;
  top: 60%; left: 80%;
  width: 3px; height: 3px;
}

.particle-4 { 
  background: radial-gradient(circle, #39ff14, transparent);
  animation: particle-float-2 22s ease-in-out infinite reverse, particle-glow 4.5s ease-in-out infinite 1.5s;
  top: 80%; left: 25%;
  width: 5px; height: 5px;
}

.particle-5 { 
  background: radial-gradient(circle, #00f5ff, transparent);
  animation: particle-float-1 27s ease-in-out infinite, particle-glow 5.5s ease-in-out infinite 0.5s;
  top: 45%; left: 40%;
}

/* ═══ ENHANCED CARD HOVER EFFECTS ═══ */
.card-enhanced {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card-enhanced::before {
  content: '';
  position: absolute;
  inset: -100%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--itv-accent) 90deg,
    transparent 180deg,
    var(--itv-primary) 270deg,
    transparent 360deg
  );
  animation: card-rotate 6s linear infinite;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.card-enhanced:hover::before {
  opacity: 0.15;
}

@keyframes card-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.card-enhanced::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0,245,255,0.1) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.card-enhanced:hover::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* 3D Tilt Effect on Hover */
.card-3d {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-3d:hover {
  transform: rotateX(2deg) rotateY(-2deg) translateZ(10px);
  box-shadow: 
    0 25px 70px rgba(0, 0, 0, 0.4),
    0 0 100px rgba(139, 92, 246, 0.2),
    0 5px 20px rgba(0, 245, 255, 0.3);
}

/* ═══ RIPPLE WAVE ANIMATION ═══ */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,245,255,0.4), transparent 70%);
  width: 100px;
  height: 100px;
  pointer-events: none;
  animation: ripple 1s ease-out;
}

/* ═══ MAGNETIC BUTTON EFFECT ═══ */
.btn-magnetic {
  position: relative;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-magnetic::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(45deg, 
    var(--itv-accent), 
    var(--itv-primary), 
    var(--itv-accent-2), 
    var(--itv-primary)
  );
  background-size: 300% 300%;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: gradient-shift 3s ease infinite;
  z-index: -1;
  filter: blur(8px);
}

.btn-magnetic:hover::before {
  opacity: 1;
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ═══ HOLOGRAPHIC TEXT EFFECT ═══ */
@keyframes holographic-text {
  0%, 100% {
    background-position: 0% 50%;
    filter: hue-rotate(0deg) brightness(1);
  }
  50% {
    background-position: 100% 50%;
    filter: hue-rotate(10deg) brightness(1.2);
  }
}

.text-holographic {
  background: linear-gradient(
    90deg,
    #00f5ff 0%,
    #8b5cf6 25%,
    #ff006e 50%,
    #8b5cf6 75%,
    #00f5ff 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: holographic-text 4s linear infinite;
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
}

/* ═══ NEON PULSE EFFECT ═══ */
@keyframes neon-pulse {
  0%, 100% {
    box-shadow: 
      0 0 5px var(--itv-accent),
      0 0 10px var(--itv-accent),
      0 0 20px var(--itv-accent),
      0 0 40px var(--itv-accent),
      inset 0 0 10px rgba(0, 245, 255, 0.1);
    border-color: var(--itv-accent);
  }
  50% {
    box-shadow: 
      0 0 10px var(--itv-accent),
      0 0 20px var(--itv-accent),
      0 0 40px var(--itv-accent),
      0 0 80px var(--itv-accent),
      inset 0 0 15px rgba(0, 245, 255, 0.2);
    border-color: rgba(0, 245, 255, 1);
  }
}

.neon-pulse {
  border: 2px solid var(--itv-accent);
  animation: neon-pulse 2s ease-in-out infinite;
}

/* ═══ SCANNING LINE EFFECT ═══ */
@keyframes scan-line {
  0% {
    top: -100%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.scan-effect {
  position: relative;
  overflow: hidden;
}

.scan-effect::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--itv-accent) 50%,
    transparent
  );
  box-shadow: 0 0 20px var(--itv-accent);
  animation: scan-line 4s ease-in-out infinite;
  pointer-events: none;
}

/* ═══ GLOW ORBS FLOATING ═══ */
@keyframes orb-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  25% {
    transform: translate(50px, -50px) scale(1.2);
    opacity: 0.6;
  }
  50% {
    transform: translate(-30px, -100px) scale(0.8);
    opacity: 0.4;
  }
  75% {
    transform: translate(-60px, -50px) scale(1.1);
    opacity: 0.5;
  }
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  will-change: transform, opacity;
}

.orb-purple {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
  top: -100px;
  right: -100px;
  animation: orb-float 20s ease-in-out infinite;
}

.orb-cyan {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(0, 245, 255, 0.3), transparent 70%);
  bottom: -100px;
  left: -100px;
  animation: orb-float 25s ease-in-out infinite reverse;
}

.orb-pink {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 0, 110, 0.35), transparent 70%);
  top: 50%;
  left: 50%;
  animation: orb-float 30s ease-in-out infinite;
  animation-delay: 5s;
}

/* ═══ GLASS MORPHISM ENHANCED ═══ */
.glass-morph-ultra {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.glass-morph-ultra:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 245, 255, 0.3);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(0, 245, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ═══ SHIMMER LOADING EFFECT ═══ */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer-effect {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ═══ LIQUID BUTTON EFFECT ═══ */
@keyframes liquid-blob {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  50% {
    border-radius: 40% 60% 50% 60% / 60% 40% 60% 50%;
  }
  75% {
    border-radius: 70% 30% 50% 60% / 40% 50% 60% 50%;
  }
}

.btn-liquid {
  position: relative;
  overflow: hidden;
}

.btn-liquid::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, var(--itv-accent), transparent 70%);
  animation: liquid-blob 8s ease-in-out infinite;
  opacity: 0.3;
  filter: blur(20px);
  z-index: -1;
}

/* ═══ PARALLAX SCROLL EFFECT ═══ */
.parallax-layer {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

.parallax-layer-1 {
  transform: translateZ(-50px) scale(1.05);
}

.parallax-layer-2 {
  transform: translateZ(-100px) scale(1.1);
}

.parallax-layer-3 {
  transform: translateZ(-150px) scale(1.15);
}

/* ═══ PIXEL TRANSITION EFFECT ═══ */
@keyframes pixelate-in {
  0% {
    filter: blur(10px);
    opacity: 0;
    transform: scale(0.9);
  }
  50% {
    filter: blur(5px);
  }
  100% {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
  }
}

.pixelate-in {
  animation: pixelate-in 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ═══ ENERGY FIELD EFFECT ═══ */
@keyframes energy-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.energy-field {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, transparent 20%, var(--itv-accent) 20%, var(--itv-accent) 21%, transparent 21%);
  background-size: 30px 30px;
  opacity: 0.1;
  animation: energy-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

/* ═══ CIRCUIT BOARD PATTERN ═══ */
.circuit-pattern {
  position: relative;
}

.circuit-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(90deg, transparent 50%, rgba(0,245,255,0.03) 50%),
    linear-gradient(0deg, transparent 50%, rgba(139,92,246,0.03) 50%);
  background-size: 20px 20px;
  pointer-events: none;
}

/* ═══ TYPING CURSOR EFFECT ═══ */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-cursor::after {
  content: '|';
  color: var(--itv-accent);
  animation: cursor-blink 1s step-end infinite;
  margin-left: 2px;
}

/* ═══ LIGHTNING BOLT EFFECT ═══ */
@keyframes lightning-flash {
  0%, 90%, 100% {
    opacity: 0;
  }
  91%, 93%, 95% {
    opacity: 1;
  }
  92%, 94% {
    opacity: 0.5;
  }
}

.lightning-effect {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 245, 255, 0.3) 50%,
    transparent 100%
  );
  opacity: 0;
  animation: lightning-flash 8s ease-in-out infinite;
  pointer-events: none;
}

/* ═══ CHROMATIC ABERRATION ═══ */
@keyframes chromatic-aberration {
  0%, 100% {
    text-shadow: 
      -2px 0 0 rgba(255, 0, 110, 0.7),
      2px 0 0 rgba(0, 245, 255, 0.7);
  }
  50% {
    text-shadow: 
      2px 0 0 rgba(255, 0, 110, 0.7),
      -2px 0 0 rgba(0, 245, 255, 0.7);
  }
}

.chromatic-text {
  animation: chromatic-aberration 3s ease-in-out infinite;
}

/* ═══ HEXAGON GRID PATTERN ═══ */
.hexagon-grid {
  position: relative;
  background-image: 
    linear-gradient(30deg, rgba(0,245,255,0.05) 12%, transparent 12.5%, transparent 87%, rgba(0,245,255,0.05) 87.5%),
    linear-gradient(150deg, rgba(0,245,255,0.05) 12%, transparent 12.5%, transparent 87%, rgba(0,245,255,0.05) 87.5%),
    linear-gradient(30deg, rgba(0,245,255,0.05) 12%, transparent 12.5%, transparent 87%, rgba(0,245,255,0.05) 87.5%),
    linear-gradient(150deg, rgba(0,245,255,0.05) 12%, transparent 12.5%, transparent 87%, rgba(0,245,255,0.05) 87.5%);
  background-size: 80px 140px;
  background-position: 0 0, 0 0, 40px 70px, 40px 70px;
}

/* ═══ GLOWING EDGES ═══ */
.glow-edges {
  position: relative;
}

.glow-edges::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    45deg,
    var(--itv-accent),
    var(--itv-primary),
    var(--itv-accent-2),
    var(--itv-accent)
  );
  background-size: 300% 300%;
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: gradient-shift 4s ease infinite;
  filter: blur(1px);
}

/* ═══ SMOOTH PAGE TRANSITIONS ═══ */
@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.98);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.page-transition {
  animation: page-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ═══ GRID FADE REVEAL ═══ */
@keyframes grid-reveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.grid-item {
  animation: grid-reveal 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.grid-item:nth-child(1) { animation-delay: 0.05s; }
.grid-item:nth-child(2) { animation-delay: 0.1s; }
.grid-item:nth-child(3) { animation-delay: 0.15s; }
.grid-item:nth-child(4) { animation-delay: 0.2s; }
.grid-item:nth-child(5) { animation-delay: 0.25s; }
.grid-item:nth-child(6) { animation-delay: 0.3s; }
.grid-item:nth-child(7) { animation-delay: 0.35s; }
.grid-item:nth-child(8) { animation-delay: 0.4s; }
.grid-item:nth-child(9) { animation-delay: 0.45s; }
.grid-item:nth-child(n+10) { animation-delay: 0.5s; }

/* ═══ PERFORMANCE OPTIMIZATIONS ═══ */
.card-enhanced,
.btn-magnetic,
.glass-morph-ultra,
.particle,
.glow-orb {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduce animations on low-power devices */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .particle,
  .glow-orb,
  .lightning-effect,
  .energy-field {
    display: none !important;
  }
}

/* ═══ RESPONSIVE OPTIMIZATIONS ═══ */
@media (max-width: 768px) {
  /* Disable heavy effects on mobile */
  .glow-orb,
  .particle {
    display: none;
  }
  
  .card-enhanced::before,
  .energy-field,
  .lightning-effect {
    display: none;
  }
  
  /* Simplify hover effects */
  .card-3d:hover {
    transform: translateY(-4px);
  }
}

/* ═══ UTILITY CLASSES ═══ */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 100px rgba(139, 92, 246, 0.2);
}

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 
    0 0 30px var(--itv-accent),
    0 0 60px var(--itv-primary),
    0 20px 60px rgba(0, 0, 0, 0.3);
}

.text-gradient-animated {
  background: linear-gradient(
    -45deg,
    var(--itv-accent),
    var(--itv-primary),
    var(--itv-accent-2),
    var(--itv-accent-3)
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 5s ease infinite;
}

.border-animated {
  background: linear-gradient(
    60deg,
    var(--itv-accent),
    var(--itv-primary),
    var(--itv-accent-2),
    var(--itv-primary)
  );
  background-size: 300% 300%;
  animation: gradient-shift 4s ease infinite;
  padding: 2px;
  border-radius: inherit;
}

.border-animated > * {
  background: var(--itv-bg-soft);
  border-radius: inherit;
  padding: 1rem;
}

/* ═══ SKELETON LOADING (ENHANCED) ═══ */
@keyframes skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(200%);
  }
}

.skeleton-loader {
  position: relative;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  overflow: hidden;
}

.skeleton-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 245, 255, 0.2) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 2s ease-in-out infinite;
}

/* ═══ INTERACTIVE HOVER STATES ═══ */
.interactive-card {
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-card:hover {
  transform: translateY(-10px) scale(1.02);
  z-index: 10;
}

.interactive-card:hover::before {
  content: '';
  position: absolute;
  inset: -50px;
  background: radial-gradient(
    circle at center,
    rgba(0, 245, 255, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

/* ═══ NEON UNDERLINE ═══ */
.neon-underline {
  position: relative;
  display: inline-block;
}

.neon-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--itv-accent);
  box-shadow: 
    0 0 10px var(--itv-accent),
    0 0 20px var(--itv-accent);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.neon-underline:hover::after {
  width: 100%;
}

/* ═══ FLOATING LABELS ═══ */
@keyframes float-up-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.floating-label {
  animation: float-up-down 3s ease-in-out infinite;
}

/* ═══ BACKDROP BLUR ENHANCED ═══ */
.blur-backdrop {
  backdrop-filter: blur(40px) saturate(180%) brightness(110%);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(110%);
}

/* ═══ CODE BLOCK ENHANCEMENTS ═══ */
.code-enhanced {
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  overflow: hidden;
}

.code-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.15),
    rgba(0, 245, 255, 0.1)
  );
  border-bottom: 1px solid rgba(0, 245, 255, 0.2);
}

.code-enhanced pre {
  margin-top: 40px;
  padding: 1.5rem;
  background: transparent;
}

/* ═══ PERFORMANCE MONITORING ═══ */
/* These classes help with performance debugging */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  perspective: 1000px;
}

.no-blur-on-transform {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
