/* ===================================
   TESTIMONIALS AUTO-SCROLL CAROUSEL
   Cozy hover animations and smooth scrolling
   =================================== */

/* Wrapper to contain the scrolling carousel */
.elraed-landing-testimonials {
    --card-width: 350px;
    --card-gap: 30px;
}

@media (max-width: 768px) {
    .elraed-landing-testimonials {
        --card-width: 280px;
        --card-gap: 20px;
    }
}

.elraed-landing-testimonials .container {
    position: relative;
}

/* Carousel container with overflow hidden */
.elraed-landing-testimonials .testimonials-carousel-wrapper {
    overflow: hidden;
    width: 100%;
    direction: ltr; /* Ensure LTR layout for correct scrolling */
}

.elraed-landing-testimonials .testimonials-carousel {
    position: relative;
    padding: 40px 0;
    display: flex;
    gap: var(--card-gap);
    width: max-content;
    animation: scroll-left 30s linear infinite;
    direction: ltr; /* Force LTR for left-moving tape */
}

.elraed-landing-testimonials .testimonials-carousel .testimonial-item {
    flex: 0 0 auto;
    width: var(--card-width);
    margin-right: 0;
    direction: rtl; /* Keep content RTL for Arabic text */
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s ease,
                filter 0.3s ease;
    will-change: transform;
}

/* Cozy hover animation: subtle zoom and tilt */
.elraed-landing-testimonials .testimonials-carousel .testimonial-item:hover {
    transform: scale(1.05) rotate(-1deg) translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    z-index: 10;
    filter: brightness(1.05);
}
/* Pause animation on hover */
.elraed-landing-testimonials .testimonials-carousel:hover {
    animation-play-state: paused;
}

/* Keyframes for continuous left scrolling */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* If 3 or fewer testimonials, show static grid instead */
.elraed-landing-testimonials .testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 40px 0;
    direction: rtl;
}

.elraed-landing-testimonials .testimonials-grid .testimonial-item {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.4s ease;
}

.elraed-landing-testimonials .testimonials-grid .testimonial-item:hover {
    transform: scale(1.05) rotate(-1deg) translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* Testimonial item base styles */
.elraed-landing-testimonials .testimonial-item {
    background: linear-gradient(135deg, #1a1f3a 0%, #141829 100%);
    border: 1px solid rgba(47, 134, 255, 0.2);
    border-radius: 16px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.elraed-landing-testimonials .testimonial-item::before {
    content: '"';
    position: absolute;
    top: -9px;
    left: 10px;
    font-size: 95px;
    font-family: Georgia, serif;
    color: rgb(0, 106, 255);
    line-height: 1;
    opacity: 1;
}

.elraed-landing-testimonials .testimonial-content {
    font-size: 16px;
    line-height: 1.7;
    color: #e5e7eb;
    margin-bottom: 20px;
    min-height: 100px;
}

.elraed-landing-testimonials .testimonial-rating {
    color: #fbbf24;
    font-size: 18px;
    margin-bottom: 15px;
}

.elraed-landing-testimonials .testimonial-rating i {
    margin-left: 3px;
}

.elraed-landing-testimonials .testimonial-author {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(47, 134, 255, 0.2);
}

.elraed-landing-testimonials .author-name {
    font-size: 18px;
    font-weight: 700;
    color: #2f86ff;
    margin-bottom: 5px;
}

.elraed-landing-testimonials .author-position {
    font-size: 14px;
    color: #9ca3af;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Widths are handled by CSS variables now */
    
    .elraed-landing-testimonials .testimonials-carousel .testimonial-item:hover {
        transform: scale(1.03) rotate(-0.5deg) translateY(-5px);
    }
    
    .elraed-landing-testimonials .testimonials-grid {
        grid-template-columns: 1fr;
    }
}
