/* Testimonial Carousel Section */
.testimonial-carousel-section {
    padding: 6rem 0;
    background: #ffffff;
    overflow: hidden;
}

.testimonial-carousel-section .section-header {
    text-align: center;
    margin-bottom: 60px;
}

.testimonial-carousel-section .section-header h2 {
    font-family: 'Nunito', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.testimonial-carousel-section .section-header p {
    font-family: 'Merriweather', Arial, serif;
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Carousel Wrapper */
.carousel-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    /* Ensure hidden overflow for transform-based sliding */
}

/* Carousel Track */
.carousel-track {
    display: flex;
    gap: 16px;
    will-change: transform;
    animation: scroll-left 40s linear infinite;
}

/* Pause animation on hover */
.carousel-track:hover {
    animation-play-state: paused;
}

/* Carousel Card */
.carousel-card {
    flex-shrink: 0;
    width: 360px;
    height: 725px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    background: white;
    box-shadow: 0 10px 30px rgba(255, 127, 127, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(255, 127, 127, 0.12);
}

/* Video Card */
.video-card {
    cursor: pointer;
}

.carousel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Text Card */
.text-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem;
    position: relative;
    background: #ffbebe;
}

.card-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffdbdb;
    opacity: 1;
}

.card-avatar {
    position: relative;
    width: 270px;
    height: 270px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
    margin: 0 auto 1.5rem auto; /* Center horizontally */
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0; /* Prevent shrinking */
}

.card-quote {
    font-family: 'Merriweather', Arial, serif;
    font-size: 0.99rem;
    font-style: normal;
    line-height: 1.6;
    color: #594747;
    text-align: justify;
    text-align-last: left;
    hyphens: auto;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
}

/* Gradient Overlay */
.card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Card Name */
.card-name {
    font-family: 'Nunito', Arial, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.video-card .card-name {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.text-card .card-name {
    color: #c39f9f;
    text-shadow: none;
    font-weight: 700;
}

/* Scroll Animation */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        /* Move exactly 7 cards for seamless loop */
        transform: translateX(calc(-1 * (360px + 16px) * 7));
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .testimonial-carousel-section {
        padding: 60px 0;
    }

    .testimonial-carousel-section .section-header h2 {
        font-size: 2rem;
    }

    .testimonial-carousel-section .section-header p {
        font-size: 1rem;
        padding: 0 20px;
    }

    .carousel-wrapper {
        overflow: hidden;
        /* Transform-based sliding, no scroll */
    }

    .carousel-track {
        animation: none;
        gap: 0;
        /* Will be styled by JS for transform sliding */
    }

    .carousel-card {
        width: 100%;
        height: 620px;
        margin: 0 4vw;
        /* Width and flex set dynamically by JS */
    }

    .card-avatar {
        width: 60vw;
        max-width: 270px;
        height: 60vw;
        max-height: 270px;
        margin: 0 auto 1.5rem auto;
    }

    .card-quote {
        font-size: 15px;
    }

    .card-name {
        font-size: 0.9rem;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .carousel-card {
        width: 320px;
        height: 570px;
    }

    @keyframes scroll-left {
        0% {
            transform: translateX(0);
        }
        100% {
            /* Move exactly 7 cards for seamless loop */
            transform: translateX(calc(-1 * (320px + 16px) * 7));
        }
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        animation: none;
    }
}
