/* testimony */
/* Custom properties for consistency, though Tailwind handles most of this now */
:root {
  --transition-duration: 0.7s;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-carousel {
  position: relative;
  width: 100%;
}

.testimonial-card {
  /* Tailwind handles transition-all duration-700 ease-in-out */
  flex-shrink: 0;
  transform-origin: center;
  position: absolute;
  left: 50%;
  top: 0;
  pointer-events: none;

  min-height: 250px;
}

/* Active card: Desktop specific styling */
@media (min-width: 1025px) {
  .testimonial-card.active > div {
    width: 900px; /* Original desktop active width */
    height: 300px; /* Original desktop active height */
    flex-direction: row; /* Ensure text and video are side-by-side */
    justify-content: space-between;
    align-items: stretch; /* Stretch items to fill height */
    pointer-events: auto;
    opacity: 1; /* Ensure active card is fully visible */
  }

  .testimonial-card.active .video-container {
    height: 100%; /* Video container takes full height of the parent div */
    width: 600px;
    padding-bottom: 0; /* Remove aspect ratio padding for desktop */
    order: unset; /* Revert order for desktop */
  }

  .testimonial-card.active > div > div:first-child {
    /* Text part */
    width: 254px; /* Original text container width */
    margin-top: 0; /* Remove top margin */
  }
}

/* Inactive cards: Desktop */
.testimonial-card.inactive > div {
  width: 254px;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: auto;
  opacity: 0.4; /* Opacity for inactive cards */
}

.testimonial-card.inactive .video-container {
  display: none; /* Hide video for inactive cards */
}

/* Hidden cards: Desktop */
.testimonial-card.hidden > div {
  width: 254px;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  opacity: 0;
}
.testimonial-card.hidden .video-container {
  display: none; /* Hide video for hidden cards */
}

/* Base states for active/inactive/hidden testimonials */
.testimonial-card.active {
  opacity: 1;
  transform: translateX(-50%) scale(1); /* Keep active card centered */
  z-index: 10;
}

.testimonial-card.inactive {
  opacity: 0.4;
  z-index: 5;
}

.testimonial-card.hidden {
  opacity: 0;
  transform: translateX(-50%) scale(0.6);
  z-index: 1;
}

/* Specific video container styling (for active card) */
.video-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 1024px) {
  .testimonial-card.active > div {
    width: 100%;
    max-width: 900px;
    height: auto;
    flex-direction: column;
    align-items: center;
  }
  .testimonial-card.active .video-container {
    height: 0;
    padding-bottom: 56.25%;
  }
  .testimonial-card.active .video-container iframe {
    position: absolute;
  }
  .testimonial-card.active > div > div:first-child {
    width: 100%;
  }

  .testimonial-card.inactive {
    opacity: 0.2;
  }
}

@media (max-width: 768px) {
  .testimonial-card {
    position: relative;
    left: 0 !important;
    transform: translateX(0) !important;
    width: 100%;
    min-height: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s ease-in-out, transform 0.7s ease-in-out;
  }

  .testimonial-card.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    transform: translateX(0) scale(1);
    z-index: 10;
  }

  .testimonial-card.active > div {
    width: 100%; /* Make active card full width on small screens */
    max-width: 100%;
    height: auto;
    flex-direction: column;
    gap: 16px;
  }

  .testimonial-card.active .video-container {
    order: -1;
    height: 0;
    padding-bottom: 56.25%;
    width: 100%;
  }

  .testimonial-card.inactive,
  .testimonial-card.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
  }

  .testimonial-carousel {
    justify-content: center;
    align-items: flex-start;
    height: auto !important;
  }
}
