/* Flip Animation Styles */
.flip-animation {
  display: inline-block;
  perspective: 1000px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.flip-animation span {
  display: inline-block;
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  color: var(--primary-color); /* Use primary color */
  font-weight: bold;
  text-align: center;
  word-wrap: break-word;
  word-break: break-word; /* Add word breaking to prevent overflow */
  overflow-wrap: break-word; /* Modern property for word breaking */
  transform-style: preserve-3d;
  max-width: 100%; /* Ensure text doesn't exceed container */
}

.flip-animation.flip span {
  transform: rotateX(90deg);
  opacity: 0;
}

.flip-animation.new span {
  transform: rotateX(-90deg);
  opacity: 0;
}

.flip-animation.show span {
  transform: rotateX(0deg);
  opacity: 1;
}

/* Responsive adjustments for flip text */
@media (max-width: 768px) {
  .flip-animation {
    height: auto;
    min-height: 40px;
  }
  
  .hero-subtitle {
    font-size: 1.4rem;
    min-height: 60px;
  }
  
  .flip-animation span {
    font-size: 1.2rem; /* Reduced from 1.4rem */
    word-break: break-word; /* Ensure word breaking on mobile */
    max-width: 100%; /* Prevent overflow */
    padding: 0 10px; /* Add some padding for better appearance */
  }
}

@media (max-width: 576px) {
  .hero-subtitle {
    font-size: 1.2rem;
    min-height: 50px;
  }
  
  .flip-animation span {
    font-size: 1.0rem; /* Reduced from 1.2rem */
    word-break: break-word; /* Ensure word breaking on small screens */
    padding: 0 5px; /* Adjust padding for smaller screens */
  }
}

/* Enhanced Scroll Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animate {
  opacity: 1;
  transform: translateY(0);
}

.animate-slide-in-left {
  opacity: 0;
  transform: translateX(-80px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slide-in-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.animate-slide-in-right {
  opacity: 0;
  transform: translateX(80px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slide-in-right.animate {
  opacity: 1;
  transform: translateX(0);
}

.animate-slide-in-up {
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-slide-in-up.animate {
  opacity: 1;
  transform: translateY(0);
}

.animate-zoom-in {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-zoom-in.animate {
  opacity: 1;
  transform: scale(1);
}

/* Enhanced animation delays for staggered effects */
.animation-delay-1 {
  transition-delay: 0.1s;
}

.animation-delay-2 {
  transition-delay: 0.2s;
}

.animation-delay-3 {
  transition-delay: 0.3s;
}

.animation-delay-4 {
  transition-delay: 0.4s;
}

.animation-delay-5 {
  transition-delay: 0.5s;
}

/* Additional animation classes */
.animate-fade-in {
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-fade-in.animate {
  opacity: 1;
}

.animate-scale-up {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-scale-up.animate {
  opacity: 1;
  transform: scale(1);
}