.testimonial_container {
    background: url('../images/testimonial.png');
    background: image-set(url(../images/testimonial.webp) type("image/webp"), url(../images/testimonial.png) type("image/png"));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    min-height: 700px;
    overflow-x: hidden;
    /* Prevent avatars from causing horizontal scroll */
}


.testimonial_main_wrapper {
    position: relative;
    width: 100%;
    margin-top: 20px;
    height: 600px;
}

.bg-deco {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.spring-line {
    top: 15%;
    left: 22%;
    width: 70px;
    opacity: 0.8;
    stroke: #206598;
    fill: none;
    stroke-width: 2;
    transform: rotate(-10deg);
}

.topo-lines {
    bottom: -50px;
    left: -50px;
    width: 350px;
    opacity: 0.1;
    transform: rotate(-10deg);
}

.testimonial_card_wrapper {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    width: 380px;
    height: 420px;
    z-index: 2;
}

.testimonial_card_bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 40px;
    transform: rotate(-6deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

.testimonial_card_main {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #206598;
    border-radius: 40px;
    transform: rotate(6deg);
    z-index: 2;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(32, 101, 152, 0.4);
}

.testimonial_content_box {
    margin-top: 60px;
    transition: opacity 0.4s ease;
    opacity: 1;
}

.testimonial_content_box.hidden {
    opacity: 0;
}

.name {
    font-size: 1.6rem;
    font-weight: 700;
    /* margin-bottom: 5px; */
}

.quote-mark {
    font-size: 3rem;
    font-family: Georgia, serif;
    opacity: 0.3;
    height: 35px;
    display: block;
    margin-bottom: 12px;
}

.review-text {
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.6;
    opacity: 0.95;
}

/* --- Avatars --- */
.avatar {
    position: absolute;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 5;
    cursor: pointer;
}


.pos-0 {
    left: 50%;
    top: 22%;
    transform: translate(-50%, -50%) scale(1.6);
    z-index: 10;
    border-color: white;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.pos-1 {
    left: 7%;
    top: 20%;
}

/* Top Left */
.pos-2 {
    left: 20%;
    top: 40%;
    width: 55px;
    height: 55px;
}

.pos-3 {
    left: 10%;
    top: 60%;
    border-color: #fff8e1;
}


.pos-4 {
    left: 83%;
    top: 9%;
    border-color: #dcedc8;
}

.pos-5 {
    left: 75%;
    top: 30%;
    border-color: #ffe0b2;
}

.pos-6 {
    left: 87%;
    top: 33%;
    border-color: #ffcdd2;
}

.pos-7 {
    left: 79%;
    top: 62%;
}



@media (max-width: 1199px) {
    .testimonial_main_wrapper {
        height: 550px;
    }
}

@media (max-width: 991px) {
    .testimonial_container {
        min-height: 600px;
    }

    .testimonial_main_wrapper {
        height: 500px;
    }

    .testimonial_card_wrapper {
        width: 340px;
        height: 380px;
    }

    .pos-1 {
        left: 5%;
    }

    .pos-4 {
        left: 88%;
    }

    .pos-6 {
        left: 90%;
    }
}

@media (max-width: 768px) {
    .testimonial_container {
        min-height: 550px;
    }

    .testimonial_main_wrapper {
        height: 480px;
    }

    .testimonial_card_wrapper {
        width: 300px;
        height: 360px;
        top: 45%;
    }

    .pos-0 {
        left: 50%;
        /* Reinforced horizontal center */
        top: 36%;
        /* Moved for proximity and centering */
        transform: translate(-50%, -50%) scale(1.4);
    }

    .name {
        font-size: 1.4rem;
    }

    .review-text {
        font-size: 0.89rem;
        font-weight: 500;
    }

    .pos-1,
    .pos-2,
    .pos-3,
    .pos-4,
    .pos-5,
    .pos-6,
    .pos-7 {
        transform: scale(0.7);
    }

    .testimonial_content_box {
        margin-top: 35px;
        /* Tighter proximity to image */
    }
}

@media (max-width: 575px) {
    .testimonial_container {
        min-height: 500px;
    }

    .testimonial_main_wrapper {
        height: 440px;
        margin-top: 10px;
    }

    .testimonial_card_wrapper {
        width: 260px;
        height: 320px;
        top: 50%;
    }

    .avatar {
        width: 48px;
        height: 48px;
    }

    .pos-0 {
        left: 50%;
        top: 34%;
        /* Perfectly centered vertically in the card */
        transform: translate(-50%, -50%) scale(1.3);
    }

    /* Polished Scattered positions */
    .pos-1 {
        left: 3%;
        top: 15%;
    }

    .pos-2 {
        left: 10%;
        top: 40%;
    }

    .pos-3 {
        left: 5%;
        top: 70%;
    }

    .pos-4 {
        left: 85%;
        top: 12%;
    }

    .pos-5 {
        left: 78%;
        top: 35%;
    }

    .pos-6 {
        left: 87%;
        top: 55%;
    }

    .pos-7 {
        left: 78%;
        top: 80%;
    }

    .name {
        font-size: 1.2rem;
    }

    .quote-mark {
        font-size: 1.8rem;
        height: 25px;
    }

    .testimonial_content_box {
        margin-top: 30px;
    }

    .review-text {
        font-size: 0.89rem;
        line-height: 1.4;
        font-weight: 500;
    }
}

@media (max-width: 400px) {
    .testimonial_card_wrapper {
        width: 230px;
        height: 300px;
    }



    .avatar {
        width: 42px;
        height: 42px;
    }

    .testimonial_content_box {
        margin-top: 25px;
    }
}