/* ----------------------------------------------------
   GLOBAL WRAPPER
---------------------------------------------------- */

.injury-tool-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #333;
}

.injury-explorer {
  background: #ffffff;
}

/* ----------------------------------------------------
   ANIMATIONS
---------------------------------------------------- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.4s ease-out forwards;
}

/* ----------------------------------------------------
   HEADINGS + HELPER TEXT
---------------------------------------------------- */

.section-title {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: #333;
}

.injury-helper-text {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.subsection-title {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  font-weight: 600;
}

/* ----------------------------------------------------
   BODY REGION CARDS
---------------------------------------------------- */

.bodypart-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.bodypart-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.4rem;
  border-radius: 0.75rem;
  border: 1px solid #ddd;
  background: #f9f9f9;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  text-align: left;
}

.bodypart-card:hover {
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.bodypart-card.active {
  border-color: #ffbc00;
  background: #fff7e0;
}

.bodypart-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.bodypart-label {
  font-size: 1rem;
  font-weight: 600;
}

/* ----------------------------------------------------
   SUB-INJURY BUTTONS
---------------------------------------------------- */

.subinjury-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.subinjury-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.4rem;
  border-radius: 0.75rem;
  border: 1px solid #ddd;
  background: #f9f9f9;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  text-align: left;
  font-size: 1rem;
}

.subinjury-card:hover {
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.subinjury-card.active {
  border-color: #ffbc00;
  background: #fff7e0;
}

.subinjury-label {
  font-size: 1rem;
  font-weight: 600;
}

/* ----------------------------------------------------
   INFO PANEL
---------------------------------------------------- */

.info-panel {
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid #e0e0e0;
  background: #fafafa;
}

.info-panel.hidden {
  display: none;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.info-title {
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
}

.info-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.info-list {
  margin: 0;
  padding-left: 1.1rem;
}

.info-list li {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

/* ----------------------------------------------------
   TESTIMONIALS (DESKTOP / TABLET)
---------------------------------------------------- */

.testimonials-wrapper {
  margin-top: 2rem;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.testimonial-card {
  position: relative;
  padding: 1rem 1rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ----------------------------------------------------
   TESTIMONIAL TEXT + READ MORE
---------------------------------------------------- */

.testimonial-text {
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.testimonial-text.clamped {
  max-height: 8.5em; /* ~5–6 lines */
  overflow: hidden;
}

.testimonial-text.clamped::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5em;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff);
}

.testimonial-read-more {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #ffbc00;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-decoration: underline;
  align-self: flex-start;
}

/* ----------------------------------------------------
   REVIEWER NAME + STARS + INFO BUTTON
---------------------------------------------------- */

.testimonial-meta {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  width: 100%;
}

.testimonial-meta > div:last-child {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.testimonial-name a {
  color: #333;
  text-decoration: none;
  font-weight: 600;
}

.testimonial-name a:hover {
  text-decoration: underline;
}

/* ----------------------------------------------------
   STAR RATING (SVG)
---------------------------------------------------- */

.testimonial-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.testimonial-rating svg {
  width: 16px;
  height: 16px;
}

/* ----------------------------------------------------
   INFO “i” BUTTON + BRANDED TOOLTIP
---------------------------------------------------- */

.testimonial-info-btn {
  border: none;
  background: #f3f3f3;
  color: #555;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  font-size: 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.testimonial-info-btn:hover {
  background: #e5e5e5;
}

.testimonial-tooltip {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #333;
  font-size: 0.8rem;
  max-width: 240px;
  z-index: 10;
  border: 1px solid #e0e0e0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.testimonial-tooltip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: #ffbc00;
  border-radius: 0.75rem 0.75rem 0 0;
}

.testimonial-tooltip a {
  color: #ffbc00;
  text-decoration: underline;
  display: block;
  margin-top: 0.35rem;
}

/* ----------------------------------------------------
   CAROUSEL DOTS
---------------------------------------------------- */

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ddd;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot.active {
  background: #ffbc00;
  transform: scale(1.1);
}

/* ----------------------------------------------------
   RESPONSIVE LAYOUT
---------------------------------------------------- */

@media (max-width: 1024px) {
  .bodypart-row,
  .subinjury-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* MOBILE: TWO COLUMNS FOR FILTERS, HORIZONTAL CAROUSEL FOR TESTIMONIALS */

@media (max-width: 768px) {

  .bodypart-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .subinjury-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .bodypart-card,
  .subinjury-card {
    justify-content: flex-start !important;
    text-align: left !important;
    width: 100%;
  }

  .testimonials-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.75rem;
    padding-bottom: 0.25rem;
  }

  .testimonial-card {
    min-width: 65%; /* one full + ~35% peek of next */
    scroll-snap-align: start;
  }

  .info-panel {
    margin-top: 1rem;
  }
}