/**
 * Testimonials Component Styles
 * 
 * Dynamic testimonial carousel/grid component
 * Based on clinical-to-changemaker.html production styling
 */

/* ===== Section Container ===== */
.testimonials-section {
  background: var(--color-bg-alt, #f8f9fa);
  padding: 48px 0;
  margin: 48px 0;
  overflow: hidden;
}

.testimonials-section h2 {
  text-align: center;
  margin: 0 0 8px;
}

.testimonials-header {
  text-align: center;
  margin-bottom: 32px;
}

.testimonials-header .quote-icon {
  color: var(--color-dica-1, #1caba4);
  font-size: 2rem;
  margin-top: 8px;
}

/* ===== Carousel Wrapper (for nav positioning) ===== */
.testimonials-wrapper {
  position: relative;
  padding: 0 80px;
}

/* ===== Carousel Track ===== */
.testimonials-carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0 32px;
  scrollbar-width: auto;
  scrollbar-color: var(--color-dica-1, #1caba4) rgba(28, 171, 164, 0.15);
}

/* Custom scrollbar */
.testimonials-carousel::-webkit-scrollbar {
  height: 12px;
}

.testimonials-carousel::-webkit-scrollbar-track {
  background: rgba(28, 171, 164, 0.15);
  border-radius: 6px;
}

.testimonials-carousel::-webkit-scrollbar-thumb {
  background: var(--color-dica-1, #1caba4);
  border-radius: 6px;
}

.testimonials-carousel::-webkit-scrollbar-thumb:hover {
  background: var(--color-dica-1-dark, #0d7a75);
}

/* ===== Navigation Arrows ===== */
.testimonials-nav {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: var(--color-dica-1, #1caba4);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(28, 171, 164, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.testimonials-nav:hover {
  background: var(--color-dica-1-dark, #0d7a75);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 25px rgba(28, 171, 164, 0.5);
}

.testimonials-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.testimonials-nav:focus {
  outline: 2px solid var(--color-dica-2, #1c4554);
  outline-offset: 2px;
}

.testimonials-nav--prev {
  left: 10px;
}

.testimonials-nav--next {
  right: 10px;
}

/* ===== Card ===== */
.testimonial-card {
  flex: 0 0 320px;
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
}

/* ===== Quote ===== */
.testimonial-quote {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text, #535641);
  margin-bottom: 20px;
  position: relative;
}

.testimonial-quote::before {
  content: '"';
  font-size: 3rem;
  color: var(--color-dica-1, #1caba4);
  opacity: 0.3;
  position: absolute;
  top: -16px;
  left: -8px;
  font-family: Georgia, serif;
  line-height: 1;
}

.testimonial-quote p {
  margin: 0;
}

/* ===== Author ===== */
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}

/* ===== Avatar ===== */
.testimonial-avatar {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.testimonial-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-dica-1, #1caba4);
}

/* ===== Name & Job ===== */
.testimonial-info {
  display: flex;
  flex-direction: column;
}

.testimonial-name {
  font-weight: 600;
  color: var(--color-dica-1, #1caba4);
  font-size: 0.95rem;
}

.testimonial-job {
  font-size: 0.8rem;
  color: var(--color-text-light, #5a5a4a);
}

/* ===== Grid Layout ===== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 16px 20px;
}

/* ===== List Layout ===== */
.testimonials-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 20px;
}

.testimonials-list .testimonial-card {
  flex: none;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
  .testimonials-wrapper {
    padding: 0 50px;
  }

  .testimonials-nav {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  .testimonials-nav--prev {
    left: 5px;
  }

  .testimonials-nav--next {
    right: 5px;
  }

  .testimonial-card {
    flex: 0 0 280px;
    padding: 20px;
  }

  .testimonial-avatar {
    width: 48px;
    height: 48px;
  }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
  .testimonials-section {
    background: var(--color-bg-alt, #16213e);
  }

  .testimonial-card {
    background: var(--color-bg-alt, #16213e);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  .testimonial-quote {
    color: var(--color-text, #e8e8e8);
  }

  .testimonial-author {
    border-color: #3a3a5a;
  }

  .testimonial-name {
    color: #ffffff;
  }
}

/* ===== Loading State ===== */
.testimonials-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.testimonials-loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid rgba(28, 171, 164, 0.2);
  border-top-color: var(--color-dica-1, #1caba4);
  border-radius: 50%;
  animation: testimonials-spin 0.8s linear infinite;
}

@keyframes testimonials-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Empty State ===== */
.testimonials-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-light, #6b7280);
  font-style: italic;
}