/*testimonials with your global color scheme */

.testimonials-section {
    padding: 4rem 2rem;
    background: var(--light-grey);
    position: relative;
    overflow: hidden;
}

.testimonials-section h1 {
    font-family: var(--header-font);
    font-weight: var(--heading-weight);
    color: var(--primary-color);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.testimonials-section h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Performance optimizations */
.testimonials-section {
    will-change: transform;
}

.testimonials {
    will-change: transform, box-shadow;
}

.swiper-slide {
    will-change: transform;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .testimonials,
    .testimonials-play-pause,
    .swiper-button-next,
    .swiper-button-prev,
    .floating-quote {
        animation: none !important;
        transition: none !important;
    }
    
    .testimonials:hover {
        transform: none !important;
    }
}

/* Loading state */
.testimonials-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-grey);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Background decorative elements */
.testimonials-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-quote {
    position: absolute;
    font-size: 8rem;
    color: rgba(15, 15, 203, 0.05);
    font-family: var(--header-font);
    font-weight: var(--heading-weight);
    user-select: none;
}

.floating-quote:first-child {
    top: 10%;
    left: 5%;
    animation: float 6s ease-in-out infinite;
}

.floating-quote:last-child {
    bottom: 10%;
    right: 5%;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

/* Main content */
.testimonials-content {
    position: relative;
    z-index: 2;
    transition: opacity 0.5s ease;
}

/* Google-style testimonial cards */
.testimonials {
    background: var(--secondary-color);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    margin: 1rem;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid rgba(15, 15, 203, 0.08);
    min-height: 380px;
    display: flex;
    flex-direction: column;
}

.testimonials:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.testimonials::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: var(--primary-color);
    font-family: var(--header-font);
    font-weight: var(--heading-weight);
    line-height: 1;
}

/* Header section */
.testimonial-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-color);
    font-weight: var(--heading-weight);
    font-family: var(--header-font);
    margin-right: 1rem;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(15, 15, 203, 0.2);
    flex-shrink: 0;
}

.testimonial-info {
    flex: 1;
}

.testimonial-info h2 {
    font-family: var(--header-font);
    font-weight: var(--heading-weight);
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
}

.testimonial-role {
    font-family: var(--body-font);
    font-size: 0.95rem;
    color: var(--dark-color);
    margin: 0;
    opacity: 0.8;
    font-weight: 500;
}

/* Content section */
.testimonial-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-content blockquote {
    margin: 0;
    flex: 1;
}

.testimonial-content blockquote p {
    font-family: var(--body-font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    font-weight: var(--body-weight);
}

/* Rating section */
.testimonial-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-grey);
}

.stars {
    color: var(--star-gold-color);
    font-size: 1.1rem;
    display: flex;
    gap: 2px;
}

.rating-number {
    font-family: var(--header-font);
    font-weight: var(--heading-weight);
    font-size: 1rem;
    color: var(--primary-color);
}

/* Swiper customization */
.swiper-pagination {
    position: relative !important;
    margin-top: 2rem;
}

.swiper-pagination-bullet {
    width: 12px !important;
    height: 12px !important;
    background: var(--primary-color) !important;
    opacity: 0.3 !important;
    margin: 0 6px !important;
    transition: all 0.3s ease !important;
}

.swiper-pagination-bullet-active {
    opacity: 1 !important;
    transform: scale(1.2) !important;
    background: var(--accent-color) !important;
}

.swiper-button-next,
.swiper-button-prev {
    width: 50px !important;
    height: 50px !important;
    background: var(--secondary-color) !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid var(--primary-color) !important;
    transition: all 0.3s ease !important;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: var(--primary-color) !important;
    transform: scale(1.1) !important;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 16px !important;
    color: var(--primary-color) !important;
    font-weight: bold !important;
}

.swiper-button-next:hover:after,
.swiper-button-prev:hover:after {
    color: var(--secondary-color) !important;
}

/* Controls */
.testimonials-controls {
    text-align: center;
    margin-top: 2rem;
}

.testimonials-play-pause {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--body-font);
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 120px;
    min-height: 48px;
    transition: all 0.3s ease, transform 0.15s ease;
    box-shadow: 0 4px 16px rgba(15, 15, 203, 0.3);
}

.testimonials-play-pause:hover {
    background: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 15, 203, 0.4);
}

.testimonials-play-pause:active {
    transform: translateY(0);
}

/* Dark mode support */
body.dark-mode .testimonials-section {
    background: var(--dark-color);
}

body.dark-mode .testimonials {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

body.dark-mode .testimonials:hover {
    border-color: var(--light-grey);
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .testimonial-info h2 {
    color: var(--light-grey);
}

body.dark-mode .testimonial-role {
    color: var(--light-color);
    opacity: 0.8;
}

body.dark-mode .testimonial-content blockquote p {
    color: var(--light-color);
}

body.dark-mode .testimonial-rating {
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .rating-number {
    color: var(--light-grey);
}

body.dark-mode .swiper-button-next,
body.dark-mode .swiper-button-prev {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--light-grey) !important;
}

body.dark-mode .swiper-button-next:after,
body.dark-mode .swiper-button-prev:after {
    color: var(--light-grey) !important;
}

/* Tablet styles */
@media (max-width: 1024px) {
    .testimonials-section {
        padding: 3rem 1.5rem;
    }
    
    .testimonials-section h1 {
        font-size: 2.2rem;
        margin-bottom: 2.5rem;
    }
    
    .testimonials {
        padding: 2rem;
        min-height: 350px;
    }
    
    .floating-quote {
        font-size: 6rem;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .testimonials-section {
        padding: 2.5rem 1rem;
    }
    
    .testimonials-section h1 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .testimonials {
        padding: 1.5rem;
        margin: 0.5rem;
        min-height: 320px;
    }
    
    .testimonial-avatar {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .testimonial-info h2 {
        font-size: 1.1rem;
    }
    
    .testimonial-role {
        font-size: 0.9rem;
    }
    
    .testimonial-content blockquote p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        width: 40px !important;
        height: 40px !important;
    }
    
    .swiper-button-next:after,
    .swiper-button-prev:after {
        font-size: 14px !important;
    }
    
    .floating-quote {
        font-size: 4rem;
    }
    
    .testimonials-play-pause {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        min-width: 100px;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    .testimonials-section {
        padding: 2rem 0.75rem;
    }
    
    .testimonials-section h1 {
        font-size: 1.6rem;
    }
    
    .testimonials {
        padding: 1.25rem;
        margin: 0.25rem;
        min-height: 300px;
    }
    
    .testimonial-header {
        margin-bottom: 1rem;
    }
    
    .testimonial-avatar {
        width: 45px;
        height: 45px;
        margin-right: 0.75rem;
    }
    
    .testimonial-info h2 {
        font-size: 1rem;
    }
    
    .testimonial-role {
        font-size: 0.85rem;
    }
    
    .testimonial-content blockquote p {
        font-size: 0.9rem;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }
    
    .floating-quote {
        display: none;
    }
    
    .testimonials::before {
        font-size: 3rem;
        top: -5px;
        left: 15px;
    }
}

/* Landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .testimonials-section {
        padding: 1.5rem 1rem;
    }
    
    .testimonials {
        min-height: auto;
        padding: 1rem;
    }
    
    .floating-quote {
        display: none;
    }
}