/**
 * Testimonials Section Styles
 * Professional testimonials section with responsive design
 * Following CodLion development guide standards
 */

/* CSS Variables for testimonials section */
:root {
    /* Testimonials Colors */
    --testimonials-bg: var(--background-color);
    --testimonials-text: var(--text-color);
    --testimonials-border: #e5e5e5;
    --testimonials-shadow: rgba(0, 0, 0, 0.1);
    --testimonials-star-color: #ffd700;
    --testimonials-star-empty: #ddd;
    --testimonials-avatar-bg: var(--primary-color);
    --testimonials-avatar-text: #ffffff;
    
    /* Testimonials Typography - H3 for homepage sections */
    --testimonials-title-size: var(--h3-font-size);
    --testimonials-subtitle-size: var(--body-font-size);
    --testimonials-text-size: var(--body-font-size);
    --testimonials-name-size: var(--small-font-size);
    
    /* Testimonials Spacing */
    --testimonials-padding: 40px 0;
    --testimonials-title-margin: 15px;
    --testimonials-grid-gap: 30px;
    --testimonials-item-padding: 30px;
    --testimonials-border-radius: 12px;
    
    /* Mobile Testimonials Variables */
    --testimonials-mobile-padding: 40px 0;
    --testimonials-mobile-title-margin: 12px;
    --testimonials-mobile-grid-gap: 20px;
    --testimonials-mobile-item-padding: 20px;
}

/* Main testimonials section */
.testimonials {
    padding: var(--testimonials-padding);
    background: var(--testimonials-bg);
    clear: both;
    display: block;
    width: 100%;
}

.testimonials-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Desktop Container Fix */
@media (max-width: 991px) {
    .testimonials-section {
        padding: 30px 0;
    }
}

.testimonials-title {
    text-align: center;
    margin-bottom: var(--testimonials-title-margin);
    font-size: var(--h3-font-size);
    font-weight: var(--heading-font-weight);
    color: var(--testimonials-text);
    font-family: var(--main-font);
    line-height: var(--heading-line-height);
    letter-spacing: var(--letter-spacing);
}

.testimonials-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: var(--h3-font-size);
    font-weight: var(--heading-font-weight);
    color: var(--text-color);
    font-family: var(--main-font);
    line-height: var(--heading-line-height);
    letter-spacing: var(--letter-spacing);
}

.testimonials-subtitle {
    text-align: center;
    margin-bottom: 40px;
    font-size: var(--h4-font-size);
    font-weight: var(--body-font-weight);
    color: var(--text-secondary-color);
    font-family: var(--main-font);
    line-height: var(--body-line-height);
    letter-spacing: var(--letter-spacing);
}

/* Desktop Typography Fix */
@media (min-width: 992px) {
    .testimonials-title {
        font-size: var(--h3-font-size);
        margin-bottom: 30px;
        line-height: var(--heading-line-height);
    }
    
    .testimonials-subtitle {
        font-size: var(--h4-font-size);
        margin-bottom: 40px;
    }
}

/* Old grid layout CSS removed - now using flex slider below */

/* Grid Layout Styles - Simple Horizontal Layout */
.testimonials .testimonials-slider-container {
    position: relative;
    overflow: hidden;
    margin-top: var(--testimonials-title-margin);
    width: 100%;
}

/* Navigation Arrows - Hidden for Grid Layout */
.testimonials .testimonials-nav {
    display: none;
}

/* Dots Indicator */
.testimonials-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 10px;
}

.testimonials-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--testimonials-border);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.testimonials-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.testimonials-dot:hover {
    background: var(--primary-color);
    opacity: 0.8;
}

/* Testimonials grid styles are defined in responsive media queries below */

/* Desktop: 3 testimonials side by side with horizontal scrollbar */
@media (min-width: 992px) {
    .testimonials .testimonials-slider-container {
        position: relative;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        scrollbar-color: var(--scrollbar-thumb-color) rgba(0, 0, 0, 0.1);
    }
    
    /* Webkit scrollbar styling for horizontal scroll */
    .testimonials .testimonials-slider-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .testimonials .testimonials-slider-container::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 3px;
        margin: 0 60% 0 0; /* Track width proportional to visible vs total content */
    }
    
    .testimonials .testimonials-slider-container::-webkit-scrollbar-thumb {
        background: var(--scrollbar-thumb-color);
        border-radius: 3px;
        transition: background-color 0.3s ease;
    }
    
    .testimonials .testimonials-slider-container::-webkit-scrollbar-thumb:hover {
        background: var(--primary-color);
    }
    
    /* Desktop: Horizontal flex layout for scrolling */
    .testimonials .testimonials-grid {
        display: flex;
        gap: var(--testimonials-grid-gap);
        width: max-content;
        min-width: 100%;
        margin-bottom: 15px; /* Professional space between slider and scrollbar */
    }
    
    .testimonials .testimonial-item {
        flex: 0 0 320px;
        min-width: 320px;
        max-width: 320px;
        box-sizing: border-box;
    }
    
    /* Hide navigation arrows and dots for scrollbar version */
    .testimonials .testimonials-nav {
        display: none;
    }
    
    .testimonials-dots {
        display: none;
    }
}

/* Mobile: Horizontal scrolling layout with all 5 testimonials */
@media (max-width: 991px) {
    /* Remove extra padding on mobile for professional full-width appearance */
    .testimonials-container {
        padding: 0px 0px;
    }
    
    .testimonials .testimonials-slider-container {
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        position: relative;
        scrollbar-width: thin;
        scrollbar-color: var(--scrollbar-thumb-color) rgba(0, 0, 0, 0.1);
    }
    
    /* Mobile webkit scrollbar styling */
    .testimonials .testimonials-slider-container::-webkit-scrollbar {
        height: 4px;
    }
    
    .testimonials .testimonials-slider-container::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 2px;
        margin: 0 80% 0 0; /* Mobile track width proportional to 1 visible vs 5 total */
    }
    
    .testimonials .testimonials-slider-container::-webkit-scrollbar-thumb {
        background: var(--scrollbar-thumb-color);
        border-radius: 2px;
        transition: background-color 0.3s ease;
    }
    
    .testimonials .testimonials-slider-container::-webkit-scrollbar-thumb:hover {
        background: var(--primary-color);
    }
    
    .testimonials .testimonials-grid {
        display: flex;
        gap: var(--testimonials-grid-gap);
        width: max-content;
        margin-bottom: 10px; /* Space for mobile scrollbar */
    }
    
    .testimonials .testimonial-item {
        flex: 0 0 280px;
        min-width: 280px;
        max-width: 280px;
        box-sizing: border-box;
    }
}

/* RTL support for navigation arrows */
body.rtl-mode .testimonials .testimonials-nav-prev {
    left: auto;
    right: -25px;
}

body.rtl-mode .testimonials .testimonials-nav-next {
    right: auto;
    left: -25px;
}

/* Testimonial items - Base styles only */
.testimonial-item {
    background: var(--background-color);
    border: 1px solid var(--testimonials-border);
    border-radius: var(--testimonials-border-radius);
    padding: var(--testimonials-item-padding);
    box-shadow: 0 2px 10px var(--testimonials-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

/* Grid Layout specific testimonial items - force horizontal layout */
.testimonials-grid-style .testimonial-item {
    display: block;
    flex-shrink: 0;
    box-sizing: border-box;
    float: none;
    clear: none;
    position: relative;
}

/* CodLion Style testimonial items */
.testimonials-codlion-style .testimonial-item {
    display: flex;
    flex-direction: column;
}

.testimonial-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--testimonials-shadow);
}

.testimonial-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Star rating */
.testimonial-rating {
    margin-bottom: 15px;
    text-align: center;
}

.testimonial-rating .star {
    font-size: 18px;
    margin: 0 2px;
    transition: color 0.2s ease;
}

.testimonial-rating .star.filled {
    color: var(--testimonials-star-color);
}

.testimonial-rating .star.empty {
    color: var(--testimonials-star-empty);
}

/* Testimonial text */
.testimonial-text {
    font-size: var(--testimonials-text-size);
    line-height: 1.6;
    color: var(--testimonials-text);
    margin-bottom: 20px;
    flex-grow: 1;
    text-align: center;
    font-style: italic;
    font-family: var(--main-font);
}

/* Author section */
.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
}

.testimonial-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.testimonial-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonial-avatar {
    background: var(--testimonials-avatar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--testimonials-avatar-text);
    font-weight: bold;
    font-size: 18px;
}

.testimonial-name {
    font-size: var(--testimonials-name-size);
    font-weight: 600;
    color: var(--testimonials-text);
    font-family: var(--main-font);
}

/* Navigation arrows for Grid Layout slider */
.testimonials .testimonials-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--background-color);
    border: 2px solid var(--testimonials-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--testimonials-shadow);
}

.testimonials .testimonials-nav:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px var(--testimonials-shadow);
}

.testimonials .testimonials-nav-prev {
    left: -25px;
}

.testimonials .testimonials-nav-next {
    right: -25px;
}

.testimonials .nav-arrow {
    font-size: 24px;
    font-weight: bold;
    color: var(--testimonials-text);
    line-height: 1;
}

.testimonials .testimonials-nav:hover .nav-arrow {
    color: var(--background-color);
}

/* RTL support for navigation arrows */
body.rtl-mode .testimonials .testimonials-nav-prev {
    left: auto;
    right: -25px;
}

body.rtl-mode .testimonials .testimonials-nav-next {
    right: auto;
    left: -25px;
}

/* Mobile/Tablet styles (Following dev guide: max-width: 991px) */
@media (max-width: 991px) {
    .testimonials {
        padding: var(--testimonials-mobile-padding);
    }
    
    .testimonials-container {
        padding: 0px 0px;
    }
    
    .testimonials-title {
        margin-bottom: 25px;
        font-size: calc(var(--h3-font-size) * 0.9);
        font-weight: 500; /* Lighter weight for mobile readability */
    }
    
    .testimonials-subtitle {
        font-size: calc(var(--h4-font-size) * 0.9);
        font-weight: 400; /* Normal weight for mobile subtitles */
        margin-bottom: 25px;
    }
    
    /* Only apply grid layout to non-slider testimonials (CodLion style) */
    .testimonials-codlion-style .testimonials-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--testimonials-mobile-grid-gap);
    }
    
    .testimonial-item {
        padding: var(--testimonials-mobile-item-padding);
    }
    
    .testimonial-text {
        font-size: calc(var(--testimonials-text-size) * 0.95);
    }
    
    .testimonial-photo {
        width: 45px;
        height: 45px;
    }
    
    .testimonial-avatar {
        font-size: 16px;
    }
}

/* Large screens optimization */
@media (min-width: 1200px) {
    .testimonials-container {
        max-width: 1400px;
    }
    
    /* Only apply to non-slider testimonials (CodLion style) */
    .testimonials-codlion-style .testimonials-grid {
        gap: calc(var(--testimonials-grid-gap) * 1.2);
    }
}

/* RTL Support */
body.rtl-mode .testimonial-author {
    flex-direction: row-reverse;
}

body.rtl-mode .testimonial-text {
    text-align: center;
}

/* CodLion Style Layout */
.testimonials-codlion-style .testimonials-codlion-layout {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

/* Customer Photos Row - CodLion Style */
.testimonials-codlion-style .testimonials-photos {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    height: 120px;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.testimonials-codlion-style .testimonial-photo-circle {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #ddd;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
    cursor: pointer;
    position: absolute;
    flex-shrink: 0;
    transform: scale(0.8);
    left: 50%;
    top: 50%;
    margin-left: -42.5px;
    margin-top: -42.5px;
}

.testimonials-codlion-style .testimonial-photo-circle:hover {
    opacity: 0.7;
}

/* Position 1 - Far Left */
.testimonials-codlion-style .testimonial-photo-circle.pos-0 {
    transform: translateX(-220px) scale(0.75);
    opacity: 0.3;
    z-index: 1;
    border-width: 2px;
}

/* Position 2 - Left */
.testimonials-codlion-style .testimonial-photo-circle.pos-1 {
    transform: translateX(-110px) scale(0.85);
    opacity: 0.6;
    z-index: 2;
    border-width: 2px;
}

/* Position 3 - Center (Active) - Professional & Prominent */
.testimonials-codlion-style .testimonial-photo-circle.pos-2 {
    width: 110px;
    height: 110px;
    margin-left: -55px;
    margin-top: -55px;
    transform: translateX(0) scale(1);
    opacity: 1;
    border: 4px solid var(--primary-color);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
    z-index: 3;
}

/* Position 4 - Right */
.testimonials-codlion-style .testimonial-photo-circle.pos-3 {
    transform: translateX(110px) scale(0.85);
    opacity: 0.6;
    z-index: 2;
    border-width: 2px;
}

/* Position 5 - Far Right */
.testimonials-codlion-style .testimonial-photo-circle.pos-4 {
    transform: translateX(220px) scale(0.75);
    opacity: 0.3;
    z-index: 1;
    border-width: 2px;
}

.testimonials-codlion-style .testimonial-photo-circle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.testimonials-codlion-style .testimonial-photo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.testimonials-codlion-style .testimonial-avatar-circle {
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 24px;
}

/* Center Star Rating - CodLion Style */
.testimonials-codlion-style .testimonials-rating-center {
    margin-bottom: 25px;
}

.testimonials-codlion-style .testimonials-rating-center .star {
    font-size: 24px;
    margin: 0 3px;
    color: #ddd;
    transition: color 0.3s ease;
}

.testimonials-codlion-style .testimonials-rating-center .star.filled {
    color: var(--testimonials-star-color);
}

/* Single Testimonial Text - CodLion Style */
.testimonials-codlion-style .testimonials-single-text {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonials-codlion-style .testimonial-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-in-out;
    pointer-events: none;
}

.testimonials-codlion-style .testimonial-slide.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.testimonials-codlion-style .testimonial-text-codlion {
    font-size: calc(var(--testimonials-text-size) * 1.1);
    line-height: 1.7;
    color: var(--testimonials-text);
    margin-bottom: 20px;
    font-style: italic;
    font-family: var(--main-font);
    text-align: center;
}

.testimonials-codlion-style .testimonial-author-codlion {
    font-size: var(--testimonials-name-size);
    font-weight: 600;
    color: var(--primary-color);
    font-family: var(--main-font);
    display: block;
    text-align: center;
}

/* Mobile adjustments for CodLion Style - 3 Photos with Perfect Symmetry */
@media (max-width: 991px) {
    .testimonials-codlion-style .testimonials-photos {
        margin-bottom: 35px;
        height: 120px;
        width: 100%;
        max-width: 350px;
        display: flex;
        position: relative;
        justify-content: center;
        align-items: center;
        margin-left: auto;
        margin-right: auto;
    }
    
    .testimonials-codlion-style .testimonial-photo-circle {
        width: 80px;
        height: 80px;
        border-width: 2px;
        margin: 0;
        position: absolute;
        left: 50%;
        top: 50%;
        margin-left: -40px;
        margin-top: -40px;
        transform: scale(0.85);
        transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        opacity: 0.5;
        border-color: #ccc;
    }
    
    /* Mobile - Only show 3 positions (5 reviews cycle through these 3 visible spots) */
    .testimonials-codlion-style .testimonial-photo-circle.pos-0,
    .testimonials-codlion-style .testimonial-photo-circle.pos-4 {
        display: none; /* Hide far positions - only show 3 photos at a time */
    }
    
    /* Mobile Position 2 - Left Side (Perfect Symmetry) */
    .testimonials-codlion-style .testimonial-photo-circle.pos-1 {
        transform: translateX(-110px) scale(0.8);
        opacity: 0.5;
        z-index: 1;
    }
    
    /* Mobile Position 3 - Center (Active) - Professional & Prominent */
    .testimonials-codlion-style .testimonial-photo-circle.pos-2 {
        width: 100px;
        height: 100px;
        margin-left: -50px;
        margin-top: -50px;
        border-width: 4px;
        transform: translateX(0) scale(1);
        opacity: 1;
        z-index: 3;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        border-color: var(--primary-color);
    }
    
    /* Mobile Position 4 - Right Side (Perfect Symmetry) */
    .testimonials-codlion-style .testimonial-photo-circle.pos-3 {
        transform: translateX(110px) scale(0.8);
        opacity: 0.5;
        z-index: 1;
    }
    
    .testimonials-codlion-style .testimonial-avatar-circle {
        font-size: 22px;
        font-weight: 600;
    }
    
    /* Mobile - Professional star rating */
    .testimonials-codlion-style .testimonials-rating-center {
        margin-bottom: 30px;
    }
    
    .testimonials-codlion-style .testimonials-rating-center .star {
        font-size: 26px;
        margin: 0 4px;
    }
    
    .testimonials-codlion-style .testimonial-text-codlion {
        font-size: calc(var(--testimonials-text-size) * 1.1);
        line-height: 1.65;
        margin-bottom: 18px;
        font-weight: 400;
    }
    
    .testimonials-codlion-style .testimonials-single-text {
        max-width: 100%;
        padding: 0 20px;
        min-height: 120px;
    }
    
    .testimonials-codlion-style .testimonial-author-codlion {
        font-size: calc(var(--testimonials-name-size) * 1.1);
        font-weight: 600;
    }
}

/* RTL Support for CodLion Style */
body.rtl-mode .testimonials-codlion-style .testimonials-photos {
    flex-direction: row-reverse;
}

body.rtl-mode .testimonials-codlion-style .testimonial-text-codlion,
body.rtl-mode .testimonials-codlion-style .testimonial-author-codlion {
    text-align: center;
}

/* Print styles */
@media print {
    .testimonials {
        padding: 20px 0;
        background: transparent;
    }
    
    .testimonial-item {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .testimonials-codlion-style .testimonial-photo-circle {
        border: 1px solid #000;
    }
}
