/* ==============================
   TESTIMONIALS — Modern Horizontal Layout
   Khách hàng nói gì
   ============================== */

/* Section Styles */
.testimonials-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

/* Decorative background elements */
.testimonials-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(214, 40, 40, 0.03) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.testimonials-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Header Styles */
.testimonials-header {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
  z-index: 1;
}

.testimonials-header h2 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.testimonials-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #d62828, #f59e0b);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* Slider Container */
.testimonials-slider {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 70px;
  overflow: hidden;
  z-index: 1;
}

/* Slides Container */
.testimonials-slides,
#testimonialsContainer {
  display: flex !important;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

/* Testimonial Slide Item */
.testimonial-slide {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 15px;
  box-sizing: border-box;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ==============================
   TESTIMONIAL CARD - HORIZONTAL LAYOUT
   Ảnh bên trái, nội dung bên phải
   ============================== */

.testimonial-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 20px 50px -12px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  border: 1px solid rgba(0, 0, 0, 0.04);
  min-height: 320px;
}

.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 8px 12px -2px rgba(0, 0, 0, 0.08),
    0 30px 60px -15px rgba(0, 0, 0, 0.15);
}

/* Author Section - Bên trái với ảnh */
.testimonial-author {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 35px 30px;
  background: linear-gradient(145deg, #1e3a5f 0%, #0f2744 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative pattern on author section */
.testimonial-author::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
  pointer-events: none;
}

.testimonial-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    0 0 0 8px rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  background-color: #e2e8f0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover .testimonial-avatar {
  transform: scale(1.08);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.4),
    0 0 0 10px rgba(255, 255, 255, 0.15);
}

.testimonial-info {
  text-align: center;
  position: relative;
  z-index: 1;
}

.testimonial-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: 0.3px;
}

.testimonial-info p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  line-height: 1.5;
}

.testimonial-company {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: #f59e0b !important;
  font-weight: 600;
  font-size: 0.8rem;
}


/* Content Section - Bên phải với quote */

/* Quote Icon - Floating */
.testimonial-quote-icon {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 5rem;
  color: #d62828;
  opacity: 0.08;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

/* Testimonial Text Content */
.testimonial-text {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 35px 40px;
  position: relative;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.85;
  color: #475569;
  font-style: italic;
  margin: 0;
  z-index: 1;
}

.testimonial-text::before {
  content: '"';
  position: absolute;
  top: 15px;
  left: 25px;
  font-size: 3.5rem;
  color: #d62828;
  opacity: 0.2;
  font-family: Georgia, serif;
  line-height: 1;
}

/* ==============================
   NAVIGATION CONTROLS
   ============================== */

.testimonials-control,
.slider__ctrl {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  color: #475569;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.testimonials-control:hover,
.slider__ctrl:hover {
  background: linear-gradient(135deg, #d62828, #b91c1c);
  color: #ffffff;
  border-color: #d62828;
  box-shadow: 0 8px 25px rgba(214, 40, 40, 0.3);
  transform: translateY(-50%) scale(1.08);
}

.testimonials-control.prev,
.slider__ctrl.prev {
  left: 5px;
}

.testimonials-control.next,
.slider__ctrl.next {
  right: 5px;
}

/* Dots Navigation */
.testimonials-dots,
.dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 35px;
  padding: 10px 0;
}

.testimonials-dot,
.dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.testimonials-dot:hover,
.dots button:hover {
  background: #94a3b8;
  transform: scale(1.1);
}

.testimonials-dot.active,
.dots button[aria-current="true"] {
  background: linear-gradient(135deg, #d62828, #f59e0b);
  transform: scale(1.4);
  box-shadow: 0 2px 8px rgba(214, 40, 40, 0.4);
}

/* ==============================
   RESPONSIVE DESIGN
   ============================== */

@media (max-width: 900px) {
  .testimonials-slider {
    padding: 0 50px;
  }

  .testimonial-author {
    flex: 0 0 220px;
    padding: 30px 25px;
  }

  .testimonial-avatar {
    width: 120px;
    height: 120px;
    border-width: 4px;
  }

  .testimonial-text {
    padding: 30px;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .testimonials-section {
    padding: 60px 0;
  }

  .testimonials-header {
    margin-bottom: 35px;
  }

  .testimonials-slider {
    padding: 0 15px;
    max-width: 100%;
  }

  .testimonial-slide {
    padding: 10px 5px;
  }

  /* Stack vertically on mobile */
  .testimonial-card {
    flex-direction: column;
    min-height: auto;
  }

  .testimonial-author {
    flex: none;
    flex-direction: row;
    padding: 20px 25px;
    gap: 18px;
  }

  .testimonial-avatar {
    width: 90px;
    height: 90px;
    margin-bottom: 0;
    flex-shrink: 0;
    border-width: 4px;
  }

  .testimonial-info {
    text-align: left;
  }

  .testimonial-info h3 {
    font-size: 1rem;
  }

  .testimonial-info p {
    font-size: 0.8rem;
  }

  .testimonial-company {
    border-top: none;
    padding-top: 4px;
    margin-top: 4px;
  }

  .testimonial-text {
    padding: 25px;
    font-size: 0.95rem;
    line-height: 1.75;
  }

  .testimonial-text::before {
    top: 10px;
    left: 15px;
    font-size: 2.5rem;
  }

  .testimonial-quote-icon {
    display: none;
  }

  /* Hide arrow buttons on mobile */
  .testimonials-control,
  .slider__ctrl {
    display: none;
  }

  .testimonials-dots,
  .dots {
    margin-top: 25px;
  }
}

@media (max-width: 480px) {
  .testimonials-section {
    padding: 50px 0;
  }

  .testimonials-header {
    margin-bottom: 25px;
  }

  .testimonials-header h2::after {
    width: 45px;
    height: 3px;
  }

  .testimonial-card {
    border-radius: 16px;
  }

  .testimonial-author {
    padding: 18px 20px;
    gap: 15px;
  }

  .testimonial-avatar {
    width: 75px;
    height: 75px;
    border-width: 3px;
  }

  .testimonial-info h3 {
    font-size: 0.95rem;
  }

  .testimonial-info p {
    font-size: 0.75rem;
  }

  .testimonial-text {
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .testimonial-text::before {
    font-size: 2rem;
    top: 8px;
    left: 12px;
  }

  .testimonials-dot,
  .dots button {
    width: 8px;
    height: 8px;
  }
}

/* =
=============================
   ACCESSIBILITY & STATES
   ============================== */

/* Loading state */
.testimonials-slides:empty::after,
#testimonialsContainer:empty::after {
  content: 'Đang tải đánh giá...';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 280px;
  color: #94a3b8;
  font-style: italic;
  font-size: 1rem;
}

/* Focus states for accessibility */
.testimonials-control:focus,
.slider__ctrl:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.4), 0 4px 15px rgba(0, 0, 0, 0.08);
}

.testimonials-dot:focus,
.dots button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(214, 40, 40, 0.3);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

  .testimonials-slides,
  #testimonialsContainer {
    transition: none;
  }

  .testimonial-card,
  .testimonial-avatar,
  .testimonials-control,
  .slider__ctrl,
  .testimonials-dot,
  .dots button {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .testimonial-card {
    border: 2px solid #1e293b;
  }

  .testimonial-author {
    background: #1e293b;
  }

  .testimonial-info h3 {
    color: #ffffff;
  }

  .testimonial-text {
    color: #1e293b;
  }
}

/* Print styles */
@media print {
  .testimonials-section {
    padding: 30px 0;
    background: white !important;
  }

  .testimonials-section::before,
  .testimonials-section::after {
    display: none;
  }

  .testimonials-control,
  .slider__ctrl,
  .testimonials-dots,
  .dots {
    display: none !important;
  }

  .testimonials-slider {
    padding: 0;
    max-width: 100%;
    overflow: visible;
  }

  .testimonials-slides,
  #testimonialsContainer {
    display: block !important;
    transform: none !important;
  }

  .testimonial-slide {
    page-break-inside: avoid;
    margin-bottom: 25px;
    padding: 0;
  }

  .testimonial-card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }

  .testimonial-author {
    background: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .testimonial-info h3,
  .testimonial-info p {
    color: #1e293b !important;
  }
}

/* ==============================
   ANIMATION ENHANCEMENTS
   ============================== */

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.testimonial-card {
  animation: fadeInSlide 0.5s ease-out;
}

/* Subtle pulse on dots */
@keyframes dotPulse {

  0%,
  100% {
    box-shadow: 0 2px 8px rgba(214, 40, 40, 0.4);
  }

  50% {
    box-shadow: 0 2px 12px rgba(214, 40, 40, 0.6);
  }
}

.testimonials-dot.active,
.dots button[aria-current="true"] {
  animation: dotPulse 2s ease-in-out infinite;
}