/* Testimonial Animations - Modern Carousel */
.testimonials-section {
  position: relative;
  overflow: hidden;
}

.testimonials-carousel {
  display: flex;
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

.testimonial-card {
  flex: 0 0 100%;
  min-width: 100%;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, opacity;
}

/* Viewport-triggered animation */
.testimonial-card.animate-in {
  animation: testimonialEntrance 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  animation-delay: calc(var(--card-index, 0) * 0.15s);
}

.testimonial-card.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes testimonialEntrance {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Enhanced Card Styles */
.testimonial-card {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 20px !important;
  padding: 2rem !important;
  position: relative;
  overflow: hidden;
}

.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    #00d4ff 0%, 
    #667eea 50%, 
    #764ba2 100%);
  transform: scaleX(0);
  transition: transform 0.6s ease;
}

.testimonial-card:hover::before {
  transform: scaleX(1);
}

/* Enhanced Avatar Animation */
.avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  animation: avatarPulse 2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.avatar::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent);
  transform: rotate(45deg);
  animation: avatarShine 2s ease-in-out infinite;
}

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

@keyframes avatarShine {
  0% { transform: rotate(45deg) translateX(-100%); }
  100% { transform: rotate(45deg) translateX(100%); }
}

/* Star Rating Animation */
.rating i {
  color: #ffd166 !important;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
  animation: starTwinkle 1.5s ease-in-out infinite;
  animation-delay: calc(var(--star-index, 0) * 0.2s);
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes starTwinkle {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.9;
    transform: scale(1.05);
  }
}

/* Enhanced Typography */
.testimonial-card h4 {
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  margin-bottom: 0.25rem !important;
}

.testimonial-card .meta span {
  color: #a0aec0 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
}

.testimonial-card p {
  color: #e2e8f0 !important;
  line-height: 1.7 !important;
  font-size: 0.95rem !important;
  font-style: italic;
  position: relative;
  padding-left: 1.5rem;
}

.testimonial-card p::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -0.5rem;
  font-size: 2rem;
  color: #00d4ff;
  font-family: Georgia, serif;
  opacity: 0.7;
}

/* Carousel Controls */
.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.carousel-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-btn.active {
  background: #00d4ff;
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.carousel-btn:hover {
  background: #667eea;
  transform: scale(1.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .testimonial-card {
    padding: 1.5rem !important;
    margin: 0 0.5rem;
  }
  
  .testimonials-carousel {
    padding: 0 1rem;
  }
  
  .carousel-controls {
    margin-top: 1.5rem;
  }
}

/* Auto-scroll Animation */
@keyframes autoScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.testimonials-carousel.auto-scroll {
  animation: autoScroll 30s linear infinite;
}

/* Pause on hover */
.testimonials-carousel.auto-scroll:hover {
  animation-play-state: paused;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .testimonial-card,
  .avatar,
  .rating i,
  .carousel-btn {
    animation: none !important;
    transition: none !important;
  }
  
  .testimonials-carousel.auto-scroll {
    animation: none !important;
  }
}