/**
 * TradeCalcs Testimonials Carousel Styles
 * Version: 1.0.0
 *
 * Theming via CSS custom properties for easy customization.
 * Mobile responsive, accessible, clean design.
 */

:root {
  /* Testimonials colors */
  --tc-testimonials-bg: #ffffff;
  --tc-testimonials-border: #e5e7eb;
  --tc-testimonials-content-text: #111827;
  --tc-testimonials-author-text: #374151;
  --tc-testimonials-role-text: #6b7280;
  --tc-testimonials-star-filled: #f59e0b;
  --tc-testimonials-star-empty: #d1d5db;
  --tc-testimonials-btn-bg: #f3f4f6;
  --tc-testimonials-btn-hover: #667eea;
  --tc-testimonials-btn-text: #374151;
  --tc-testimonials-dot-bg: #d1d5db;
  --tc-testimonials-dot-active: #667eea;

  /* Spacing */
  --tc-testimonials-padding: 2rem;
  --tc-testimonials-gap: 1rem;
  --tc-testimonials-radius: 12px;

  /* Typography */
  --tc-testimonials-content-size: 1.125rem;
  --tc-testimonials-author-size: 1rem;
  --tc-testimonials-role-size: 0.875rem;

  /* Shadows */
  --tc-testimonials-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --tc-testimonials-bg: #1f2937;
    --tc-testimonials-border: #374151;
    --tc-testimonials-content-text: #f9fafb;
    --tc-testimonials-author-text: #e5e7eb;
    --tc-testimonials-role-text: #d1d5db;
    --tc-testimonials-star-filled: #fbbf24;
    --tc-testimonials-star-empty: #4b5563;
    --tc-testimonials-btn-bg: #374151;
    --tc-testimonials-btn-hover: #818cf8;
    --tc-testimonials-btn-text: #d1d5db;
    --tc-testimonials-dot-bg: #4b5563;
    --tc-testimonials-dot-active: #818cf8;
  }
}

/* Main container */
.tc-testimonials {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Wrapper */
.tc-testimonials-wrapper {
  position: relative;
  box-sizing: border-box;
}

/* Track (carousel container) */
.tc-testimonials-track {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Individual testimonial */
.tc-testimonial {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: var(--tc-testimonials-padding);
  background: var(--tc-testimonials-bg);
  border: 1px solid var(--tc-testimonials-border);
  border-radius: var(--tc-testimonials-radius);
  box-shadow: var(--tc-testimonials-shadow);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  text-align: center;
  box-sizing: border-box;
}

.tc-testimonial-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  position: relative;
}

/* Testimonial content (quote) */
.tc-testimonial-content {
  font-size: var(--tc-testimonials-content-size);
  color: var(--tc-testimonials-content-text);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.tc-testimonial-content::before {
  content: '"';
  font-size: 2rem;
  line-height: 0;
  vertical-align: -0.4em;
  margin-right: 0.25rem;
  opacity: 0.5;
}

.tc-testimonial-content::after {
  content: '"';
  font-size: 2rem;
  line-height: 0;
  vertical-align: -0.4em;
  margin-left: 0.25rem;
  opacity: 0.5;
}

/* Author */
.tc-testimonial-author {
  font-size: var(--tc-testimonials-author-size);
  font-weight: 700;
  color: var(--tc-testimonials-author-text);
  margin-bottom: 0.25rem;
}

/* Role */
.tc-testimonial-role {
  font-size: var(--tc-testimonials-role-size);
  color: var(--tc-testimonials-role-text);
  margin-bottom: 1rem;
}

/* Rating stars */
.tc-testimonial-rating {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  font-size: 1.25rem;
}

.tc-star {
  display: inline-block;
}

.tc-star-filled {
  color: var(--tc-testimonials-star-filled);
}

.tc-star-empty {
  color: var(--tc-testimonials-star-empty);
}

/* Controls */
.tc-testimonials-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* Navigation buttons */
.tc-testimonials-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tc-testimonials-btn-bg);
  color: var(--tc-testimonials-btn-text);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.tc-testimonials-btn:hover,
.tc-testimonials-btn:focus {
  background: var(--tc-testimonials-btn-hover);
  color: white;
  outline: none;
}

.tc-testimonials-btn:focus-visible {
  outline: 3px solid var(--tc-testimonials-btn-hover);
  outline-offset: 2px;
}

.tc-testimonials-btn:active {
  transform: scale(0.95);
}

/* Pagination dots */
.tc-testimonials-dots {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.tc-testimonials-dot {
  width: 12px;
  height: 12px;
  background: var(--tc-testimonials-dot-bg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  padding: 0;
  box-sizing: border-box;
}

.tc-testimonials-dot:hover,
.tc-testimonials-dot:focus {
  transform: scale(1.2);
  outline: none;
}

.tc-testimonials-dot:focus-visible {
  outline: 2px solid var(--tc-testimonials-dot-active);
  outline-offset: 2px;
}

.tc-testimonials-dot-active {
  background: var(--tc-testimonials-dot-active);
  transform: scale(1.3);
}

/* Mobile responsive */
@media (max-width: 768px) {
  :root {
    --tc-testimonials-padding: 1.5rem;
    --tc-testimonials-content-size: 1rem;
    --tc-testimonials-author-size: 0.9375rem;
  }

  .tc-testimonials-track {
    min-height: 250px;
  }

  .tc-testimonials-btn {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

/* Smaller mobile */
@media (max-width: 375px) {
  :root {
    --tc-testimonials-padding: 1.25rem;
    --tc-testimonials-content-size: 0.9375rem;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .tc-testimonial {
    transition: opacity 0.2s ease;
    transform: none;
  }

  .tc-testimonial-active {
    transform: none;
  }

  .tc-testimonials-btn,
  .tc-testimonials-dot {
    transition: none;
  }

  .tc-testimonials-btn:active,
  .tc-testimonials-dot:hover {
    transform: none;
  }
}
