/* Sekcja opinii */
.testimonials {
  background-color: #f8f9fa;
  padding: 80px 0;
}

.testimonials-slider {
  padding: 20px 0 80px; /* Zwiększony padding na dole dla paginacji */
  margin-top: 40px;
  position: relative; /* Zapewnia kontekst pozycjonowania dla paginacji */
}

/* Karty z opiniami */
.testimonial-card {
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.04);
  height: 330px; /* Stała wysokość karty */
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Ukrywa zawartość wychodzącą poza kartę */
  cursor: pointer; /* Dodaję kursor pointer dla klikania */
}

.testimonial-card:hover {
  transform: translateY(-5px);
}

.testimonial-content {
  flex: 1; /* Zajmuje dostępną przestrzeń */
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  overflow: hidden; /* Ukrywa zawartość wychodzącą poza zawartość */
}

.testimonial-stars {
  color: #ffd700;
  font-size: 20px;
  margin-bottom: 15px;
}

.testimonial-content p {
  color: #4a4a4a;
  font-size: 16px;
  line-height: 1.6;
  font-style: italic;
  margin: 0;
  flex: 1; /* Zajmuje dostępną przestrzeń */
  position: relative; /* Dla pseudoelementu */
  overflow: hidden;
  max-height: 210px; /* Ograniczenie maksymalnej wysokości */
  display: -webkit-box;
  -webkit-line-clamp: 6; /* maksymalna liczba wyświetlanych linii */
  line-clamp: 6;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  max-height: 9em; /* dopasuj do liczby linii × line-height */
  line-height: 1.5em;
}

/* Autor opinii */
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: auto; /* Przykleja do dołu karty */
}

.testimonial-avatar {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f0f0f0;
  flex-shrink: 0; /* Zapobiega ściskaniu avatara */
}

.testimonial-avatar i {
  font-size: 30px;
}

/* Style dla avatarów */
.testimonial-avatar.female {
  background: #fce8ef;
}

.testimonial-avatar.female i {
  color: #e83e8c;
}

.testimonial-avatar.male {
  background: #e8f4fc;
}

.testimonial-avatar.male i {
  color: #0d6efd;
}

.testimonial-info {
  flex: 1; /* Pozwala na lepsze wyrównanie tekstu */
}

.testimonial-info h4 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.testimonial-info p {
  margin: 5px 0 0;
  font-size: 14px;
  color: #666;
}

/* Popup dla opinii */
.testimonial-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
}

.testimonial-popup.active {
  display: flex;
}

.testimonial-popup-content {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.testimonial-popup-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 30px;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
  padding: 5px;
}

.testimonial-popup-close:hover {
  color: #333;
}

.testimonial-popup-stars {
  color: #ffd700;
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
}

.testimonial-popup-text {
  color: #4a4a4a;
  font-size: 18px;
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 30px;
  text-align: justify;
}

.testimonial-popup-author {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.testimonial-popup-avatar {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f0f0f0;
  flex-shrink: 0;
}

.testimonial-popup-avatar i {
  font-size: 35px;
}

.testimonial-popup-avatar.female {
  background: #fce8ef;
}

.testimonial-popup-avatar.female i {
  color: #e83e8c;
}

.testimonial-popup-avatar.male {
  background: #e8f4fc;
}

.testimonial-popup-avatar.male i {
  color: #0d6efd;
}

.testimonial-popup-info h4 {
  margin: 0;
  font-size: 20px;
  color: #333;
  font-weight: 600;
}

/* Responsywność */
@media (max-width: 768px) {
  .testimonials {
    padding: 60px 0;
  }

  .testimonial-card {
    padding: 20px;
    height: 300px; /* Nieco mniejsza wysokość na mniejszych ekranach */
  }

  .testimonial-content p {
    font-size: 15px;
    max-height: 160px; /* Mniejsza maksymalna wysokość na mniejszych ekranach */
  }

  .testimonial-avatar i {
    font-size: 25px;
  }

  .testimonial-popup-content {
    padding: 30px 20px;
    margin: 10px;
    max-height: 85vh;
  }

  .testimonial-popup-text {
    font-size: 16px;
  }

  .testimonial-popup-avatar {
    width: 50px;
    height: 50px;
  }

  .testimonial-popup-avatar i {
    font-size: 30px;
  }

  .testimonial-popup-info h4 {
    font-size: 18px;
  }
}

@media (max-width: 991px) {
  .testimonial-slides {
    gap: 0;
  }

  .testimonial-card {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 992px) {
  .testimonial-slides {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }

  .testimonial-card {
    min-width: auto;
  }
}

/* Animacje */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.testimonial-card {
  animation: fadeIn 0.5s ease-out forwards;
}
