/* 
 * testimonials.css - Advanced styling for testimonials section
 * For Cosmo Travels & Tours - https://cosmotravelsandtours.com
 * Last updated: April 2025
 */

 :root {
  --transition-smooth: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  --card-bg-color: #1e1e1e;
  --card-hover-translate: -12px;
  --accent-gold-rgb: 218, 165, 32; /* Fallback if not defined elsewhere */
}

/* Testimonials Section Container */
#testimonials {
  background-color: var(--dark-color);
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95)),
                    url('../img/patterns/spice-pattern-dark.png');
  background-size: 400px;
  background-position: center;
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

/* Section Header Styling */
#testimonials .section-title {
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#testimonials .section-title:after {
  content: '';
  position: absolute;
  width: 100px;
  height: 4px;
  background-color: var(--accent-gold);
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%);
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(var(--accent-gold-rgb), 0.5);
}

#testimonials .section-subtitle {
  font-size: 1.15rem;
  color: #bbb;
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Decorative Background Elements */
#testimonials:before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(var(--accent-gold-rgb), 0.03);
  border-radius: 50%;
  top: -100px;
  left: -100px;
  z-index: 1;
}

#testimonials:after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(var(--accent-gold-rgb), 0.02);
  border-radius: 50%;
  bottom: -150px;
  right: -150px;
  z-index: 1;
}

/* Testimonials Slider Styling */
.testimonials-slider {
  position: relative;
  z-index: 2;
  padding: 20px 0;
}

/* Testimonial Card Styling */
.testimonial-card {
  transition: var(--transition-smooth);
  overflow: hidden;
  border-radius: 18px;
  background-color: var(--card-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
  height: 100%;
  margin: 15px 10px;
  transform: translateY(0);
  position: relative;
}

.testimonial-card:hover {
  transform: translateY(var(--card-hover-translate));
  border-color: rgba(var(--accent-gold-rgb), 0.3);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 30px rgba(var(--accent-gold-rgb), 0.15);
}

.testimonial-card .card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Testimonial Text */
.testimonial-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #ffffff;
  font-style: italic;
  position: relative;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.testimonial-text::before {
  content: '\201C';
  font-size: 3.5rem;
  position: absolute;
  top: -1.5rem;
  left: -0.8rem;
  color: rgba(var(--accent-gold-rgb), 0.15);
  font-family: 'Georgia', serif;
  z-index: 0;
}

/* Expand Button for Testimonials */
.testimonial-expand {
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
}

.testimonial-expand i {
  font-size: 0.75rem;
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.testimonial-expand:hover {
  color: #fff;
}

.testimonial-expand:hover i {
  transform: translateX(3px);
}

/* Testimonial Footer */
.testimonial-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  margin-top: auto;
}

.testimonial-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.2rem;
}

.testimonial-country {
  color: #ddd;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.testimonial-country i {
  color: var(--accent-gold);
  margin-right: 6px;
  font-size: 0.85rem;
}

/* Tour Type & Date Styling */
.testimonial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0.8rem;
}

.testimonial-tour {
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  background-color: rgba(var(--accent-gold-rgb), 0.15);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
}

.testimonial-tour i {
  margin-right: 5px;
  font-size: 0.8rem;
}

.testimonial-date {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
}

.testimonial-date i {
  margin-right: 5px;
  font-size: 0.8rem;
}

/* Rating Stars */
.testimonial-rating {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}

.testimonial-rating i {
  color: var(--accent-gold);
  font-size: 1rem;
  margin-right: 3px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.testimonial-rating span {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  margin-left: 6px;
}

/* Enhanced Filter Buttons */
.testimonial-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
  gap: 8px;
}

.testimonial-filter {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.7rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.testimonial-filter:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(var(--accent-gold-rgb), 0), rgba(var(--accent-gold-rgb), 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.testimonial-filter:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.testimonial-filter:hover:before {
  opacity: 1;
}

.testimonial-filter.active {
  background-color: var(--accent-gold);
  color: #000;
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(var(--accent-gold-rgb), 0.4);
}

.testimonial-filter i {
  margin-right: 6px;
  font-size: 0.9rem;
}

/* Avatar Info Container */
.avatar-info {
  display: flex;
  align-items: center;
  margin-top: 0.8rem;
}

/* Avatar Implementation */
.avatar-container {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 12px;
  border: 2px solid rgba(var(--accent-gold-rgb), 0.3);
  position: relative;
  flex-shrink: 0;
  display: none; /* Hidden by default, enable with .show-avatar class */
}

.avatar-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(var(--accent-gold-rgb), 0.1);
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 1.2rem;
}

/* Show avatar when the class is added */
.show-avatar .avatar-container {
  display: block;
}

/* Client Info Container */
.client-info {
  width: 100%;
}

/* Carousel Controls */
.testimonial-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 50px;
  height: 50px;
  opacity: 0;
  transition: all 0.3s ease;
}

.testimonials-slider:hover .testimonial-control {
  opacity: 1;
}

.carousel-control-prev.testimonial-control {
  left: -25px;
}

.carousel-control-next.testimonial-control {
  right: -25px;
}

.control-icon {
  width: 50px;
  height: 50px;
  background-color: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  box-shadow: 0 5px 15px rgba(var(--accent-gold-rgb), 0.25);
  transition: all 0.3s ease;
}

.testimonial-control:hover .control-icon {
  transform: scale(1.1);
  background-color: #fff;
}

/* Custom Carousel Indicators */
#testimonialsCarousel .carousel-indicators {
  position: relative;
  margin-top: 30px;
  margin-bottom: 0;
  justify-content: center;
  gap: 8px;
  bottom: -10px;
}

#testimonialsCarousel .carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  margin: 0;
  opacity: 1;
  transition: all 0.3s ease;
}

#testimonialsCarousel .carousel-indicators button.active {
  background-color: var(--accent-gold);
  width: 30px;
  border-radius: 10px;
}

/* Badge Styling */
.badge {
  color: #111;
  background-color: var(--accent-gold);
  font-weight: 600;
  padding: 0.4em 0.8em;
  border-radius: 50px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
}

.badge-light {
  background-color: rgba(255, 255, 255, 0.9);
  color: #111;
}

.badge i {
  margin-right: 4px;
  font-size: 0.8rem;
}

/* View All Button */
#testimonials .btn-lg {
  background-color: var(--accent-gold);
  border: 2px solid var(--accent-gold);
  color: #111;
  font-weight: 600;
  letter-spacing: 0.8px;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  box-shadow: 0 8px 15px rgba(var(--accent-gold-rgb), 0.3);
  transition: all 0.4s ease;
  margin-top: 1.5rem;
}

#testimonials .btn-lg:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px rgba(var(--accent-gold-rgb), 0.4);
  background-color: transparent;
  color: var(--accent-gold);
}

/* Card Animation */
.testimonial-card.animated {
  animation: fadeInUp 0.8s forwards;
}

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

/* Animation Delay Variations */
.testimonial-card.animated:nth-child(2) {
  animation-delay: 0.1s;
}

.testimonial-card.animated:nth-child(3) {
  animation-delay: 0.2s;
}

.testimonial-card.animated:nth-child(4) {
  animation-delay: 0.3s;
}

/* =============================================
   PAGINATION STYLING
   ============================================= */
.pagination-container {
  margin: 40px 0 20px;
}

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.page-item .page-link {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.05);
  min-width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.page-item .page-link:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(var(--accent-gold-rgb), 0), rgba(var(--accent-gold-rgb), 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.page-item.active .page-link {
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #111;
  box-shadow: 0 5px 15px rgba(var(--accent-gold-rgb), 0.2);
  transform: translateY(-3px);
  font-weight: 600;
}

.page-item .page-link:hover:not(.active) {
  background-color: rgba(var(--accent-gold-rgb), 0.15);
  color: var(--accent-gold);
  transform: translateY(-3px);
}

.page-item .page-link:hover:before {
  opacity: 1;
}

.page-item.disabled .page-link {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Pagination navigation icons */
.page-item.prev .page-link,
.page-item.next .page-link {
  background-color: rgba(var(--accent-gold-rgb), 0.1);
}

/* =============================================
   SEARCH BOX STYLING
   ============================================= */
.search-container {
  max-width: 650px;
  margin: 0 auto 35px;
}

.search-container .input-group {
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.search-container .input-group:focus-within {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(var(--accent-gold-rgb), 0.2);
  border-color: rgba(var(--accent-gold-rgb), 0.3);
}

.search-container .input-group-text {
  background-color: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  padding-left: 20px;
}

.search-container .form-control {
  border: none;
  padding: 15px 20px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-container .form-control:focus {
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.search-container .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-container .btn {
  border: none;
  border-radius: 0 50px 50px 0;
  padding: 0 25px;
  background-color: var(--accent-gold);
  color: #111;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-container .btn i {
  margin-right: 6px;
}

.search-container .btn:hover {
  background-color: #fff;
  color: #111;
  transform: translateX(2px);
}

/* =============================================
   FILTER COUNT BADGE
   ============================================= */
.filtered-count {
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s forwards 0.3s;
}

.filtered-count .badge {
  padding: 8px 16px;
  font-size: 0.9rem;
  border-radius: 50px;
  background-color: var(--accent-gold);
  box-shadow: 0 5px 15px rgba(var(--accent-gold-rgb), 0.15);
}

/* No Results Message */
.no-results {
  text-align: center;
  padding: 3rem 0;
  color: rgba(255, 255, 255, 0.7);
}

.no-results i {
  font-size: 3rem;
  color: rgba(var(--accent-gold-rgb), 0.3);
  margin-bottom: 1rem;
  display: block;
}

.no-results h4 {
  color: #fff;
  margin-bottom: 1rem;
}

.no-results p {
  max-width: 500px;
  margin: 0 auto;
}

/* =============================================
   LIGHT THEME ADJUSTMENTS
   ============================================= */
body.light-theme #testimonials {
  background-color: #f8f9fa;
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.95)),
                    url('../img/patterns/spice-pattern-light.png');
}

body.light-theme #testimonials .section-title {
  color: #333;
}

body.light-theme #testimonials .section-subtitle {
  color: #666;
}

body.light-theme .testimonial-card {
  background-color: #fff;
  border-color: #eee;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.light-theme .testimonial-text {
  color: #555;
}

body.light-theme .testimonial-name {
  color: #333;
}

body.light-theme .testimonial-country {
  color: #777;
}

body.light-theme .testimonial-footer {
  border-top-color: rgba(0, 0, 0, 0.05);
}

body.light-theme #testimonialsCarousel .carousel-indicators button {
  background-color: rgba(0, 0, 0, 0.2);
}

body.light-theme .page-link {
  background-color: #fff;
  border-color: #eee;
  color: #333;
}

body.light-theme .page-item.active .page-link {
  background-color: var(--accent-gold);
  color: #111;
}

body.light-theme .search-container .input-group {
  border-color: #eee;
}

body.light-theme .search-container .form-control,
body.light-theme .search-container .input-group-text {
  background-color: #fff;
  color: #333;
}

body.light-theme .search-container .form-control::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

/* =============================================
   DARK THEME ADJUSTMENTS
   ============================================= */
body.dark-theme .page-link {
  background-color: var(--card-bg-color);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f0f0f0;
}

body.dark-theme .page-item.active .page-link {
  background-color: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #111;
}

body.dark-theme .search-container .input-group {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.dark-theme .search-container .form-control {
  background-color: var(--card-bg-color);
  color: #f0f0f0;
}

body.dark-theme .search-container .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */
@media (max-width: 1199.98px) {
  #testimonials {
    padding: 80px 0 60px;
  }
  
  .testimonial-card {
    margin: 12px 8px;
  }
  
  .carousel-control-prev.testimonial-control {
    left: -15px;
  }
  
  .carousel-control-next.testimonial-control {
    right: -15px;
  }
  
  .control-icon {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 991.98px) {
  #testimonials {
    padding: 60px 0 40px;
  }
  
  .testimonial-card .card-body {
    padding: 1.2rem;
  }
  
  .testimonial-text {
    font-size: 0.95rem;
    -webkit-line-clamp: 3;
  }
  
  .testimonial-filter {
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    margin: 0.25rem;
  }
  
  .search-container {
    max-width: 550px;
  }
}

@media (max-width: 767.98px) {
  #testimonials {
    padding: 60px 0 40px;
  }
  
  #testimonials .section-title {
    font-size: 1.8rem;
  }
  
  #testimonials .section-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  
  .testimonial-card {
    margin-bottom: 15px;
  }
  
  .testimonial-control {
    opacity: 1;
  }
  
  .testimonial-text {
    -webkit-line-clamp: 3;
    font-size: 0.9rem;
  }
  
  .testimonial-filters {
    gap: 6px;
    margin-bottom: 2rem;
  }
  
  .testimonial-filter {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .search-container .form-control {
    padding: 12px 15px;
  }
  
  .testimonial-name {
    font-size: 1rem;
  }
  
  .page-item .page-link {
    min-width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }
  
  .pagination {
    gap: 3px;
  }
}

@media (max-width: 575.98px) {
  #testimonials {
    padding: 50px 0 30px;
  }
  
  .testimonial-card {
    margin: 10px 5px;
  }
  
  .testimonial-card .card-body {
    padding: 1rem;
  }
  
  .testimonial-text {
    -webkit-line-clamp: 2;
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  
  .testimonial-rating i {
    font-size: 0.85rem;
  }
  
  .control-icon {
    width: 35px;
    height: 35px;
  }
  
  .pagination-container {
    margin: 30px 0 10px;
  }
  
  .filtered-count .badge {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
  
  .pagination {
    gap: 5px;
  }
  
  .page-item .page-link {
    min-width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

/* =============================================
   PRINT STYLES
   ============================================= */
@media print {
  #testimonials {
    background-color: #fff !important;
    color: #000 !important;
    padding: 20px 0 !important;
    background-image: none !important;
  }
  
  .testimonial-card {
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  
  .testimonial-text, 
  .testimonial-name, 
  .testimonial-country {
    color: #000 !important;
  }
  
  .testimonial-rating i {
    color: #ffc107 !important;
  }
  
  .search-container,
  .testimonial-filters,
  .pagination-container {
    display: none !important;
  }
}