.testimonials-container {
    width: 100%;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    background-color: #000000;
}

.testimonials-carousel {
    position: relative;
    width: 100%;
    height: var(--card-height, 280px);
    display: flex;
    align-items: center;
}

.testimonials-track {
    position: absolute;
    width: fit-content;
    height: 100%;
    display: flex;
    gap: 30px;
    flex-direction: row !important;
    padding: 0 15px;
    will-change: transform;
    animation: smoothTestimonialScroll 60s linear infinite !important;
}
@media (max-width: 600px) {
    .testimonials-track {
        position: absolute;
        width: fit-content;
        height: 100%;
        display: flex;
        gap: 30px;
        flex-direction: row !important;
        padding: 0 15px;
        will-change: transform;
        animation: smoothTestimonialScroll 60s linear infinite !important;
    }
}
@keyframes smoothTestimonialScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-33.333%); /* Move by 1/3 since we have 3 copies */
    }
}

.testimonial-card {
    flex: 0 0 var(--card-width, 380px);
    height: var(--card-height, 280px);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px 25px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.testimonial-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 100%); */
    border-radius: 20px;
    pointer-events: none;
}

.testimonial-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.testimonial-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.testimonial-card:hover .testimonial-avatar img {
    transform: scale(1.1);
}

.testimonial-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.testimonial-text {
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
    margin-bottom: 20px;
    font-family: 'Chakra Petch', sans-serif;
    opacity: 0.9;
    flex: 1;
    overflow: hidden;
    position: relative;
    max-height: 262px; /* Limite la hauteur pour détecter le débordement */
}

/* Container pour le texte scrollable */
.testimonial-text-scroll {
    transition: transform 0.3s ease;
    animation-fill-mode: forwards;
}

/* Animation de défilement pour le texte long */
@keyframes textScrollUp {
    0% {
        transform: translateY(0);
    }
    20% {
        transform: translateY(0);
    }
    80% {
        transform: translateY(calc(-100% + 140px));
    }
    100% {
        transform: translateY(calc(-100% + 140px));
    }
}

@keyframes textScrollDown {
    0% {
        transform: translateY(calc(-100% + 140px));
    }
    20% {
        transform: translateY(calc(-100% + 140px));
    }
    80% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(0);
    }
}

/* Classes pour contrôler l'animation */
.testimonial-text.scrolling-up .testimonial-text-scroll {
    animation: textScrollUp 8s ease-in-out forwards;
}

.testimonial-text.scrolling-down .testimonial-text-scroll {
    animation: textScrollDown 8s ease-in-out forwards;
}

/* Effet de fade gradient pour le texte scrollable */
.testimonial-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, transparent 0%, var(--card-bg, rgba(255, 255, 255, 0.05)) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.testimonial-text.has-overflow::after {
    opacity: 1;
}

/* Amélioration de l'animation pour plus de fluidité */
.testimonial-text-scroll {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pause de l'animation au hover */
.testimonial-card:hover .testimonial-text {
    animation-play-state: paused !important;
}

.testimonial-card:hover .testimonial-text-scroll {
    animation-play-state: paused !important;
}

.testimonial-author {
    margin-top: auto;
}

.testimonial-name {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 5px 0;
    font-family: 'Chakra Petch', sans-serif;
}

.testimonial-position {
    font-size: 14px;
    color: #cccccc;
    margin: 0 0 3px 0;
    font-family: 'Chakra Petch', sans-serif;
    opacity: 0.8;
}

.testimonial-company {
    font-size: 12px;
    color: #999999;
    margin: 0;
    font-family: 'Chakra Petch', sans-serif;
    opacity: 0.7;
    font-style: italic;
}

/* Pause animation on hover */
.testimonials-container[data-pause-hover="true"]:hover .testimonials-track {
    animation-play-state: paused;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .testimonials-container {
        --card-width: 350px;
    }
    
    .testimonials-track {
        gap: 25px;
    }
}

@media (max-width: 991px) {
    .testimonials-container {
        --card-width: 320px;
        --card-height: 300px;
        padding: 60px 0;
        position: relative;
        height: 100%;
        overflow: visible;
        top: 0;
        /* margin-bottom: 373rem; */
    }
    
    .testimonial-card {
        padding: 25px 20px;
    }
    
    .testimonials-track {
        gap: 20px;
    }
    
    .testimonial-text {
        font-size: 13px;
    }
    
    .testimonial-name {
        font-size: 16px;
    }
    
    .testimonial-position {
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .testimonials-container {
        --card-width: 280px;
        --card-height: 320px;
        padding: 40px 0;
    }
    .testimonial-text {
        max-height: 149px;
    }
    
    .testimonial-card {
        padding: 20px 15px;
    }
    
    .testimonials-track {
        gap: 15px;
        padding: 0 10px;
    }
    
    .testimonial-avatar {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
    }
    
    .testimonial-text {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .testimonial-name {
        font-size: 14px;
    }
    
    .testimonial-position {
        font-size: 12px;
    }
    
    .testimonial-company {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .testimonials-container {
        --card-width: 250px;
        --card-height: 340px;
    }

    .testimonials-carousel {
        --card-width: 83vw !important;
    }
    
    .testimonial-card {
        padding: 15px 12px;
    }
    
    .testimonials-track {
        gap: 12px;
    }
}

/* Animation variations for different speeds */
.testimonials-container[data-speed="30"] .testimonials-track {
    animation-duration: 30s;
}

.testimonials-container[data-speed="45"] .testimonials-track {
    animation-duration: 45s;
}

.testimonials-container[data-speed="60"] .testimonials-track {
    animation-duration: 60s;
}

.testimonials-container[data-speed="90"] .testimonials-track {
    animation-duration: 90s;
}

.testimonials-container[data-speed="120"] .testimonials-track {
    animation-duration: 120s;
}

/* Stop animation if autoplay is disabled */
.testimonials-container[data-autoplay="false"] .testimonials-track {
    animation-play-state: paused;
}