/* Testimonials Slider Fix */

/* Ensure proper slider container */
.testimonials-slider {
    position: relative;
    padding: 20px 0 60px;
    overflow: hidden;
}

.testimonials-swiper {
    width: 100%;
    padding-bottom: 50px;
    overflow: visible;
}

.testimonials-swiper .swiper-wrapper {
    align-items: stretch;
}

.testimonials-swiper .swiper-slide {
    height: auto;
    display: flex;
}

/* Fix testimonial card heights */
.testimonial-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

/* Enhanced pagination styling */
.testimonials-pagination {
    position: relative !important;
    bottom: 0 !important;
    margin-top: 30px;
    text-align: center;
}

.testimonials-pagination .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 128, 0.3);
    opacity: 1;
    margin: 0 6px !important;
    transition: all 0.3s ease;
}

.testimonials-pagination .swiper-pagination-bullet-active {
    background: #000080;
    transform: scale(1.3);
}

/* Navigation buttons styling */
.testimonials-button-next,
.testimonials-button-prev {
    color: #000080 !important;
    background-color: white !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid rgba(0, 0, 128, 0.1) !important;
    transition: all 0.3s ease !important;
}

.testimonials-button-next:after,
.testimonials-button-prev:after {
    font-size: 16px !important;
    font-weight: bold !important;
}

.testimonials-button-next:hover,
.testimonials-button-prev:hover {
    background-color: #000080 !important;
    color: white !important;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 128, 0.3) !important;
}

/* Position navigation buttons */
.testimonials-button-next {
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.testimonials-button-prev {
    left: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

/* Read more functionality */
.testimonial-text.expanded {
    display: block !important;
    -webkit-line-clamp: unset !important;
    max-height: none !important;
    overflow: visible !important;
}

.testimonial-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 120px;
}

.read-more-btn {
    background: none;
    border: none;
    color: #000080;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 0;
    margin-bottom: 15px;
    font-size: 14px;
    text-decoration: underline;
    align-self: flex-start;
    transition: color 0.3s ease;
}

.read-more-btn:hover {
    color: #1e40af;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .testimonials-button-next,
    .testimonials-button-prev {
        display: none !important;
    }
    
    .testimonials-slider {
        padding: 15px 0 35px;
        margin: 0 -10px;
    }
    
    .testimonials-swiper {
        padding-bottom: 35px;
        overflow: hidden;
    }
    
    .testimonials-swiper .swiper-slide {
        padding: 0 10px;
    }
    
    .testimonials-pagination {
        margin-top: 15px;
    }
    
    .testimonial-card {
        min-height: 280px;
        margin: 0;
    }
    
    .testimonials-section {
        padding: 60px 0;
    }
    
    .testimonials-container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .testimonials-pagination .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 3px !important;
    }
    
    .testimonial-card {
        min-height: 260px;
        padding: 18px;
    }
    
    .testimonials-slider {
        margin: 0 -5px;
    }
    
    .testimonials-swiper .swiper-slide {
        padding: 0 5px;
    }
    
    .testimonials-section {
        padding: 50px 0;
    }
}

/* Ensure smooth transitions */
.swiper-slide-active .testimonial-card {
    transform: scale(1);
}

.swiper-slide .testimonial-card {
    transition: transform 0.3s ease;
}

/* Fix for autoplay pause on hover */
.testimonials-swiper:hover {
    cursor: grab;
}

.testimonials-swiper:active {
    cursor: grabbing;
}

/* Mobile touch improvements */
@media (max-width: 768px) {
    .testimonials-swiper {
        touch-action: pan-y pinch-zoom;
    }
    
    .swiper-wrapper {
        transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .testimonial-card {
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}