/* TVB Testimonial Widget Styles */
.tvb-testimonials-wrapper {
    width: 100%;
    position: relative;
}

/* Carousel Styles */
.tvb-testimonials-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    opacity: 1; /* Visible by default */
    transition: opacity 0.3s ease;
}

/* Hide during loading only on frontend */
body:not(.elementor-editor-active) .tvb-testimonials-carousel:not(.carousel-ready) {
    opacity: 0;
}

/* Show carousel when initialized */
.tvb-testimonials-carousel.carousel-ready {
    opacity: 1;
}

.tvb-testimonials-carousel .swiper-wrapper {
    display: flex;
    align-items: stretch;
    transition-timing-function: ease-in-out;
}

/* Défilement continu CSS - Activé par défaut */
.tvb-testimonials-carousel.continuous-scroll {
    overflow: hidden;
}

.tvb-testimonials-carousel.continuous-scroll .swiper-wrapper {
    width: calc(200% + 40px); /* Double width for seamless loop */
}

/* Only start animation when ready */
.tvb-testimonials-carousel.continuous-scroll.carousel-ready .swiper-wrapper {
    animation: continuousScroll var(--scroll-duration, 15s) linear infinite;
}

.tvb-testimonials-carousel.continuous-scroll .swiper-slide {
    flex-shrink: 0;
    width: var(--card-width, 320px); /* Dynamic width based on setting */
    margin-right: var(--card-margin, 40px); /* Dynamic margin based on setting */
}

/* Pause animation on hover - only when pause-on-hover is enabled */
.tvb-testimonials-carousel.continuous-scroll.pause-on-hover:hover .swiper-wrapper {
    animation-play-state: paused;
}

@keyframes continuousScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* Move by half the width to create seamless loop */
    }
}

.tvb-testimonials-carousel .swiper-slide {
    height: auto;
    display: flex;
    flex-shrink: 0;
    box-sizing: border-box;
    min-width: 0;
    flex-basis: auto;
}

/* Let Swiper handle width calculations naturally - no forced widths needed */

/* Testimonial Card */
.tvb-testimonial-card {
    background: transparent;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%; /* S'adapte à la largeur du slide */
    overflow: hidden;
    box-sizing: border-box;
}

.tvb-testimonial-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Content Section */
.tvb-testimonial-content-section {
    flex: 1;
    background: #FF6B354D;
    padding: 20px;
}

/* Footer Section */
.tvb-testimonial-footer-section {
    background: #000000;
    padding: 20px;
    display: flex;
    align-items: center;
}

/* Rating */
.tvb-testimonial-rating {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* Star spacing is now controlled by Elementor star_spacing parameter */

.tvb-testimonial-rating .filled {
    color: #FFD700;
}

.tvb-testimonial-rating .empty {
    color: #e0e0e0;
}

/* Title */
.tvb-testimonial-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

/* Content */
.tvb-testimonial-content {
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff;
    margin-bottom: 20px;
}

/* Author Image */
.tvb-testimonial-author-image {
    width: 60px;
    height: 60px;
    min-width: 60px;
    margin-right: 15px;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tvb-testimonial-author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.tvb-testimonial-author-image i {
    font-size: 30px;
    color: #cccccc;
}

/* Author Info */
.tvb-testimonial-author-info {
    flex: 1;
}

.tvb-testimonial-author-name {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 5px 0;
    line-height: 1.2;
}

.tvb-testimonial-author-company {
    font-size: 12px;
    color: #ffffff;
    margin: 0;
    line-height: 1.4;
    opacity: 0.8;
    font-weight: 400;
}


/* Navigation */
.tvb-testimonials-carousel .swiper-button-prev,
.tvb-testimonials-carousel .swiper-button-next {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    color: #333;
    transition: all 0.3s ease;
}

.tvb-testimonials-carousel .swiper-button-prev:hover,
.tvb-testimonials-carousel .swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.2);
}

.tvb-testimonials-carousel .swiper-button-prev:after,
.tvb-testimonials-carousel .swiper-button-next:after {
    font-size: 16px;
}

/* Pagination */
.tvb-testimonials-carousel .swiper-pagination {
    position: relative;
    margin-top: 20px;
}

.tvb-testimonials-carousel .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #cccccc;
    opacity: 1;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.tvb-testimonials-carousel .swiper-pagination-bullet-active {
    background: #333333;
    width: 20px;
}

/* Responsive */
@media (max-width: 767px) {
    .tvb-testimonial-content-section {
        padding: 20px;
    }
    
    .tvb-testimonial-footer-section {
        padding: 15px 20px;
    }

    .tvb-testimonial-title {
        font-size: 18px;
    }

    .tvb-testimonial-content {
        font-size: 14px;
    }

    .tvb-testimonial-author-image {
        width: 50px;
        height: 50px;
        min-width: 50px;
    }

    .tvb-testimonial-author-name {
        font-size: 16px;
    }

    .tvb-testimonial-author-company {
        font-size: 13px;
    }

    .tvb-testimonials-carousel .swiper-button-prev,
    .tvb-testimonials-carousel .swiper-button-next {
        width: 35px;
        height: 35px;
    }
}

/* RTL Support */
.rtl .tvb-testimonial-rating i:not(:last-child),
.rtl .tvb-testimonial-rating svg:not(:last-child),
.rtl .tvb-testimonial-rating span:not(:last-child) {
    margin-right: 0;
    /* margin-left now controlled by Elementor star_spacing parameter for RTL */
}

.rtl .tvb-testimonial-author-image {
    margin-right: 0;
    margin-left: 15px;
}