/* Space Club Recruitment Landing Page - Animations */

/* Starfield Background Animations */
.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #eee, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: twinkle 4s ease-in-out infinite;
}

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

.layer-2 {
  animation-duration: 8s;
  animation-delay: 2s;
  background-size: 300px 150px;
}

.layer-3 {
  animation-duration: 10s;
  animation-delay: 4s;
  background-size: 400px 200px;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Nebula Gradient Animation */
.nebula-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(122, 162, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(155, 122, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(98, 255, 167, 0.05) 0%, transparent 50%);
  animation: nebulaShift 20s ease-in-out infinite;
}

@keyframes nebulaShift {
  0%, 100% { 
    transform: scale(1) rotate(0deg);
    opacity: 0.3;
  }
  50% { 
    transform: scale(1.1) rotate(180deg);
    opacity: 0.5;
  }
}

/* Enhanced Button Animations */
.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.6s ease;
}

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

.btn-primary {
  animation: pulseGlow 2s ease-in-out infinite;
}

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

/* Content Card Animations */
.content-card {
  animation: slideInUp 1s ease-out;
}

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

/* Step Animations */
.step {
  animation: fadeInLeft 0.8s ease-out;
}

.step:nth-child(1) {
  animation-delay: 0.2s;
}

.step:nth-child(2) {
  animation-delay: 0.4s;
}

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

/* Title Animations */
.main-title {
  animation: titleReveal 1.5s ease-out;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.main-subtitle {
  animation: subtitleReveal 1.5s ease-out 0.3s both;
}

@keyframes subtitleReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Floating Elements */
.spacecraft-1 {
  animation: floatAndRotate 8s ease-in-out infinite;
}

.spacecraft-2 {
  animation: floatAndRotate 8s ease-in-out infinite reverse;
}

.satellite {
  animation: orbit 12s linear infinite;
}

@keyframes floatAndRotate {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg) scale(1);
  }
  25% { 
    transform: translateY(-15px) rotate(5deg) scale(1.05);
  }
  50% { 
    transform: translateY(-25px) rotate(0deg) scale(1.1);
  }
  75% { 
    transform: translateY(-15px) rotate(-5deg) scale(1.05);
  }
}

@keyframes orbit {
  0% { 
    transform: rotate(0deg) translateX(20px) rotate(0deg);
  }
  100% { 
    transform: rotate(360deg) translateX(20px) rotate(-360deg);
  }
}

/* Enhanced Meteor Animation */
.meteor {
  animation: meteorTrail 6s linear infinite;
}

@keyframes meteorTrail {
  0% {
    transform: translateX(0) translateY(0);
    opacity: 1;
    box-shadow: 0 0 10px var(--accent-warning);
  }
  10% {
    opacity: 1;
    box-shadow: 0 0 20px var(--accent-warning);
  }
  100% {
    transform: translateX(-300px) translateY(300px);
    opacity: 0;
    box-shadow: 0 0 5px var(--accent-warning);
  }
}

/* Loading Screen Animations */
.loading-screen {
  animation: fadeIn 0.5s ease-out;
}

.loading-spinner {
  animation: spinAndGlow 1.5s linear infinite;
}

@keyframes spinAndGlow {
  0% { 
    transform: rotate(0deg);
    box-shadow: 0 0 10px var(--accent-primary);
  }
  50% { 
    box-shadow: 0 0 20px var(--accent-primary);
  }
  100% { 
    transform: rotate(360deg);
    box-shadow: 0 0 10px var(--accent-primary);
  }
}

/* Parallax Effect for Background Elements */
.starfield {
  transform: translateZ(0);
  will-change: transform;
}

/* Hover Effects for Interactive Elements */
.step:hover .step-number {
  animation: numberPulse 0.6s ease-in-out;
}

@keyframes numberPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Mobile Animation Optimizations */
@media (max-width: 768px) {
  .floating-elements {
    display: none;
  }
  
  .content-card {
    animation: slideInUp 0.6s ease-out;
  }
  
  .step {
    animation: fadeInUp 0.4s ease-out;
  }
  
  /* Optimize button animations for touch */
  .btn {
    transition: transform 0.15s ease, opacity 0.15s ease;
  }
  
  .btn:active {
    transform: scale(0.98);
    opacity: 0.8;
  }
  
  /* Reduce animation complexity on mobile */
  .main-title .title-line {
    animation: none;
  }
  
  .step-number {
    animation: none;
  }
  
  /* Optimize starfield for mobile */
  .stars {
    animation-duration: 8s;
  }
  
  .layer-1 { animation-duration: 10s; }
  .layer-2 { animation-duration: 12s; }
  .layer-3 { animation-duration: 15s; }
}

/* Extra mobile optimizations */
@media (max-width: 480px) {
  .content-card {
    animation: fadeIn 0.5s ease-out;
  }
  
  .step {
    animation: fadeIn 0.3s ease-out;
  }
  
  /* Disable complex animations on very small screens */
  .nebula-gradient {
    animation: none;
  }
  
  .stars {
    animation: none;
    opacity: 0.5;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .starfield,
  .nebula-gradient,
  .floating-elements {
    display: none;
  }
  
  .btn::before {
    display: none;
  }
}

/* Performance Optimizations */
.starfield,
.floating-elements,
.nebula-gradient {
  will-change: transform, opacity;
}

/* Smooth Scrolling Enhancement */
html {
  scroll-behavior: smooth;
}

/* Focus Animations for Accessibility */
.btn:focus,
.step:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  animation: focusGlow 0.3s ease-out;
}

@keyframes focusGlow {
  0% { box-shadow: 0 0 0 0 rgba(122, 162, 255, 0.7); }
  100% { box-shadow: 0 0 0 4px rgba(122, 162, 255, 0); }
}


