.testimonial-slider-container {
  position: relative;
  width: 100%;
  display: flex;
  padding: 10px;
}

.slider-wrapper {
  flex: 1;
  overflow: hidden;
}

.testimonial-slider {
  display: flex;
  gap: 20px;
  will-change: transform;
}

.testimonial-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #ddd;
  background-color: #f9f9f9;
  transition: transform 0.3s ease;
  box-sizing: border-box;
}

/* Make sure images inside testimonial items fit properly */
.testimonial-video-thumbnail {
  width: auto;
  height: 100%;
  object-fit: cover;
}

/* Testimonial Slider Navigation */
.slider-dots {
  display: flex;
  justify-content: center;
  padding: 10px;
}

.slider-dot {
  width: 10px;
  height: 10px;
  margin: 5px 0;
  background-color: var(--blue);
  opacity: 0.4;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.slider-dot.active,
.slider-dot:hover {
  opacity: 1;
}

.slider-dot.active {
  height: 20px;
}

.testimonial-title {
  text-align: center;
  padding: 8px;
  color: var(--blue);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.testimonial-video-wrapper {
  position: relative;
  display: flex;
  width: 100%;
}

/* Overlays and Hovers */
.testimonial-item .video-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3); /* Light grey with low opacity */
  z-index: 1;
  transition: background-color 0.3s ease;
}

.testimonial-item:hover .video-overlay::before {
  background-color: rgba(0, 0, 0, 0); /* Remove overlay on hover */
}

.testimonial-item .video-overlay {
  position: relative;
  display: block;
  width: 100%;
  padding-top: 56.25%; /* This creates a 16:9 aspect ratio */
  overflow: hidden;
  border-radius: 5px;
  scale: 1;
  transition: scale 0.2s ease;
}

.testimonial-item:hover .video-overlay {
  scale: 1.02;
}

.testimonial-item .video-overlay img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Play Button */
.testimonial-item .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 75px;
  width: 75px;
  font-size: 40px;
  line-height: 1.1;
  color: white;
  background-color: rgb(87 138 158 / 85%);
  padding: 20px;
  border-radius: 50%;
  pointer-events: none; /* Ensure the button doesn't interfere with the link click */
  transition: transform 0.2s ease, background-color 0.2s ease;
  z-index: 2; /* Position above translucent overlay */
}

.testimonial-item:hover .play-button {
  transform: translate(-50%, -50%) scale(1.1);
  background-color: rgb(87 138 158 / 100%);
}

/* Testimonial Popup Styles */
.testimonial-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.testimonial-popup-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.testimonial-popup-video-wrapper {
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  position: relative;
  border-radius: 8px;
  overflow: hidden; /* Hide overflow to maintain the clean look */
}

.testimonial-popup-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media only screen and (max-width: 980px) {

  .testimonial-slider-container {
    flex-direction: column;
    gap: 8px;
  }

  .testimonial-slider {
    flex-direction: row; /* Keep horizontal layout for mobile sliding */
    gap: 20px;
  }

  .testimonial-item {
    width: 100% !important;
  }

  /* Adjust dots to be horizontal on mobile */
  .slider-dots {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
  }

  .slider-dot {
    width: 12px !important;
    height: 12px !important;
    margin: 0 !important;
  }

  .slider-dot.active {
    width: 24px !important;
    height: 12px !important;
  }

  .testimonial-popup-content {
    width: 90vw; /* 90% of the viewport width on mobile*/
  }
}

@media only screen and (min-width: 981px) {

  .testimonial-slider-container {
    gap: 20px;
  }

  .testimonial-item {
    flex: 0 0 calc((100% - 40px) / 3);
  }

  .slider-dots {
    flex-direction: column;
  }

  .testimonial-popup-content {
    width: 80vw; /* 90% of the viewport width on desktop */
  }

}