/* Animation Keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(230, 190, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(230, 190, 0, 0.6);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

/* Animation Classes */
.animate-fadeInUp {
  animation: fadeInUp 0.8s ease-out;
}

.animate-fadeInDown {
  animation: fadeInDown 0.8s ease-out;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.8s ease-out;
}

.animate-fadeInRight {
  animation: fadeInRight 0.8s ease-out;
}

.animate-fadeIn {
  animation: fadeIn 1s ease-out;
}

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

.animate-slideInUp {
  animation: slideInUp 0.8s ease-out;
}

.animate-bounce {
  animation: bounce 2s infinite;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

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

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

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

/* Animation Delays */
.animate-delay-100 {
  animation-delay: 100ms;
}

.animate-delay-200 {
  animation-delay: 200ms;
}

.animate-delay-300 {
  animation-delay: 300ms;
}

.animate-delay-400 {
  animation-delay: 400ms;
}

.animate-delay-500 {
  animation-delay: 500ms;
}

.animate-delay-600 {
  animation-delay: 600ms;
}

.animate-delay-700 {
  animation-delay: 700ms;
}

.animate-delay-800 {
  animation-delay: 800ms;
}

/* Parallax Effects */
.parallax-container {
  position: relative;
  overflow: hidden;
}

.parallax-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  will-change: transform;
}

.parallax-slow {
  transform: translateY(var(--parallax-offset-slow, 0));
}

.parallax-medium {
  transform: translateY(var(--parallax-offset-medium, 0));
}

.parallax-fast {
  transform: translateY(var(--parallax-offset-fast, 0));
}

/* Hero Parallax */
.hero-parallax {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-800) 50%, var(--dark-900) 100%);
  z-index: -2;
}

.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Stagger Animations */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 100ms; }
.stagger-children > *:nth-child(2) { animation-delay: 200ms; }
.stagger-children > *:nth-child(3) { animation-delay: 300ms; }
.stagger-children > *:nth-child(4) { animation-delay: 400ms; }
.stagger-children > *:nth-child(5) { animation-delay: 500ms; }
.stagger-children > *:nth-child(6) { animation-delay: 600ms; }
.stagger-children > *:nth-child(7) { animation-delay: 700ms; }
.stagger-children > *:nth-child(8) { animation-delay: 800ms; }

/* Hover Animations */
.hover-lift {
  transition: all var(--transition);
}

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

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

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

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

.hover-glow:hover {
  box-shadow: var(--shadow-glow-lg);
}

.hover-rotate {
  transition: all var(--transition);
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* Text Animations */
.text-gradient {
  background: linear-gradient(135deg, #7C3AED, #2563EB, #0891B2, #0D9488);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

.text-glow {
  text-shadow: 
    0 0 5px rgba(245, 158, 11, 0.5),
    0 0 10px rgba(245, 158, 11, 0.4),
    0 0 15px rgba(245, 158, 11, 0.3),
    0 0 20px rgba(245, 158, 11, 0.2),
    0 0 30px rgba(245, 158, 11, 0.1);
  color: #ffffff;
}

.text-reveal {
  position: relative;
  overflow: hidden;
}

.text-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transform: translateX(-100%);
  animation: textReveal 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes textReveal {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Loading Animations */
.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDots {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Scroll Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s ease-out;
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s ease-out;
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s ease-out;
}

.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Background Animations */
.animated-bg {
  background: linear-gradient(
    -45deg,
    var(--dark),
    var(--dark-800),
    var(--dark-700),
    var(--dark-900)
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* Animated Lines Background */
.animated-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  opacity: 0.1;
}

.animated-lines::before,
.animated-lines::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  background-image: 
    linear-gradient(45deg, transparent 40%, rgba(230, 190, 0, 0.1) 50%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, rgba(0, 168, 204, 0.1) 50%, transparent 60%),
    linear-gradient(90deg, transparent 40%, rgba(103, 58, 183, 0.1) 50%, transparent 60%);
  background-size: 100px 100px, 150px 150px, 200px 200px;
  animation: linesMove 20s linear infinite;
}

.animated-lines::after {
  animation-direction: reverse;
  animation-duration: 30s;
  opacity: 0.5;
}

@keyframes linesMove {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Enhanced Lines for Hero Sections */
.hero-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  opacity: 0.15;
}

.hero-lines .line {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(230, 190, 0, 0.3), transparent);
  animation: lineFloat 15s ease-in-out infinite;
}

.hero-lines .line:nth-child(1) {
  width: 200px;
  height: 1px;
  top: 20%;
  left: -200px;
  animation-delay: 0s;
  animation-duration: 12s;
}

.hero-lines .line:nth-child(2) {
  width: 300px;
  height: 1px;
  top: 40%;
  right: -300px;
  animation-delay: 2s;
  animation-duration: 18s;
  background: linear-gradient(90deg, transparent, rgba(0, 168, 204, 0.3), transparent);
}

.hero-lines .line:nth-child(3) {
  width: 150px;
  height: 1px;
  top: 60%;
  left: -150px;
  animation-delay: 4s;
  animation-duration: 14s;
  background: linear-gradient(90deg, transparent, rgba(103, 58, 183, 0.3), transparent);
}

.hero-lines .line:nth-child(4) {
  width: 250px;
  height: 1px;
  top: 80%;
  right: -250px;
  animation-delay: 6s;
  animation-duration: 16s;
  background: linear-gradient(90deg, transparent, rgba(230, 190, 0, 0.2), transparent);
}

@keyframes lineFloat {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(calc(100vw + 300px));
    opacity: 0;
  }
}

/* Floating Shapes */
.floating-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.floating-shape {
  position: absolute;
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
  will-change: transform;
}

.floating-shape:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  animation-duration: 6s;
}

.floating-shape:nth-child(2) {
  top: 60%;
  right: 10%;
  animation-delay: 2s;
  animation-duration: 8s;
}

.floating-shape:nth-child(3) {
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
  animation-duration: 7s;
}

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .parallax-element {
    transform: none !important;
  }
}

/* Lines and Nodes Network Animation */
.network-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.network-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.network-node {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(230, 190, 0, 0.8);
  border-radius: 50%;
  animation: nodeGlow 3s ease-in-out infinite;
  opacity: 0;
}

.network-node.active {
  opacity: 1;
  animation: nodePulse 2s ease-in-out infinite, nodeFloat 4s ease-in-out infinite;
}

.network-node.large {
  width: 6px;
  height: 6px;
  background: rgba(0, 168, 204, 0.9);
}

.network-node.small {
  width: 2px;
  height: 2px;
  background: rgba(103, 58, 183, 0.7);
}

.network-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(230, 190, 0, 0.3) 20%, 
    rgba(230, 190, 0, 0.6) 50%, 
    rgba(230, 190, 0, 0.3) 80%, 
    transparent
  );
  opacity: 0;
  transform-origin: left center;
  animation: lineAppear 1s ease-out forwards;
}

.network-line.blue {
  background: linear-gradient(90deg, 
    transparent, 
    rgba(0, 168, 204, 0.3) 20%, 
    rgba(0, 168, 204, 0.6) 50%, 
    rgba(0, 168, 204, 0.3) 80%, 
    transparent
  );
}

.network-line.purple {
  background: linear-gradient(90deg, 
    transparent, 
    rgba(103, 58, 183, 0.3) 20%, 
    rgba(103, 58, 183, 0.6) 50%, 
    rgba(103, 58, 183, 0.3) 80%, 
    transparent
  );
}

.network-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(230, 190, 0, 1);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(230, 190, 0, 0.8);
  animation: particleTravel 3s linear infinite;
}

.network-particle.blue {
  background: rgba(0, 168, 204, 1);
  box-shadow: 0 0 6px rgba(0, 168, 204, 0.8);
}

.network-particle.purple {
  background: rgba(103, 58, 183, 1);
  box-shadow: 0 0 6px rgba(103, 58, 183, 0.8);
}

@keyframes nodeGlow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(230, 190, 0, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 15px rgba(230, 190, 0, 0.8);
    transform: scale(1.2);
  }
}

@keyframes nodePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

@keyframes nodeFloat {
  0%, 100% {
    transform: translateY(0px) translateX(0px);
  }
  33% {
    transform: translateY(-10px) translateX(5px);
  }
  66% {
    transform: translateY(5px) translateX(-5px);
  }
}

@keyframes lineAppear {
  0% {
    opacity: 0;
    transform: scaleX(0);
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.6;
    transform: scaleX(1);
  }
}

@keyframes particleTravel {
  0% {
    opacity: 0;
    transform: translateX(0) scale(0.5);
  }
  10% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  90% {
    opacity: 1;
    transform: translateX(var(--travel-distance, 100px)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(var(--travel-distance, 100px)) scale(0.5);
  }
}

/* Connection lines that pulse */
.network-connection {
  position: absolute;
  height: 1px;
  background: rgba(230, 190, 0, 0.2);
  animation: connectionPulse 4s ease-in-out infinite;
  opacity: 0;
}

@keyframes connectionPulse {
  0%, 100% {
    opacity: 0;
    transform: scaleY(1);
  }
  25% {
    opacity: 0.6;
    transform: scaleY(2);
  }
  50% {
    opacity: 0.8;
    transform: scaleY(1);
  }
  75% {
    opacity: 0.4;
    transform: scaleY(1.5);
  }
}

/* Enhanced geometric patterns for network */
.network-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(230, 190, 0, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 190, 0, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.3;
  animation: gridShift 20s ease-in-out infinite;
  z-index: 0;
}

@keyframes gridShift {
  0%, 100% {
    transform: translate(0, 0);
    opacity: 0.2;
  }
  50% {
    transform: translate(25px, 25px);
    opacity: 0.4;
  }
}

/* Mobile optimizations for network animation */
@media (max-width: 768px) {
  .network-node {
    width: 3px;
    height: 3px;
  }
  
  .network-node.large {
    width: 4px;
    height: 4px;
  }
  
  .network-particle {
    width: 2px;
    height: 2px;
  }
  
  .network-grid {
    background-size: 30px 30px;
  }
} 