/* ===== KEYFRAME ANIMATIONS ===== */

/* Floating Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Glow Animation */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px hsl(var(--primary)), 0 0 10px hsl(var(--primary));
  }
  50% {
    box-shadow: 0 0 10px hsl(var(--primary)), 0 0 20px hsl(var(--primary)), 0 0 30px hsl(var(--primary));
  }
}

/* Slide Up Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide In Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Scale In Animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -15px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -7px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

/* Typing Cursor */
@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Rotate Animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Shake Animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Ripple Effect */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* ===== ANIMATION CLASSES ===== */

/* Floating Elements */
.animate-float {
  animation: float 3s ease-in-out infinite;
}

.float-item {
  position: absolute;
  width: 8px;
  height: 8px;
  background: hsl(var(--primary));
  border-radius: 50%;
  animation: float 4s ease-in-out infinite;
}

.float-item:nth-child(2) {
  animation-delay: 1s;
  background: hsl(var(--secondary));
}

.float-item:nth-child(3) {
  animation-delay: 2s;
  background: hsl(var(--accent));
}

.float-item:nth-child(4) {
  animation-delay: 0.5s;
  background: hsl(var(--primary));
}

/* Pulse Effects */
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  background: hsl(var(--danger));
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.pulse-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid hsl(var(--danger));
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* Glow Effects */
.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

.hover-glow:hover {
  animation: glow 1s ease-in-out;
}

/* Slide Animations */
.animate-slide-up {
  animation: slideUp 0.6s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out;
}

.animate-bounce {
  animation: bounce 1s ease-out;
}

/* Hover Effects */
.hover-scale {
  transition: transform var(--transition-fast);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-lift {
  transition: transform var(--transition-fast);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-cyber {
  position: relative;
  transition: all var(--transition-fast);
}

.hover-cyber:hover {
  color: hsl(var(--primary));
  text-shadow: 0 0 5px hsl(var(--primary));
}

.hover-cyber::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, hsl(var(--primary) / 0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
}

.hover-cyber:hover::before {
  transform: translateX(100%);
}

/* Loading Animations */
.animate-spin {
  animation: rotate 1s linear infinite;
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ===== ENTRANCE ANIMATIONS ===== */
.entrance-animation {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.entrance-animation.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== MICRO INTERACTIONS ===== */
.button-ripple {
  position: relative;
  overflow: hidden;
}

.button-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.button-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* ===== TYPING ANIMATION ===== */
.typing-cursor::after {
  content: '|';
  animation: blink 1s infinite;
  color: hsl(var(--primary));
}

/* ===== PARALLAX SCROLLING ===== */
.parallax-element {
  transition: transform 0.1s ease-out;
}

/* ===== PREFERS 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;
  }
  
  .animate-float,
  .animate-pulse,
  .animate-glow,
  .animate-spin {
    animation: none;
  }
}

/* ===== INTERSECTION OBSERVER ANIMATIONS ===== */
.observe-animation {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.observe-animation.in-view {
  opacity: 1;
  transform: translateY(0);
}