/* Testimonials Section Styles
   Dark theme testimonials with progressive disclosure
   ======================================= */

/* Testimonials Section */
.testimonials-section {
  padding: 100px 0;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}

.testimonials-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
  opacity: 0.03;
  pointer-events: none;
}

.testimonials-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Testimonials Header */
.testimonials-header {
  text-align: center;
  margin-bottom: 60px;
}

.testimonials-header .section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  margin-bottom: 24px;
  color: var(--primary-color);
  font-size: 0.875rem;
  font-weight: 500;
}

.testimonials-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.testimonials-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Trust Indicators */
.trust-indicators {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.trust-badge:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.1);
}

.trust-badge svg {
  color: var(--primary-color);
}

/* Testimonials Carousel - For Featured Testimonials */
.testimonials-carousel {
  width: 100%;
  margin-bottom: 40px;
  padding: 20px 0; /* Only vertical padding, no horizontal */
  box-sizing: border-box;
}

/* Carousel wrapper */
.testimonials-wrapper {
  position: relative;
  width: 100%;
  min-height: 350px;
  overflow: visible; /* Changed from hidden to show full width */
}

/* Carousel testimonial slides */
.testimonials-carousel .testimonial-slide {
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  min-height: 350px;
  width: 100%;
  box-sizing: border-box; /* Ensure padding is included in width */
  opacity: 0;
  transition: opacity 0.5s ease;
  position: relative;
  overflow: hidden;
}

/* Active slide */
.testimonials-carousel .testimonial-slide.active {
  display: block;
  opacity: 1;
  animation: fadeInUp 0.6s ease-out;
}

/* Slide top gradient border */
.testimonial-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--success-color));
  opacity: 0.8;
}

/* Slide content styling */
.slide-content {
  text-align: center;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* Slide badges */
.slide-badge {
  position: absolute;
  top: -20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.slide-badge-featured {
  right: 20px;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.slide-badge-verified {
  right: 120px;
  color: var(--success-color);
  border-color: var(--success-color);
}

.slide-badge-verified svg {
  width: 14px;
  height: 14px;
}

/* Quote icon */
.slide-quote-icon {
  margin-bottom: 20px;
}

.slide-quote-icon svg {
  color: var(--primary-color);
  opacity: 0.15;
}

/* Carousel quote - updated to match new slide-quote class */
.carousel-quote,
.slide-quote {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0 0 32px 0;
  position: relative;
  font-style: italic;
}

.carousel-quote .highlight,
.slide-quote .highlight {
  color: var(--primary-color);
  font-weight: 600;
  font-style: normal;
}

/* Slide highlights section */
.slide-highlights {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.slide-highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.slide-highlight-badge:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.slide-highlight-badge svg {
  width: 14px;
  height: 14px;
  color: var(--success-color);
}

/* Slide metrics */
.slide-metrics {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 24px 0;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.slide-metric {
  text-align: center;
}

.slide-metric-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.slide-metric-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* Slide project info */
.slide-project {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.slide-project-type,
.slide-project-duration,
.slide-project-year {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.slide-project-type {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Slide footer */
.slide-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

/* Slide avatar */
.slide-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

/* Slide client info */
.slide-client-info {
  text-align: left;
  flex: 1;
}

.slide-client-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  text-align: left;
}

.slide-client-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: left;
}

/* Slide actions/CTA */
.slide-actions {
  margin-top: 24px;
  text-align: center;
}

.slide-case-study-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.slide-case-study-btn:hover {
  background: transparent;
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.2);
}

.slide-case-study-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.slide-case-study-btn:hover svg {
  transform: translateX(4px);
}

/* Slide date */
.slide-date {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Slide rating */
.slide-rating {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.slide-rating svg,
.star-full,
.star-half,
.star-empty {
  width: 20px;
  height: 20px;
}

.star-full {
  color: #ffd700;
}

.star-half {
  color: #ffd700;
  position: relative;
}

.star-empty {
  color: var(--border-color);
  opacity: 0.5;
}

/* Slide verified badge */
.slide-verified {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--success-color);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--success-color);
}

.slide-verified svg {
  width: 14px;
  height: 14px;
  color: var(--success-color);
}

/* Carousel navigation buttons */
.testimonials-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
  z-index: 10;
}

.testimonials-navigation button {
  pointer-events: all;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.testimonials-navigation button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.testimonials-navigation button svg path {
  fill: currentColor;
}

.testimonials-navigation button:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-white);
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.testimonials-navigation button:hover svg,
.testimonials-navigation button:hover svg path {
  fill: var(--text-white);
}

/* Carousel-specific testimonial card styles (legacy support) */
.testimonials-carousel .testimonial-card,
.testimonial-track .testimonial-card {
  display: none;
  min-height: 300px;
  border-radius: 12px;
  position: relative;
  margin: 0 auto;
  max-width: 100%;
  transition: opacity .3s ease, transform .3s ease;
  will-change: opacity, transform;
}

.testimonials-carousel .testimonial-card.active,
.testimonial-track .testimonial-card.active {
  display: block;
  animation: fadeInUp 0.6s ease-out;
}

/* Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dots Navigation - Under carousel, above grid */
.testimonial-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  margin-bottom: 40px;
}

.testimonial-dots .nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-color);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  margin: 0;
}

.testimonial-dots .nav-dot.active {
  background-color: var(--primary-color);
  transform: scale(1.25);
  width: 10px;
  height: 10px;
}

.testimonial-dots .nav-dot:hover {
  background-color: var(--primary-dark);
  transform: scale(1.15);
}

/* Testimonials Grid - For Regular Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 32px;
  margin-bottom: 60px;
  margin-top: 40px;
  position: relative;
  align-items: stretch; /* Ensure all grid items stretch to same height */
}

/* Visual separator between carousel and grid - only show when grid has content */
.testimonials-grid:not(:empty)::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* Hide grid completely when display is none */
.testimonials-grid[style*="display: none"] {
  display: none !important;
}

.testimonials-grid[style*="display: none"]::before {
  display: none !important;
}

/* Ensure grid testimonial cards are visible */
.testimonials-grid .testimonial-card {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Grid section header */
.testimonials-grid-header {
  text-align: center;
  margin-bottom: 30px;
}

.testimonials-grid-header h3 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.testimonials-grid-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Testimonial Card */
.testimonial-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0; /* No padding on card itself */
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensure cards stretch to fill grid cell */
  min-height: 400px; /* Minimum height to ensure footer positioning */
}

.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--success-color));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-color: var(--primary-color);
}

.testimonial-card:hover::before {
  opacity: 1;
}

/* Featured Testimonial */
.testimonial-card.featured {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-width: 2px;
}

/* In testimonials grid, don't let featured cards span full width */
.testimonials-grid .testimonial-card.featured {
  grid-column: auto; /* Override any span setting */
}

/* Testimonial Header */
.testimonial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* Rating Stars */
.rating-stars {
  display: flex;
  gap: 4px;
}

.rating-stars svg {
  color: #ffd700;
  opacity: 0.9;
}

/* Badges */
.project-type,
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.verified-badge {
  color: var(--success-color);
  border-color: var(--success-color);
}

.verified-badge svg {
  color: var(--success-color);
}

/* Testimonial Quote */
.testimonial-quote {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
  position: relative;
  padding-left: 24px;
}

.testimonial-quote::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -10px;
  font-size: 3rem;
  color: var(--primary-color);
  opacity: 0.3;
}

.testimonial-quote .highlight {
  color: var(--primary-color);
  font-weight: 600;
}

/* Testimonial Impact (Featured) */
.testimonial-impact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  margin: 32px 0;
  padding: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.impact-item {
  text-align: center;
}

.impact-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.impact-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Testimonial Metrics */
.testimonial-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  margin-top: auto; /* Push metrics to bottom of content wrapper */
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.metric-badge:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.metric-badge svg {
  opacity: 0.7;
}

/* Content wrapper to push footer down */
.testimonial-content-wrapper {
  flex: 1 1 auto; /* Grow to fill available space */
  display: flex;
  flex-direction: column;
  padding: 32px 32px 24px 32px; /* Padding for content area */
  min-height: 0; /* Allow shrinking if needed */
}

/* Testimonial Footer */
.testimonial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px 32px 32px; /* Full padding including sides and bottom */
  margin-top: auto; /* Push footer to bottom of card */
  border-top: 1px solid var(--border-color);
  position: relative;
  flex-shrink: 0; /* Prevent footer from shrinking */
}

.client-info {
  display: flex;
  align-items: center;
  gap: 16px; /* Increased gap for better spacing */
  flex: 1; /* Allow to grow */
  min-width: 0; /* Prevent overflow */
}

.client-avatar {
  width: 48px; /* Larger avatar for better visibility */
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: transform 0.3s ease, border-color 0.3s ease;
  flex-shrink: 0; /* Prevent avatar from shrinking */
}

.testimonial-card:hover .client-avatar {
  transform: scale(1.05);
  border-color: var(--primary-color);
}

.client-details {
  display: flex;
  flex-direction: column;
  gap: 2px; /* Consistent spacing between text elements */
  min-width: 0; /* Allow text truncation if needed */
  text-align: left; /* Ensure left alignment */
}

.client-name {
  font-size: 1rem; /* Slightly larger for hierarchy */
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
  text-align: left; /* Explicit left alignment */
}

.client-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.3;
  text-align: left; /* Explicit left alignment */
}

.client-company {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
  opacity: 0.9;
  text-align: left; /* Explicit left alignment */
}

.client-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

/* View Case Study Link */
.view-case-study {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px; /* Add padding for better click target */
  background: transparent;
  border: 1px solid var(--primary-color);
  border-radius: 20px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.3s ease;
  margin-left: 16px; /* Space from client info */
}

.view-case-study:hover {
  background: var(--primary-color);
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.view-case-study svg {
  transition: transform 0.3s ease;
}

.view-case-study:hover svg {
  transform: translateX(2px);
}

/* Testimonials CTA */
.testimonials-cta-section {
  margin-top: 80px;
  padding: 60px 40px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  text-align: center;
}

.testimonials-cta-section .cta-title {
  font-size: 2rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.testimonials-cta-section .cta-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.testimonials-cta-section .cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Accessibility */
.testimonial-card:focus-within {
  outline: var(--ring-width, 3px) solid var(--ring, #388bfd);
  outline-offset: 2px;
}

.nav-btn:focus-visible,
.nav-prev:focus-visible,
.nav-next:focus-visible,
.nav-dot:focus-visible {
  outline: var(--ring-width, 3px) solid var(--ring, #388bfd);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 992px) {
  /* For tablets, adjust grid to handle 450px min-width better */
  .testimonials-grid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  }
}

@media (max-width: 768px) {
  .testimonials-section {
    padding: 60px 0;
  }

  .testimonials-carousel {
    margin-bottom: 30px;
  }
  
  .testimonial-dots {
    margin-bottom: 30px;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 30px;
  }
  
  .testimonials-grid::before {
    top: -15px;
  }

  .testimonials-title {
    font-size: 2rem;
  }

  .testimonial-impact {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .trust-indicators {
    flex-direction: column;
    align-items: center;
  }

  .testimonial-footer {
    flex-direction: column;
    align-items: stretch; /* Full width items */
    gap: 16px;
    padding: 20px 32px 32px 32px; /* Maintain horizontal and bottom padding */
  }
  
  .client-info {
    gap: 12px;
  }
  
  .client-avatar {
    width: 44px;
    height: 44px;
  }
  
  .view-case-study {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  .testimonials-cta-section {
    padding: 40px 20px;
  }
}

/* Progressive Disclosure Animations
   ======================================= */

/* Initial state for scroll-reveal testimonials */
.testimonial-card.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.2, 0, 0, 1), 
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Alternating reveal directions */
.testimonial-card.scroll-reveal.from-left {
  transform: translateX(-30px) translateY(20px);
}

.testimonial-card.scroll-reveal.from-right {
  transform: translateX(30px) translateY(20px);
}

/* Featured card special reveal */
.testimonial-card.featured-reveal {
  transition: opacity 0.8s cubic-bezier(0.2, 0, 0, 1), 
              transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Revealed state */
.testimonial-card.revealed {
  opacity: 1 !important;
  transform: translateX(0) translateY(0) !important;
}

/* Star animations */
.rating-stars svg.star-reveal {
  animation: starSparkle 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes starSparkle {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    filter: brightness(2);
  }
  50% {
    transform: scale(1.2) rotate(10deg);
    filter: brightness(2);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
}

/* Quote highlight animations */
.testimonial-quote .highlight {
  position: relative;
  display: inline-block;
  background-size: 0% 100%;
  background-image: linear-gradient(120deg, rgba(88, 166, 255, 0.2) 0%, rgba(88, 166, 255, 0.2) 100%);
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.4s ease, color 0.4s ease;
}

.testimonial-card.revealed .testimonial-quote .highlight {
  background-size: 100% 100%;
}

/* Trust badge animations */
.trust-badge.scroll-reveal {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
              opacity 0.6s ease;
}

.trust-badge.revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Trust badge pulse */
@keyframes trustBadgePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(88, 166, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(88, 166, 255, 0);
  }
}

/* Impact numbers animation */
.impact-item {
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: opacity 0.5s ease, 
              transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.testimonial-card.revealed .impact-item {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Metric badges slide in */
.metric-badge {
  opacity: 0;
  transform: translateX(-30px) scale(0.95);
  transition: opacity 0.5s ease, 
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card.revealed .metric-badge {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Client info fade in */
.testimonial-footer {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease 0.5s, 
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
}

.testimonial-card.revealed .testimonial-footer {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced 3D hover effects matching services cards */
.testimonial-card {
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  transform-style: preserve-3d;
  transform: translateZ(0); /* Enable GPU acceleration */
}

.testimonial-card:hover {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

/* Staggered animations for multiple elements */
.testimonial-card.revealed .rating-stars svg:nth-child(1) { animation-delay: 0ms; }
.testimonial-card.revealed .rating-stars svg:nth-child(2) { animation-delay: 60ms; }
.testimonial-card.revealed .rating-stars svg:nth-child(3) { animation-delay: 120ms; }
.testimonial-card.revealed .rating-stars svg:nth-child(4) { animation-delay: 180ms; }
.testimonial-card.revealed .rating-stars svg:nth-child(5) { animation-delay: 240ms; }

.testimonial-card.revealed .impact-item:nth-child(1) { transition-delay: 100ms; }
.testimonial-card.revealed .impact-item:nth-child(2) { transition-delay: 220ms; }
.testimonial-card.revealed .impact-item:nth-child(3) { transition-delay: 340ms; }

.testimonial-card.revealed .metric-badge:nth-child(1) { transition-delay: 150ms; }
.testimonial-card.revealed .metric-badge:nth-child(2) { transition-delay: 250ms; }
.testimonial-card.revealed .metric-badge:nth-child(3) { transition-delay: 350ms; }

/* Deep Element Interaction Animations
   ======================================= */

/* Icon bounce animation */
@keyframes iconBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-4px) scale(1.1); }
  75% { transform: translateY(2px) scale(0.95); }
}

/* Number pulse animation */
@keyframes numberPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); color: var(--accent-color); }
}

/* Arrow slide animation */
@keyframes arrowSlide {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* Individual element transitions */
.testimonial-card .rating-stars svg,
.testimonial-card .project-type,
.testimonial-card .verified-badge,
.testimonial-card .testimonial-quote {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced star hover states */
.rating-stars svg {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease !important;
}

.rating-stars svg:hover {
  filter: drop-shadow(0 0 12px gold) brightness(1.3);
}

/* Metric badge enhanced hover */
.metric-badge {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.metric-badge::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(88, 166, 255, 0.4) 0%, transparent 70%);
  transition: width 0.3s ease, height 0.3s ease;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.metric-badge:hover::before {
  width: 100%;
  height: 100%;
}

.metric-badge svg {
  position: relative;
  z-index: 1;
}

/* Quote highlights enhanced interaction */
.testimonial-quote .highlight {
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.testimonial-quote .highlight::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.testimonial-quote .highlight:hover::after {
  transform: scaleX(1);
}

/* Avatar enhanced interaction */
.client-avatar {
  position: relative;
  cursor: pointer;
}

.client-avatar::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: scale(0.8);
}

.client-avatar:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* Impact numbers interactive */
.impact-number {
  cursor: pointer;
  display: inline-block;
  position: relative;
}

.impact-number::before {
  content: attr(data-value);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  color: var(--accent-color);
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.impact-number:hover::before {
  opacity: 1;
  transform: translateY(0);
}

/* Client details hover enhancement */
.client-name,
.client-title {
  cursor: pointer;
  position: relative;
  display: inline-block;
}

.client-name::after {
  content: '→';
  position: absolute;
  right: -20px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateX(-5px);
}

.client-name:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* View case study enhanced button */
.view-case-study {
  position: relative;
  overflow: hidden;
}

.view-case-study::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
  transform: translateY(-50%);
}

.view-case-study:hover::after {
  left: 100%;
}

/* Card depth layers for 3D parallax */
.testimonial-card {
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.testimonial-card > * {
  position: relative;
  z-index: 1;
  transform-style: preserve-3d;
  backface-visibility: hidden; /* Prevent flickering during 3D transforms */
}

/* Smooth transitions for 3D movement */
.testimonial-card,
.testimonial-card .rating-stars,
.testimonial-card .project-type,
.testimonial-card .verified-badge,
.testimonial-card .testimonial-quote,
.testimonial-card .client-avatar {
  transition: transform 0.1s ease-out;
}

/* Badge float animation on hover */
.project-type,
.verified-badge {
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.project-type:hover,
.verified-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Smooth all element transitions */
.testimonial-card * {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.testimonial-card *:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .testimonial-card.scroll-reveal,
  .trust-badge.scroll-reveal,
  .impact-item,
  .metric-badge,
  .testimonial-footer,
  .rating-stars svg,
  .testimonial-card * {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}