/* Testimonials Refined Masonry - Exactly matching design structure */

.testimonials-section {
    background-color: var(--color-cream);
    padding: var(--space-xl) 0;
}

.testimonials-masonry-v2 {
    display: flex;
    gap: 2rem;
    width: 100%;
    align-items: flex-start;
}

.testimonial-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem; /* Ensure gap between cards in column */
}

@media (max-width: 992px) {
    .testimonials-masonry-v2 {
        flex-wrap: wrap;
    }
    .testimonial-column {
        flex: 0 0 calc(50% - 1rem);
    }
}

@media (max-width: 768px) {
    .testimonials-masonry-v2 {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1.5rem;
        padding: 1rem 1rem 3rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

    .testimonials-masonry-v2::-webkit-scrollbar {
        display: none; /* Chrome, Safari, etc */
    }

    .testimonial-column {
        display: contents; /* Makes cards direct children of the slider */
    }

    .testimonial-card {
        flex: 0 0 85vw;
        max-width: 85vw;
        scroll-snap-align: center;
        margin-bottom: 0 !important;
        height: auto;
    }
}

/* Base Card Style */
.testimonial-card {
    break-inside: avoid;
    margin-bottom: 3rem;
    /* Extra space for floating elements */
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Quote Icons */
.quote-icon {
    font-size: 2rem;
    line-height: 1;
    color: var(--color-forest);
    opacity: 0.8;
}

.quote-top-left {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
}

.quote-bottom-right {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
}

/* Content Elements */
.testi-title {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--color-forest);
    margin-bottom: 1rem;
    display: block;
}

.testi-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1.5rem;
}

.testi-stars {
    color: #FFD700;
    /* Standard gold star */
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.testi-signature {
    font-family: 'Dancing Script', cursive;
    /* Assuming standard fallback or user has it */
    font-size: 1.2rem;
    color: var(--color-forest);
    margin-top: 1rem;
    display: block;
}

/* Layout Specifics */

/* Layout 1: Small image top-right, quotes top-left */
.layout-1 .testimonial-avatar {
    position: absolute;
    top: -20px;
    right: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.layout-1 .testi-header {
    margin-top: 1rem;
}

/* Layout 2: Floating avatar top-center, centered text */
.layout-2 {
    text-align: center;
    padding-top: 3.5rem;
}

.layout-2 .testimonial-avatar {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Layout 3: Side-by-side (Vertical Image) */
.layout-3 {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.layout-3 .testi-img-wrapper {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.layout-3 .testi-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layout-3 .testi-body {
    padding: 2rem;
}

/* Layout 4: Header Image */
.layout-4 {
    text-align: center;
    padding-top: 0;
    overflow: hidden;
}

.layout-4 .testi-top-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.layout-4 .testi-body {
    padding: 2.5rem;
    position: relative;
}

.layout-4 .testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-top: -30px;
    border: 3px solid #fff;
    position: relative;
    z-index: 2;
}

/* Layout 5: Speech Bubble */
.layout-5 {
    padding-bottom: 2rem;
    margin-bottom: 4rem;
}

.layout-5::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 40px;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid #fff;
}

.layout-5 .testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

/* Layout 6: Image Right, Text Left */
.layout-6 {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.layout-6 .testi-body {
    flex: 1;
}

.layout-6 .testimonial-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

/* Layout 7: Centered Large */
.layout-7 {
    text-align: center;
}

.layout-7 .testi-avatars-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.layout-7 .testi-avatars-row img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Meta Info */
.testi-meta {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.testi-meta span {
    display: block;
    color: var(--color-forest);
    font-weight: 700;
}

.testi-meta small {
    color: #888;
}

/* Icon Avatar Styles */
.icon-avatar {
    background: var(--color-gold);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
}

.testimonial-avatar.icon-avatar {
    background: var(--color-gold);
    color: #fff;
    border: none;
}

.layout-1 .icon-avatar,
.layout-2 .icon-avatar,
.layout-4 .icon-avatar,
.layout-6 .icon-avatar {
    font-size: 3rem;
}

.icon-placeholder {
    background: var(--color-gold);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.testi-avatars-row i {
    font-size: 2.5rem;
    color: var(--color-gold);
}

/* Ratings */
.fa-star {
    margin-right: 2px;
}

/* Dark Mode Overrides */
body.theme-night .testimonials-section {
    background-color: #121d17; /* Darker forest/black */
}

body.theme-night .testimonial-card {
    background: #1a2c21; /* Forest background */
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.theme-night .testimonial-card:hover {
    border-color: rgba(197, 160, 89, 0.3);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

body.theme-night .testi-title,
body.theme-night .testi-signature,
body.theme-night .testi-meta span {
    color: var(--color-gold);
}

body.theme-night .testi-content {
    color: var(--color-sage);
    opacity: 0.9;
}

body.theme-night .testi-meta small {
    color: rgba(206, 213, 194, 0.6); /* Sage with opacity */
}

body.theme-night .quote-icon {
    color: var(--color-gold);
    opacity: 0.2;
}

body.theme-night .layout-1 .testimonial-avatar,
body.theme-night .layout-2 .testimonial-avatar,
body.theme-night .layout-4 .testimonial-avatar,
body.theme-night .layout-7 .testi-avatars-row img {
    border-color: #1a2c21;
}

body.theme-night .layout-5::after {
    border-top-color: #1a2c21;
}

body.theme-night .testimonial-card:hover .quote-icon {
    opacity: 0.4;
}

/* Video Styles */
.video-container {
    position: relative;
    background: #000;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    transition: var(--transition-smooth);
    border: 2px solid rgba(255, 255, 255, 0.5);
    z-index: 3;
}

.video-container:hover .play-overlay {
    background: var(--color-gold);
    border-color: var(--color-gold);
    transform: translate(-50%, -50%) scale(1.1);
}

.testi-video {
    transition: opacity 0.3s ease;
}

.video-playing .play-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Testimonial Nav Buttons */
.testi-nav-wrapper {
    display: none; /* Hide on desktop */
}

@media (max-width: 768px) {
    .testi-nav-wrapper {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: -10px;
        margin-bottom: 20px;
        position: relative;
        z-index: 10;
    }

    .testi-nav-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--color-white);
        border: 1px solid var(--color-gold);
        color: var(--color-forest);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .testi-nav-btn:hover {
        background: var(--color-gold);
        color: white;
        transform: scale(1.1);
    }

    .testi-nav-btn i {
        font-size: 0.9rem;
    }
}
