/* Testimonials Carousel Animation - Dynamically set via JavaScript */
.testimonials-track {
    will-change: transform;
    display: flex;
    /* Width set by JS */
    gap: 2rem;
    padding: 20px 0;
    /* Add padding to track to avoid cutting off shadows */
    /* Aggressive Stabilization */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

.testimonials-track:hover {
    animation-play-state: paused;
}

.testimonials-carousel-wrapper {
    padding: 40px 0 20px 0;
    /* Ensure no overflow issues */
    overflow: hidden;
    /* Create new stacking context and layer */
    position: relative;
    z-index: 1;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    contain: paint layout;
    /* Browser optimization hint */
}

/* Testimonial card styles */
.testimonial-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        border-color 0.3s ease;
    cursor: pointer;
    background: var(--glass);
    /* Dark glassmorphism */
    border: 1px solid var(--glass);
    border-radius: 20px;
    min-width: 350px;
    /* Reduced width */
    max-width: 350px;
    /* Fixed height for uniformity - exact as requested */
    height: 300px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

    /* Flex layout to structure internals */
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    /* Hardware acceleration */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    image-rendering: -webkit-optimize-contrast;
    /* Crisp rendering */
}

/* Card Content Area */
.testimonial-card .card-content {
    padding: 40px 30px 20px 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent text spilling out */
}

/* Profile wrapper stabilization */
.testimonial-card .profile-wrapper,
.testimonial-card .profile-inner {
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    /* Ensure border rendering is crisp */
    box-sizing: border-box;
}

.testimonial-card:hover {
    transform: translateY(-10px) translate3d(0, 0, 1px);
    /* Slight Z-lift */
    box-shadow: 0 15px 40px rgba(252, 196, 25, 0.15) !important;
    border: 1px solid var(--accent-gold);
    background: var(--glass);
    z-index: 10;
}

.testimonial-card h3.client-name {
    color: var(--accent-gold);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.testimonial-card p.client-role {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    margin: 4px 0 15px 0;
}

.testimonial-card hr.testimonial-divider {
    background-color: var(--glass-border);
    height: 1px;
    border: none;
    margin-bottom: 15px;
    width: 100%;
}

.testimonial-card p.testimonial-text {
    color: var(--text-white);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* --- EXPLICIT LIGHT THEME OVERRIDES FOR TESTIMONIALS --- */
:root.light-theme .testimonial-card p.testimonial-text {
    color: #0f172a !important;
    /* Forces dark slate color for passage */
}

:root.light-theme .testimonial-card p.client-role {
    color: #475569 !important;
    /* Forces dark grey for occupation/role */
}


/* Bottom Section (Rating + Quote Icon) */
.testimonial-card .card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding: 0 0 0 0;
}

/* Update root var for card background if used elsewhere,
   though we override it in .testimonial-card */
:root {
    --card-white: rgba(255, 255, 255, 0.05);
}