/* =========================================
   ATOMIC LAB - COMPREHENSIVE ANIMATIONS
   Quantum-inspired effects and transitions
   ========================================= */

/* =================
   KEYFRAME ANIMATIONS
   ================= */

/* Quantum Particle Floating */
@keyframes quantum-float {
  0%, 100% { 
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0.6;
  }
  25% { 
    transform: translate3d(20px, -30px, 0) rotate(90deg);
    opacity: 1;
  }
  50% { 
    transform: translate3d(-15px, -60px, 0) rotate(180deg);
    opacity: 0.8;
  }
  75% { 
    transform: translate3d(-35px, -20px, 0) rotate(270deg);
    opacity: 0.9;
  }
}

/* Atom Nucleus Pulse */
@keyframes nucleus-pulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 20px var(--neon-blue);
  }
  50% { 
    transform: scale(1.2);
    box-shadow: 0 0 40px var(--neon-blue), 0 0 60px var(--plasma-purple);
  }
}

/* Holographic Glitch */
@keyframes holographic-glitch {
  0%, 100% { 
    transform: translateX(0);
    opacity: 1;
  }
  10% { 
    transform: translateX(-2px);
    opacity: 0.8;
  }
  20% { 
    transform: translateX(2px);
    opacity: 1;
  }
  30% { 
    transform: translateX(-1px);
    opacity: 0.9;
  }
  40% { 
    transform: translateX(1px);
    opacity: 1;
  }
}

/* Scan Line Movement */
@keyframes scan-line {
  0% { 
    transform: translateY(-100vh);
    opacity: 0;
  }
  10%, 90% { 
    opacity: 1;
  }
  100% { 
    transform: translateY(100vh);
    opacity: 0;
  }
}

/* Energy Flow */
@keyframes energy-flow {
  0% { 
    transform: translateX(-100%);
    opacity: 0;
  }
  50% { 
    opacity: 1;
  }
  100% { 
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Element Glow Pulse */
@keyframes element-glow {
  0%, 100% { 
    box-shadow: 0 0 10px var(--element-color, var(--neon-blue));
  }
  50% { 
    box-shadow: 
      0 0 20px var(--element-color, var(--neon-blue)),
      0 0 40px var(--element-color, var(--neon-blue)),
      inset 0 0 20px rgba(255, 255, 255, 0.1);
  }
}

/* Reactor Core Rotation */
@keyframes reactor-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Text Revelation */
@keyframes text-reveal {
  0% { 
    transform: translateY(100%);
    opacity: 0;
  }
  100% { 
    transform: translateY(0);
    opacity: 1;
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Scale In */
@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide In Left */
@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translate3d(-100%, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Slide In Right */
@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* =================
   BACKGROUND EFFECTS
   ================= */

/* Quantum Particles Background */
.quantum-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.quantum-particles::before,
.quantum-particles::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--neon-blue);
  border-radius: 50%;
  animation: quantum-float 8s infinite linear;
  box-shadow: 0 0 10px var(--neon-blue);
}

.quantum-particles::before {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  animation-duration: 12s;
}

.quantum-particles::after {
  top: 60%;
  right: 15%;
  background: var(--plasma-purple);
  box-shadow: 0 0 10px var(--plasma-purple);
  animation-delay: 4s;
  animation-duration: 10s;
}

/* Scan Lines Effect */
.scan-lines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.1;
}

.scan-lines::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--neon-blue) 50%, 
    transparent 100%
  );
  animation: scan-line 4s infinite linear;
}

.scan-lines::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 212, 255, 0.03) 2px,
    rgba(0, 212, 255, 0.03) 4px
  );
}

/* =================
   ELEMENT ANIMATIONS
   ================= */

/* Element Card Hover Effects */
.element-hex {
  transition: all var(--duration-normal) var(--ease-out);
}

/* Disabled - using 2x scale from atomic-lab.css
.element-hex:hover {
  transform: translateY(-8px) scale(1.05);
  z-index: 10;
} */


/* Enhanced Element Categories */
.element-alkali .hex-inner {
  background: radial-gradient(circle, 
    rgba(255, 23, 68, 0.1) 0%, 
    transparent 70%
  );
  border-color: var(--color-alkali);
}

.element-alkaline .hex-inner {
  background: radial-gradient(circle, 
    rgba(255, 107, 0, 0.1) 0%, 
    transparent 70%
  );
  border-color: var(--color-alkaline);
}

.element-transition .hex-inner {
  background: radial-gradient(circle, 
    rgba(0, 188, 212, 0.1) 0%, 
    transparent 70%
  );
  border-color: var(--color-transition);
}

.element-metalloid .hex-inner {
  background: radial-gradient(circle, 
    rgba(139, 195, 74, 0.1) 0%, 
    transparent 70%
  );
  border-color: var(--color-metalloid);
}

.element-nonmetal .hex-inner {
  background: radial-gradient(circle, 
    rgba(255, 215, 0, 0.1) 0%, 
    transparent 70%
  );
  border-color: var(--color-nonmetal);
}

.element-halogen .hex-inner {
  background: radial-gradient(circle, 
    rgba(0, 230, 118, 0.1) 0%, 
    transparent 70%
  );
  border-color: var(--color-halogen);
}

.element-noble .hex-inner {
  background: radial-gradient(circle, 
    rgba(224, 64, 251, 0.1) 0%, 
    transparent 70%
  );
  border-color: var(--color-noble);
}

.element-lanthanide .hex-inner {
  background: radial-gradient(circle, 
    rgba(255, 64, 129, 0.1) 0%, 
    transparent 70%
  );
  border-color: var(--color-lanthanide);
}

.element-actinide .hex-inner {
  background: radial-gradient(circle, 
    rgba(83, 109, 254, 0.1) 0%, 
    transparent 70%
  );
  border-color: var(--color-actinide);
}

/* =================
   NAVIGATION ANIMATIONS
   ================= */

/* Atom Logo Animation */
.atom-logo {
  position: relative;
  /* Removed animation to prevent blur effect */
}


/* Navigation Links */
.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(0, 212, 255, 0.2), 
    transparent
  );
  transition: left var(--duration-normal) var(--ease-out);
}

.nav-link:hover::before {
  left: 100%;
}

/* =================
   PAGE TRANSITIONS
   ================= */

/* Fade In Effects */
.fade-in {
  opacity: 0;
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.fade-in.delay-1 { animation-delay: 0.2s; }
.fade-in.delay-2 { animation-delay: 0.4s; }
.fade-in.delay-3 { animation-delay: 0.6s; }
.fade-in.delay-4 { animation-delay: 0.8s; }
.fade-in.delay-5 { animation-delay: 1s; }

/* Slide In Effects */
.slide-in-up {
  opacity: 0;
  animation: fadeInUp var(--duration-normal) var(--ease-out) forwards;
}

.slide-in-up.delay-1 { animation-delay: 0.1s; }
.slide-in-up.delay-2 { animation-delay: 0.2s; }
.slide-in-up.delay-3 { animation-delay: 0.3s; }
.slide-in-up.delay-4 { animation-delay: 0.4s; }

/* Scale In Effects */
.scale-in {
  opacity: 0;
  animation: scaleIn var(--duration-normal) var(--ease-out) forwards;
}

.scale-in.delay-1 { animation-delay: 0.1s; }
.scale-in.delay-2 { animation-delay: 0.2s; }
.scale-in.delay-3 { animation-delay: 0.3s; }

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--duration-slow) var(--ease-out);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* =================
   BUTTON ANIMATIONS
   ================= */

/* Hologram Button Effects */
.btn-hologram,
.btn-plasma,
.btn-neon {
  position: relative;
  overflow: hidden;
}

.btn-hologram::before,
.btn-plasma::before,
.btn-neon::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 var(--duration-normal) var(--ease-out);
}

.btn-hologram:hover::before,
.btn-plasma:hover::before,
.btn-neon:hover::before {
  left: 100%;
}

/* Button Hover Effects */
.btn-hologram:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 0 20px var(--neon-blue),
    0 10px 20px rgba(0, 212, 255, 0.3);
}

.btn-plasma:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 0 20px var(--plasma-purple),
    0 10px 20px rgba(189, 0, 255, 0.3);
}

/* =================
   LOADING ANIMATIONS
   ================= */

/* Atomic Loader */
.atomic-loader {
  width: 40px;
  height: 40px;
  position: relative;
  margin: 20px auto;
}

.atomic-loader::before,
.atomic-loader::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-top: 2px solid var(--neon-blue);
  border-radius: 50%;
  animation: reactor-rotate 1s linear infinite;
}

.atomic-loader::after {
  border-top: 2px solid var(--plasma-purple);
  animation-direction: reverse;
  animation-duration: 0.8s;
}

/* Quantum Loader */
.quantum-loader {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.quantum-loader .dot {
  width: 8px;
  height: 8px;
  background: var(--neon-blue);
  border-radius: 50%;
  animation: quantum-float 1.5s ease-in-out infinite;
}

.quantum-loader .dot:nth-child(2) {
  animation-delay: 0.2s;
  background: var(--plasma-purple);
}

.quantum-loader .dot:nth-child(3) {
  animation-delay: 0.4s;
  background: var(--radioactive-green);
}

/* =================
   PARTICLE EFFECTS 
   ================= */

/* Particle Container */
.particle-container {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--neon-blue);
  border-radius: 50%;
  opacity: 0.7;
  animation: quantum-float 6s infinite linear;
}

.particle:nth-child(odd) {
  background: var(--plasma-purple);
  animation-duration: 8s;
}

.particle:nth-child(3n) {
  background: var(--radioactive-green);
  animation-duration: 10s;
}

/* Energy Particles */
.energy-particle {
  position: absolute;
  width: 1px;
  height: 20px;
  background: linear-gradient(180deg, 
    var(--neon-blue) 0%, 
    transparent 100%
  );
  animation: energy-flow 2s ease-out infinite;
}

/* =================
   RESPONSIVE ANIMATIONS
   ================= */

/* Reduce animations on mobile for performance */
@media (max-width: 768px) {
  .quantum-particles::before,
  .quantum-particles::after {
    animation-duration: 20s;
  }
  
  .scan-lines::before {
    animation-duration: 8s;
  }
  
  /* Using 2x scale from atomic-lab.css
  .element-hex:hover {
    transform: translateY(-4px) scale(1.02);
  } */
}

/* High performance mode */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .quantum-particles,
  .scan-lines {
    display: none;
  }
}

/* Low performance fallback */
.low-performance .quantum-particles,
.low-performance .scan-lines,
.low-performance .electron-orbit {
  display: none;
}

/* Using 2x scale from atomic-lab.css
.low-performance .element-hex:hover {
  transform: translateY(-2px);
} */

/* =================
   ACCESSIBILITY
   ================= */

/* Focus indicators */
.element-hex:focus,
.btn-hologram:focus,
.btn-plasma:focus,
.nav-link:focus {
  outline: 2px solid var(--neon-blue);
  outline-offset: 2px;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
  .quantum-particles,
  .scan-lines {
    opacity: 0.3;
  }
  
  .element-hex .hex-inner {
    border-width: 3px;
  }
}