/* Keyframe Animations - ENHANCED */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes flip {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}

/* NEW ENHANCED ANIMATIONS */

/* Bounce Animation for CTAs */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    transform: translate3d(0,-8px,0);
  }
  70% {
    transform: translate3d(0,-4px,0);
  }
}

/* Typewriter Effect */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCursor {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary);
  }
}

/* Staggered Fade In */
@keyframes staggeredFade {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glow Effect */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(200, 90, 58, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(200, 90, 58, 0.6), 0 0 30px rgba(200, 90, 58, 0.4);
  }
}

/* Morphing Background */
@keyframes morph {
  0% {
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40%/50% 60% 30% 60%;
  }
  100% {
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
  }
}

/* Slide Up with Spring */
@keyframes slideUpSpring {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  80% {
    transform: translateY(-5px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Rotate 3D */
@keyframes rotate3D {
  0% {
    opacity: 0;
    transform: rotate3d(1, 1, 0, 45deg);
  }
  100% {
    opacity: 1;
    transform: rotate3d(0, 0, 0, 0deg);
  }
}

/* Wave Animation */
@keyframes wave {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-10px);
  }
  100% {
    transform: translateX(0);
  }
}

/* Gradient Shift */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* NEW Animation Classes */
.bounce {
  animation: bounce 1s ease infinite;
}

.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--primary);
  white-space: nowrap;
  animation: typewriter 3s steps(40, end), blinkCursor 0.8s step-end infinite;
}

.staggered-fade > * {
  opacity: 0;
  animation: staggeredFade 0.6s ease-out forwards;
}

.staggered-fade > *:nth-child(1) { animation-delay: 0.1s; }
.staggered-fade > *:nth-child(2) { animation-delay: 0.2s; }
.staggered-fade > *:nth-child(3) { animation-delay: 0.3s; }
.staggered-fade > *:nth-child(4) { animation-delay: 0.4s; }
.staggered-fade > *:nth-child(5) { animation-delay: 0.5s; }
.staggered-fade > *:nth-child(6) { animation-delay: 0.6s; }

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

.morph {
  animation: morph 8s ease-in-out infinite;
}

.slide-up-spring {
  animation: slideUpSpring 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rotate-3d {
  animation: rotate3D 1s ease-out;
}

.wave {
  display: inline-block;
  animation: wave 2s ease-in-out infinite;
}

.gradient-shift {
  background: linear-gradient(-45deg, var(--primary), var(--secondary), var(--accent), var(--success));
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

/* Enhanced Hover Effects */
.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(200, 90, 58, 0.4);
  transform: translateY(-2px);
}

.hover-shake:hover {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.hover-pulse:hover {
  animation: pulse 1s ease infinite;
}

/* Navigation Specific Animations */
.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transition: left 0.3s ease;
}

.nav-link:hover::before {
  left: 0;
}

/* Button Enhancements */
.cta-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.cta-button::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.5s ease;
}

.cta-button:hover::before {
  left: 100%;
}

/* Card Entrance Animations */
.card-entrance {
  opacity: 0;
  transform: perspective(1000px) rotateX(10deg) translateY(50px);
  animation: cardEntrance 0.8s ease-out forwards;
}

@keyframes cardEntrance {
  to {
    opacity: 1;
    transform: perspective(1000px) rotateX(0) translateY(0);
  }
}

/* Loading Bar Animation */
@keyframes loadingBar {
  0% {
    transform: scaleX(0);
  }
  50% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
    transform-origin: right;
  }
}

.loading-bar {
  animation: loadingBar 2s ease-in-out infinite;
}

/* Counter Animation */
@keyframes countUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.counter {
  display: inline-block;
  animation: countUp 0.5s ease-out forwards;
}

/* Staggered Grid Animation */
.staggered-grid > * {
  opacity: 0;
  transform: translateY(30px);
  animation: staggeredFade 0.6s ease-out forwards;
}

.staggered-grid > *:nth-child(1) { animation-delay: 0.1s; }
.staggered-grid > *:nth-child(2) { animation-delay: 0.2s; }
.staggered-grid > *:nth-child(3) { animation-delay: 0.3s; }
.staggered-grid > *:nth-child(4) { animation-delay: 0.4s; }
.staggered-grid > *:nth-child(5) { animation-delay: 0.5s; }
.staggered-grid > *:nth-child(6) { animation-delay: 0.6s; }

/* Enhanced Scroll Animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.scroll-animate.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.scroll-animate.delay-1 { transition-delay: 0.1s; }
.scroll-animate.delay-2 { transition-delay: 0.2s; }
.scroll-animate.delay-3 { transition-delay: 0.3s; }
.scroll-animate.delay-4 { transition-delay: 0.4s; }

/* Smooth State Transitions */
.page-transition {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease-out 0.2s forwards;
}

/* Focus Animations */
.focus-scale:focus {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(200, 90, 58, 0.3);
}

/* Success Animation */
@keyframes successCheck {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-check {
  animation: successCheck 0.6s ease-out;
}

/* Enhanced Ripple Effect */
.ripple-enhanced {
  position: relative;
  overflow: hidden;
}

.ripple-enhanced::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple-enhanced:active::after {
  width: 300px;
  height: 300px;
}

/* Floating Animation */
@keyframes floating {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* Quick Usage Examples for your elements */

/* Hero Section */
.hero-text h1 {
  animation: slideInLeft 0.8s ease-out 0.2s both;
}

.hero-subtitle {
  animation: slideInLeft 0.8s ease-out 0.4s both;
}

.hero-ctas {
  animation: slideInLeft 0.8s ease-out 0.6s both;
}

.hero-image {
  animation: slideInRight 0.8s ease-out 0.4s both;
}

/* Feature Cards */
.feature-card {
  animation: floatUp 0.6s ease-out both;
}

/* Navigation Menu Items */
.nav-menu li {
  animation: fadeIn 0.5s ease-out both;
}

.nav-menu li:nth-child(1) { animation-delay: 0.1s; }
.nav-menu li:nth-child(2) { animation-delay: 0.2s; }
.nav-menu li:nth-child(3) { animation-delay: 0.3s; }
.nav-menu li:nth-child(4) { animation-delay: 0.4s; }
.nav-menu li:nth-child(5) { animation-delay: 0.5s; }
.nav-menu li:nth-child(6) { animation-delay: 0.6s; }
.nav-menu li:nth-child(7) { animation-delay: 0.7s; }
.nav-menu li:nth-child(8) { animation-delay: 0.8s; }