/* ========================================
   MODERN ANIMATIONS & EFFECTS
   Inspired by: Aceternity UI, HeroUI, Shadcn UI
   ======================================== */

/* Global Keyframe Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.6), 0 0 40px rgba(124, 58, 237, 0.3);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes rotate-border {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes bounce-subtle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-on-scroll.delay-1 {
  animation-delay: 0.15s;
}

.animate-on-scroll.delay-2 {
  animation-delay: 0.3s;
}

.animate-on-scroll.delay-3 {
  animation-delay: 0.45s;
}

.animate-on-scroll.delay-4 {
  animation-delay: 0.6s;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Page load animation */
body {
  animation: fadeIn 0.5s ease-in;
}

/* Gradient text animation */
.gradient-text-animated {
  background: linear-gradient(90deg, #7c3aed, #2563eb, #06b6d4, #7c3aed);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 8s ease infinite;
}

/* Floating animation for icons */
.float-animation {
  animation: float 3s ease-in-out infinite;
}

/* Shimmer effect (loading state) */
.shimmer-effect {
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Pulse glow effect */
.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Hover scale effect */
.hover-scale {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Magnetic hover effect */
.magnetic-hover {
  transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Ripple effect container */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Parallax effect */
.parallax {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* Tilt effect on hover (3D) */
.tilt-on-hover {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.tilt-on-hover:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(2deg);
}

/* Border animation on hover */
.animated-border {
  position: relative;
  isolation: isolate;
}

.animated-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(45deg, #7c3aed, #2563eb, #06b6d4, #7c3aed);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: gradient-shift 3s ease infinite;
}

.animated-border:hover::before {
  opacity: 1;
}

/* Glow on hover */
.glow-on-hover {
  position: relative;
  transition: all 0.3s ease;
}

.glow-on-hover:hover {
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.4), 0 0 40px rgba(124, 58, 237, 0.2);
}

/* Slide in from sides */
.slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

/* Scale in animation */
.scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-children > *:nth-child(1) {
  animation-delay: 0.1s;
}

.stagger-children > *:nth-child(2) {
  animation-delay: 0.2s;
}

.stagger-children > *:nth-child(3) {
  animation-delay: 0.3s;
}

.stagger-children > *:nth-child(4) {
  animation-delay: 0.4s;
}

.stagger-children > *:nth-child(5) {
  animation-delay: 0.5s;
}

.stagger-children > *:nth-child(6) {
  animation-delay: 0.6s;
}

/* Smooth hover transitions */
.smooth-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bounce on hover */
.bounce-hover:hover {
  animation: bounce-subtle 0.5s ease;
}

/* Underline animation */
.underline-animate {
  position: relative;
  text-decoration: none;
}

.underline-animate::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed, #2563eb);
  transition: width 0.3s ease;
}

.underline-animate:hover::after {
  width: 100%;
}

/* Background particles animation */
@keyframes particle-float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-20px) translateX(10px);
  }
  50% {
    transform: translateY(-10px) translateX(-10px);
  }
  75% {
    transform: translateY(-30px) translateX(5px);
  }
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.6), transparent);
  border-radius: 50%;
  animation: particle-float 10s ease-in-out infinite;
  opacity: 0.5;
}

/* Skeleton loading animation */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0px, #e0e0e0 40px, #f0f0f0 80px);
  background-size: 200px 100%;
  animation: skeleton-loading 1.4s ease-in-out infinite;
}

/* Typing animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

.typing-effect {
  overflow: hidden;
  border-right: 2px solid #7c3aed;
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* Ripple effect styling */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Enhanced card hover states */
.modern-card,
.stat-card,
.hover-lift-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button animations */
.modern-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.modern-btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Icon float animation - DISABLED */
/* .stat-card-icon {
  animation: float 3s ease-in-out infinite;
} */

/* Navbar blur enhancement */
nav {
  transition: all 0.3s ease;
}

/* Page transitions */
.page-transition {
  animation: fadeIn 0.5s ease-in;
}

/* Glow pulse for important elements */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(124, 58, 237, 0.2), 0 0 10px rgba(124, 58, 237, 0.1);
  }
  50% {
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4), 0 0 30px rgba(124, 58, 237, 0.2);
  }
}

.glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}
