/* styles/testimonials.css */

/* ========================
   Variables (Modern, Clean Theme - Consistent)
======================== */
:root {
    --color-bg: #fdfdfd; /* Clean, soft white background */
    --color-primary: #3b82f6; /* Professional Blue */
    --color-secondary: #1d4ed8; /* Darker Blue for gradient depth */
    --color-accent: #60a5fa; /* Lighter Blue for highlights */
    --color-text: #1f2937; /* Dark Gray Text */
    --color-subtext: #4b5563; /* Medium Gray Subtext */
    --color-card-bg: #ffffff; /* Pure white cards */
    --color-border-light: #e5e7eb; /* Light border for separation */
    --color-light-bg: #eff6ff; /* Very light blue background for subtle elements */

    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;

    --border-radius-main: 0.75rem;

    --shadow-subtle: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-button: 0 8px 20px rgba(59, 130, 246, 0.3);
    --shadow-button-hover: 0 12px 30px rgba(59, 130, 246, 0.45);

    --transition-duration: 0.5s;
    --transition-easing: ease-in-out;
}

/* Base Styles */
.testimonials-section {
    position: relative;
    padding: 7rem 1rem;
    background-color: var(--color-bg);
    overflow: hidden;
    font-family: var(--font-body);
    color: var(--color-text);
}

/* Subtle Background Texture */
.testimonials-bg-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.testimonials-container {
    position: relative;
    z-index: 1;
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    min-height: 60vh; /* Shorter section height */
}

/* Section Header - Consistent */
.testimonials-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 3rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.testimonials-header .section-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    display: inline-block;
}
.testimonials-header .section-subtitle::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--color-accent);
    border-radius: 2px;
}

.testimonials-header .section-title {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 5.8vw, 4.2rem);
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.2;
}

.testimonials-header .section-description {
    font-size: 1.2rem;
    color: var(--color-subtext);
    line-height: 1.7;
    max-width: 750px;
    margin: 0.8rem auto 0 auto;
}

/* Testimonial Carousel */
.testimonial-carousel-wrapper {
    position: relative;
    margin: 0 auto;
    max-width: 1100px; /* Max width for the carousel area */
}

.testimonial-carousel {
    display: flex;
    overflow: hidden; /* Hide overflowing cards */
    scroll-behavior: smooth; /* Smooth scrolling for navigation */
    -webkit-overflow-scrolling: touch; /* Better scrolling on iOS */
    gap: 1.5rem; /* Gap between testimonial cards */
    padding: 1rem 0; /* Padding for potential card shadows/focus outlines */
    justify-content: flex-start; /* Align items to start */
}

/* Hide scrollbar for cleaner look */
.testimonial-carousel::-webkit-scrollbar {
    display: none;
}
.testimonial-carousel {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.testimonial-card {
    flex: 0 0 auto; /* Prevent cards from shrinking */
    width: calc(100% / 3 - 1rem); /* Default: 3 cards per row */
    min-width: 300px; /* Minimum width for card content */
    background-color: var(--color-card-bg);
    border-radius: var(--border-radius-main);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-subtle);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transition: transform var(--transition-duration) var(--transition-easing),
                box-shadow var(--transition-duration) var(--transition-easing),
                border-color var(--transition-duration) var(--transition-easing);
    cursor: grab; /* Indicate draggable */
    position: relative;
}

.testimonial-card:active {
    cursor: grabbing; /* Indicate grabbing */
}

.testimonial-card:hover,
.testimonial-card:focus-within {
    transform: translateY(-5px); /* Subtle lift on hover */
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
    outline: none;
}

/* Animated quotes icon in background */
.testimonial-card::before {
    content: "\201C"; /* Left double quotation mark */
    font-family: serif;
    font-size: 8rem;
    color: rgba(var(--color-primary-rgb, 59, 130, 246), 0.08); /* Very light blue */
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}
.testimonial-card .quote-icon {
    position: relative;
    z-index: 2; /* Ensure quote icon is above pseudo-element */
    font-size: 2rem;
    color: var(--color-accent);
}

.testimonial-text {
    font-size: 1.1rem;
    color: var(--color-text);
    line-height: 1.7;
    font-style: italic;
    flex-grow: 1; /* Pushes client info to bottom */
    position: relative;
    z-index: 2;
}

.client-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    position: relative;
    z-index: 2;
}

.client-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.client-name {
    display: block;
    font-size: 1.1rem;
    color: var(--color-primary);
    font-weight: 700;
}

.client-role {
    display: block;
    font-size: 0.9rem;
    color: var(--color-subtext);
}

.star-rating {
    color: #ffc107; /* Gold star color */
    font-size: 0.9rem;
    margin-top: 0.3rem;
}
.star-rating i {
    margin-right: 0.1rem;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(var(--color-primary-rgb, 59, 130, 246), 0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-button);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 10;
}
.carousel-nav:hover {
    background-color: var(--color-secondary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-button-hover);
}
.carousel-nav.prev {
    left: -2rem;
}
.carousel-nav.next {
    right: -2rem;
}
@media (max-width: 1200px) { /* Adjust nav position for smaller desktops */
    .carousel-nav.prev { left: 0.5rem; }
    .carousel-nav.next { right: 0.5rem; }
}


.carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    background-color: var(--color-border-light);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.carousel-dot.active {
    background-color: var(--color-primary);
    transform: scale(1.2);
}
.carousel-dot:hover {
    background-color: var(--color-accent);
}

/* Client Logos Strip */
.client-logos-strip {
    margin-top: 4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.logos-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
}

.logos-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2.5rem 3rem; /* Row and column gap */
}

.logos-grid img {
    max-width: 120px;
    height: auto;
    filter: grayscale(100%); /* Grayscale by default */
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.2s ease;
}

.logos-grid img:hover {
    filter: grayscale(0%); /* Color on hover */
    opacity: 1;
    transform: scale(1.05);
}

/* Final Call to Action - Consistent */
.final-cta {
    margin-top: 5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.cta-text {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--color-text);
    max-width: 800px;
    line-height: 1.6;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #fff;
    border: none;
    padding: 1.1rem 2.8rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: var(--shadow-button);
    transition: transform var(--transition-duration) var(--transition-easing),
                box-shadow var(--transition-duration) var(--transition-easing);
    will-change: transform, box-shadow;
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-button-hover);
    outline: none;
}
.btn-primary i {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}
.btn-primary:hover i {
    transform: translateX(5px);
}

/* Animations (Reveal on Scroll) - Consistent */
.reveal-from-bottom,
.reveal-from-right {
    opacity: 0;
    transition: opacity var(--transition-duration) var(--transition-easing),
                transform var(--transition-duration) var(--transition-easing);
    will-change: opacity, transform;
}

.reveal-from-bottom {
    transform: translateY(70px);
}

.reveal-from-right {
    transform: translateX(70px);
}

.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .testimonials-bg-texture {
        animation: none !important;
        background-image: none !important;
    }
    .reveal-from-bottom,
    .reveal-from-right,
    .testimonial-card,
    .testimonial-carousel-wrapper .carousel-nav,
    .client-logos-strip img,
    .btn-primary {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
        animation: none !important;
        box-shadow: none !important;
        filter: none !important;
    }
    .carousel-nav.prev { left: 0.5rem; } /* Ensure nav buttons are visible */
    .carousel-nav.next { right: 0.5rem; }
    .testimonial-carousel { scroll-behavior: auto !important; }
    .btn-primary {
        background: var(--color-primary); /* Solid background */
    }
}

/* Media Queries */
@media (min-width: 1024px) {
    .testimonial-card {
        width: calc(100% / 3 - 1rem); /* 3 cards on larger desktops */
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .testimonial-card {
        width: calc(100% / 2 - 0.75rem); /* 2 cards on tablets */
        min-width: 320px;
    }
    .testimonial-carousel {
        gap: 1.5rem;
    }
    .carousel-nav.prev { left: 0.5rem; }
    .carousel-nav.next { right: 0.5rem; }
}

@media (max-width: 767px) {
    .testimonials-section {
        padding: 5rem 1rem;
    }
    .testimonials-container {
        gap: 3rem;
    }
    .testimonials-header .section-title {
        font-size: clamp(2.2rem, 8vw, 2.8rem);
    }
    .testimonials-header .section-description {
        font-size: 0.95rem;
    }
    .testimonial-carousel-wrapper {
        margin: 0 auto;
    }
    .testimonial-carousel {
        gap: 1rem;
        padding: 0.5rem 0;
    }
    .testimonial-card {
        width: 100%; /* 1 card on mobile */
        min-width: 280px;
        padding: 1.5rem;
    }
    .testimonial-text {
        font-size: 0.95rem;
    }
    .client-avatar {
        width: 50px;
        height: 50px;
    }
    .client-name {
        font-size: 1rem;
    }
    .client-role {
        font-size: 0.85rem;
    }
    .star-rating {
        font-size: 0.8rem;
    }
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        top: 45%; /* Adjust vertical position */
        left: 0;
        right: 0;
        transform: none; /* Remove translateY */
        margin: 0 auto;
        display: none; /* Hide nav buttons on smallest mobile, rely on swipe */
    }
    .carousel-nav.prev { transform: translateX(-100%); margin-right: 0.5rem; display: flex; }
    .carousel-nav.next { transform: translateX(100%); margin-left: 0.5rem; display: flex; }

    .carousel-dots {
        margin-top: 1.5rem;
    }
    .client-logos-strip {
        margin-top: 3rem;
        gap: 1.5rem;
    }
    .logos-title {
        font-size: 1.4rem;
    }
    .logos-grid {
        gap: 1.5rem 2rem;
    }
    .logos-grid img {
        max-width: 100px;
    }
    .final-cta {
        margin-top: 3.5rem;
        gap: 1.5rem;
    }
    .cta-text {
        font-size: 1.1rem;
    }
    .btn-primary {
        padding: 1rem 2rem;
        font-size: 1rem;
        gap: 0.6rem;
    }
}
