/* Testimonials Carousel Styles for Sparky4u Electric */
/* Auto-scrolling marquee effect with pause on hover */

.testimonials-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 60px 0;
  overflow: hidden;
  position: relative;
}

.testimonials-section::before,
.testimonials-section::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 10;
  pointer-events: none;
}

.testimonials-section::before {
  left: 0;
  background: linear-gradient(to right, #f8f9fa, transparent);
}

.testimonials-section::after {
  right: 0;
  background: linear-gradient(to left, #f8f9fa, transparent);
}

.testimonials-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 0 20px;
}

.testimonials-header h2 {
  font-family: 'Poppins', 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 10px;
  line-height: 1.3;
}

.testimonials-header .subtitle {
  font-size: 16px;
  color: #6c757d;
  font-family: 'Source Sans Pro', sans-serif;
}

.testimonials-track {
  display: flex;
  animation: scroll 80s linear infinite;
  width: max-content;
}

.testimonials-section:hover .testimonials-track {
  animation-play-state: paused;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.testimonial-card {
  flex: 0 0 auto;
  width: 350px;
  margin: 0 15px;
  background: #ffffff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.testimonial-card .stars {
  color: #ffc107;
  font-size: 18px;
  margin-bottom: 15px;
  letter-spacing: 2px;
}

.testimonial-card .review-text {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #444;
  margin-bottom: 15px;
  font-style: italic;
  position: relative;
  padding-left: 20px;
  max-height: 80px;
  overflow-y: auto;
  /* Force scrollbar visible on all browsers including iOS */
  scrollbar-width: auto;
  scrollbar-color: #007bff #f0f0f0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Force scrollbar to always show on webkit browsers */
.testimonial-card .review-text::-webkit-scrollbar {
  width: 12px;
  -webkit-appearance: none;
  appearance: none;
}

.testimonial-card .review-text::-webkit-scrollbar-thumb {
  background: #007bff;
  border-radius: 6px;
  min-height: 40px;
  -webkit-appearance: none;
}

.testimonial-card .review-text::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 6px;
  -webkit-appearance: none;
}

.testimonial-card .review-text::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -5px;
  font-size: 40px;
  color: #007bff;
  opacity: 0.3;
  font-family: Georgia, serif;
}

.testimonial-card .reviewer {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: #6c757d;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.testimonial-card .reviewer::before {
  content: '—';
  color: #007bff;
}

/* Scroll hint for overflowing reviews */
.testimonial-card .scroll-hint {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: #6c757d;
  text-align: center;
  margin-top: 6px;
  opacity: 0.7;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Google Maps link */
.testimonials-cta {
  text-align: center;
  margin-top: 40px;
  padding: 0 20px;
}

.testimonials-cta a {
  display: inline-block;
  background: #007bff;
  color: #fff;
  padding: 12px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 15px;
  transition: background 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.testimonials-cta a:hover {
  background: #0056b3;
  transform: translateY(-2px);
}

.testimonials-cta a svg {
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  width: 18px;
  height: 18px;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
  .testimonials-section {
    padding: 40px 0;
  }
  
  .testimonials-section::before,
  .testimonials-section::after {
    width: 40px;
  }
  
  .testimonials-header h2 {
    font-size: 22px;
  }
  
  .testimonial-card {
    width: 320px;
    padding: 20px;
    margin: 0 12px;
  }
  
  .testimonial-card .review-text {
    font-size: 15px;
    max-height: 100px;
  }
  
  .testimonials-track {
    animation-duration: 70s;
  }
}

@media screen and (max-width: 480px) {
  .testimonials-section {
    padding: 30px 0;
  }
  
  .testimonials-section::before,
  .testimonials-section::after {
    display: none;
  }
  
  .testimonials-header h2 {
    font-size: 20px;
    padding: 0 15px;
  }
  
  .testimonials-header .subtitle {
    font-size: 14px;
    padding: 0 15px;
  }
  
  .testimonial-card {
    /* Full width minus small margins for scrolling */
    width: calc(100vw - 60px);
    max-width: 400px;
    min-width: 300px;
    padding: 22px;
    margin: 0 12px;
  }
  
  .testimonial-card .stars {
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .testimonial-card .review-text {
    font-size: 15px;
    /* Show 8-10 lines of text */
    max-height: 220px;
    line-height: 1.6;
    /* Prominent scrollbar on mobile */
    scrollbar-width: auto;
    scrollbar-color: #007bff #f0f0f0;
  }
  
  .testimonial-card .review-text::-webkit-scrollbar {
    width: 12px;
  }
  
  .testimonial-card .review-text::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 6px;
    border: 2px solid #f0f0f0;
  }
  
  .testimonial-card .review-text::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 6px;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.1);
  }
  
  .testimonial-card .reviewer {
    font-size: 13px;
    margin-top: 12px;
  }
  
  .testimonials-track {
    animation-duration: 50s;
  }
  
  .testimonials-cta a {
    padding: 12px 28px;
    font-size: 15px;
  }
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .testimonials-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
  }
  
  .testimonial-card {
    margin: 10px;
  }
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}