/* Archon-Net Animations */

/* Keyframe Animations */
@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 10px currentColor);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
    filter: drop-shadow(0 0 20px currentColor);
  }
}

@keyframes loading-progress {
  0% {
    width: 0%;
    transform: translateX(-100%);
  }
  50% {
    width: 100%;
    transform: translateX(0%);
  }
  100% {
    width: 100%;
    transform: translateX(100%);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.1);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes node-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

@keyframes loading-shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes progress-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

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

@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fade-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slide-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scale-in {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes glow {
  0%, 100% {
    filter: drop-shadow(0 0 5px currentColor);
  }
  50% {
    filter: drop-shadow(0 0 20px currentColor);
  }
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Animation Classes */
.animate-fade-in {
  animation: fade-in 0.6s ease-out;
}

.animate-fade-in-left {
  animation: fade-in-left 0.6s ease-out;
}

.animate-fade-in-right {
  animation: fade-in-right 0.6s ease-out;
}

.animate-slide-up {
  animation: slide-up 0.6s ease-out;
}

.animate-slide-down {
  animation: slide-down 0.6s ease-out;
}

.animate-scale-in {
  animation: scale-in 0.4s ease-out;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-rotate {
  animation: rotate 2s linear infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Delayed animations for staggered effects */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* Hover animations */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-glow {
  transition: filter var(--transition-normal);
}

.hover-glow:hover {
  filter: drop-shadow(0 0 10px currentColor);
}

.hover-scale {
  transition: transform var(--transition-normal);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-bounce {
  transition: transform var(--transition-fast);
}

.hover-bounce:hover {
  animation: bounce 0.6s;
}

@keyframes bounce {
  0%, 20%, 60%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  80% {
    transform: translateY(-5px);
  }
}

/* Page transition animations */
.page-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-exit {
  opacity: 1;
  transform: translateY(0);
}

.page-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Loading states */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

.spinner-large {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

/* Mystical effects */
.mystical-glow {
  position: relative;
}

.mystical-glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--primary-color));
  border-radius: inherit;
  z-index: -1;
  filter: blur(4px);
  opacity: 0.7;
  animation: mystical-rotate 4s linear infinite;
}

@keyframes mystical-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.text-shimmer {
  background: linear-gradient(90deg, var(--text-primary), var(--primary-light), var(--secondary-light), var(--text-primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shimmer 3s ease-in-out infinite;
}

@keyframes text-shimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Resonance visualization */
.resonance-wave {
  position: relative;
  overflow: hidden;
}

.resonance-wave::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
  animation: resonance-pulse 2s ease-in-out infinite;
}

@keyframes resonance-pulse {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Enhanced Landing Page Animations */

/* Improved network connections */
@keyframes pulse-line {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Network node float animation */
@keyframes node-float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-10px) rotate(120deg);
  }
  66% {
    transform: translateY(5px) rotate(240deg);
  }
}

/* Subtle gradient background shift */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Card hover glow effect */
@keyframes card-glow {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  }
  50% {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
  }
}

/* Text reveal animation */
@keyframes text-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in up for stats */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Timeline drawing effect */
@keyframes timeline-draw {
  from {
    height: 0;
  }
  to {
    height: 100%;
  }
}

/* Button pulse on hover */
@keyframes button-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Applied Animations */
.hero-container {
  background: linear-gradient(-45deg, 
    rgba(59, 130, 246, 0.1), 
    rgba(139, 92, 246, 0.1), 
    rgba(245, 158, 11, 0.05),
    rgba(59, 130, 246, 0.05)
  );
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

.node {
  animation: node-float 6s ease-in-out infinite;
}

.node-1 { animation-delay: 0s; }
.node-2 { animation-delay: 1.2s; }
.node-3 { animation-delay: 2.4s; }
.node-4 { animation-delay: 3.6s; }
.node-5 { animation-delay: 4.8s; }

.research-card:hover, .goal-card:hover {
  animation: card-glow 2s ease-in-out infinite;
}

.hero-title {
  animation: text-reveal 1s ease-out;
}

.hero-subtitle {
  animation: text-reveal 1s ease-out 0.3s both;
}

.stat-item:nth-child(1) {
  animation: fade-in-up 0.8s ease-out 1s both;
}

.stat-item:nth-child(2) {
  animation: fade-in-up 0.8s ease-out 1.3s both;
}

.stat-item:nth-child(3) {
  animation: fade-in-up 0.8s ease-out 1.6s both;
}

.mechanics-timeline::before {
  animation: timeline-draw 2s ease-out 0.5s both;
}

.btn-primary:hover {
  animation: button-pulse 0.6s ease-in-out;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .pulse-ring,
  .node,
  .loading-progress {
    animation: none;
  }
}