/* Enhanced Animations for Ramtraders Website */

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

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

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

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

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

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

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

@keyframes wobble {
  0% {
    transform: translateX(0%);
  }
  15% {
    transform: translateX(-25%) rotate(-5deg);
  }
  30% {
    transform: translateX(20%) rotate(3deg);
  }
  45% {
    transform: translateX(-15%) rotate(-3deg);
  }
  60% {
    transform: translateX(10%) rotate(2deg);
  }
  75% {
    transform: translateX(-5%) rotate(-1deg);
  }
  100% {
    transform: translateX(0%);
  }
}

@keyframes swing {
  20% {
    transform: rotate(15deg);
  }
  40% {
    transform: rotate(-10deg);
  }
  60% {
    transform: rotate(5deg);
  }
  80% {
    transform: rotate(-5deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes tada {
  0% {
    transform: scale(1);
  }
  10%, 20% {
    transform: scale(0.9) rotate(-3deg);
  }
  30%, 50%, 70%, 90% {
    transform: scale(1.1) rotate(3deg);
  }
  40%, 60%, 80% {
    transform: scale(1.1) rotate(-3deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* Face Up Entrance Animation */
@keyframes faceUpEntrance {
  0% {
    opacity: 0;
    transform: perspective(500px) rotateX(90deg) translateY(50px);
  }
  100% {
    opacity: 1;
    transform: perspective(500px) rotateX(0) translateY(0);
  }
}

/* Testimonial Carousel Entrance Animation */
@keyframes testimonialSlideIn {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes testimonialFadeIn {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes testimonialStaggeredReveal {
  0% {
    opacity: 0;
    transform: translateY(30px) rotateX(10deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

/* Viewport Entrance Animations for Market Cards */
@keyframes slideInUpCard {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScaleCard {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeftCard {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRightCard {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Entrance Animations */
.hero-title {
  /* Enhanced animation for hero title */
  animation: textPopIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

.hero-subtitle {
  /* Enhanced animation for hero subtitle */
  animation: textSlideIn 1s ease-out 0.3s both;
}

.hero-stats {
  /* Enhanced animation for hero stats */
  animation: cardsSlideIn 1s ease-out 0.6s both;
}

.cta-button {
  /* Enhanced animation for CTA button */
  animation: buttonPopIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.9s both;
}

/* New keyframes for modern hero section animations */
@keyframes textPopIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
  }
  70% {
    opacity: 1;
    transform: scale(1.05) translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes textSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes cardsSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes buttonPopIn {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(20px);
  }
  70% {
    opacity: 1;
    transform: scale(1.05) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Added hover effects for CTA buttons */
.cta-button:hover {
  animation: none;
}

.cta-button:hover i {
  animation: iconRotate 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

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

/* Benefit cards will be animated when they enter the viewport */
.benefit-card {
  opacity: 0;
  transform: perspective(500px) rotateX(90deg) translateY(50px);
}

.testimonial {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
}

/* Testimonial entrance animation classes */
.testimonial.animate-slide-in {
  animation: testimonialSlideIn 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.testimonial.animate-fade-in {
  animation: testimonialFadeIn 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.testimonial.animate-staggered {
  animation: testimonialStaggeredReveal 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.proof-card {
  animation: faceUpEntrance 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.step {
  animation: faceUpEntrance 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.coach-bio {
  /* Enhanced animation for coach bio section */
  animation: fadeInScale 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

/* New keyframes for modern coach section animation */
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Enhanced animation for coach avatar */
.coach-avatar {
  animation: floatIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

@keyframes floatIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.7);
  }
  70% {
    opacity: 1;
    transform: translateY(-10px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Added staggered animations for bio text elements */
.bio-text h2 {
  opacity: 0;
  animation: slideInRight 0.8s ease-out 0.3s both;
}

.bio-text h3 {
  opacity: 0;
  animation: slideInRight 0.8s ease-out 0.5s both;
}

.credentials {
  opacity: 0;
  animation: slideInRight 0.8s ease-out 0.7s both;
}

.bio-text p {
  opacity: 0;
  animation: slideInRight 0.8s ease-out 0.9s both;
}

.achievements {
  opacity: 0;
  animation: slideInRight 0.8s ease-out 1.1s both;
}

/* Enhanced animation for Why Focus on Indian Markets section */
#market-focus {
  opacity: 0;
  animation: sectionFadeIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s both;
}

#market-focus .section-title {
  opacity: 0;
  animation: titlePopIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.4s both;
}

/* Viewport Entrance Animation Classes for Market Cards */
.market-card.animate-slide-up {
  animation: slideInUpCard 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.market-card.animate-fade-scale {
  animation: fadeInScaleCard 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.market-card.animate-slide-left {
  animation: slideInLeftCard 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.market-card.animate-slide-right {
  animation: slideInRightCard 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.market-card.animate-face-up {
  animation: faceUpEntrance 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Staggered delays for market cards */
.market-card.animate-stagger:nth-child(1) {
  animation-delay: 0.1s;
}

.market-card.animate-stagger:nth-child(2) {
  animation-delay: 0.3s;
}

.market-card.animate-stagger:nth-child(3) {
  animation-delay: 0.5s;
}

/* Initially hide market cards for entrance animations */
.market-card:not(.animate-slide-up):not(.animate-fade-scale):not(.animate-slide-left):not(.animate-slide-right):not(.animate-face-up) {
  opacity: 0;
}

@keyframes sectionFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes titlePopIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  70% {
    opacity: 1;
    transform: scale(1.05) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes cardFlipIn {
  0% {
    opacity: 0;
    transform: perspective(600px) rotateY(90deg) translateX(30px);
  }
  50% {
    opacity: 1;
    transform: perspective(600px) rotateY(-10deg);
  }
  100% {
    opacity: 1;
    transform: perspective(600px) rotateY(0) translateX(0);
  }
}

/* Responsive Animations */
@media (max-width: 768px) {
  /* Remove the conflicting styles that prevent animations on mobile */
  .benefit-card,
  .testimonial,
  .proof-card,
  .step {
    /* Remove the initial hidden state that conflicts with JavaScript animations */
  }
  
  .testimonial:nth-child(n) {
    animation-delay: 0s;
  }
  
  .proof-card:nth-child(n) {
    animation-delay: 0s;
  }
  
  .step:nth-child(n) {
    animation-delay: 0s;
  }
  
  /* Mobile animations for market focus section */
  #market-focus .market-card {
    animation: faceUpEntrance 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  }
  
  #market-focus .market-card:nth-child(1) {
    animation-delay: 0.2s;
  }
  
  #market-focus .market-card:nth-child(2) {
    animation-delay: 0.4s;
  }
  
  #market-focus .market-card:nth-child(3) {
    animation-delay: 0.6s;
  }
  
  /* Mobile animations for testimonials */
  .testimonial.animate-slide-in,
  .testimonial.animate-fade-in,
  .testimonial.animate-staggered {
    animation-duration: 0.6s;
    animation-delay: 0s !important;
  }
}

/* Utility Classes */
.animate-once {
  animation-fill-mode: both;
}

.animate-infinite {
  animation-iteration-count: infinite;
}

.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;
}

.animate-fast {
  animation-duration: 0.5s;
}

.animate-slow {
  animation-duration: 2s;
}