/**
 * W8 Testimonials Frontend Styles
 */

/* CSS Variables for easy customization */
:root {
    --w8-testimonial-bg: #ffffff;
    --w8-testimonial-border: #e5e7eb;
    --w8-testimonial-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --w8-testimonial-radius: 12px;
    --w8-testimonial-padding: 24px;
    --w8-star-color: #fbbf24;
    --w8-star-empty: #d1d5db;
    --w8-text-primary: #1f2937;
    --w8-text-secondary: #6b7280;
    --w8-text-muted: #9ca3af;
    --w8-accent-color: #2563eb;
    --w8-quote-color: #e5e7eb;
}

/* Section Styles */
.w8-testimonials-section {
    padding: 60px 0;
}

.w8-testimonials-header {
    text-align: center;
    margin-bottom: 40px;
}

.w8-testimonials-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--w8-text-primary);
    margin: 0 0 10px 0;
}

.w8-testimonials-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--w8-text-secondary);
    margin: 0 0 15px 0;
}

.w8-testimonials-description {
    font-size: 1rem;
    color: var(--w8-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Grid Layout */
.w8-testimonials-grid {
    display: grid;
    gap: 24px;
}

.w8-testimonials-grid.w8-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.w8-testimonials-grid.w8-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.w8-testimonials-grid.w8-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Testimonial Card */
.w8-testimonial-card {
    background: var(--w8-testimonial-bg);
    border: 1px solid var(--w8-testimonial-border);
    border-radius: var(--w8-testimonial-radius);
    padding: var(--w8-testimonial-padding);
    box-shadow: var(--w8-testimonial-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.w8-testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Star Rating */
.w8-testimonial-rating {
    margin-bottom: 16px;
}

.w8-star {
    font-size: 18px;
    color: var(--w8-star-empty);
    margin-right: 2px;
}

.w8-star.filled {
    color: var(--w8-star-color);
}

/* Content */
.w8-testimonial-content {
    flex: 1;
    margin-bottom: 20px;
}

.w8-testimonial-content blockquote {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--w8-text-primary);
    font-style: normal;
}

.w8-testimonial-content blockquote::before {
    content: '"';
    font-size: 3rem;
    line-height: 0;
    color: var(--w8-quote-color);
    display: block;
    margin-bottom: 10px;
}

/* Author */
.w8-testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--w8-testimonial-border);
}

.w8-testimonial-author-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.w8-testimonial-author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.w8-testimonial-author-placeholder {
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.w8-testimonial-author-placeholder svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
}

.w8-testimonial-author-info {
    display: flex;
    flex-direction: column;
}

.w8-testimonial-author-name {
    font-weight: 600;
    color: var(--w8-text-primary);
    font-size: 0.95rem;
}

.w8-testimonial-author-title {
    font-size: 0.85rem;
    color: var(--w8-text-secondary);
}

.w8-testimonial-author-location {
    font-size: 0.8rem;
    color: var(--w8-text-muted);
}

/* Date */
.w8-testimonial-date {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--w8-text-muted);
}

/* Carousel Layout */
.w8-testimonials-carousel {
    position: relative;
    overflow: hidden;
    padding: 0 50px;
}

.w8-carousel-wrapper {
    overflow: hidden;
}

.w8-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.w8-carousel-slide {
    flex: 0 0 auto;
    padding: 0 12px;
    box-sizing: border-box;
}

/* Carousel Navigation */
.w8-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--w8-testimonial-bg);
    border: 1px solid var(--w8-testimonial-border);
    box-shadow: var(--w8-testimonial-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.w8-carousel-nav:hover {
    background: var(--w8-accent-color);
    border-color: var(--w8-accent-color);
    color: #fff;
}

.w8-carousel-prev {
    left: 0;
}

.w8-carousel-next {
    right: 0;
}

.w8-carousel-nav svg {
    width: 20px;
    height: 20px;
}

/* Carousel Dots */
.w8-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.w8-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--w8-testimonial-border);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.w8-carousel-dot:hover,
.w8-carousel-dot.active {
    background: var(--w8-accent-color);
    transform: scale(1.2);
}

/* ============================================
   ELEGANT SLIDER - Customizable Colors
   ============================================ */

/* Slider CSS Variables - Dark theme (default) */
/* Can be overridden by inline styles from admin settings */
.w8-testimonials-slider {
    --w8-slider-bg: transparent;
    --w8-slider-card-bg: #1a1a1a;
    --w8-slider-card-border: #666666;
    --w8-slider-author-name: #f0f0f0;
    --w8-slider-author-title: #aaaaaa;
    --w8-slider-content: #cccccc;
    --w8-slider-quote: rgba(255, 255, 255, 0.08);
    --w8-slider-image-border: #444444;
    --w8-slider-nav: #aaaaaa;
    --w8-slider-nav-bg: transparent;
    --w8-slider-nav-border: #444444;
    --w8-slider-link: #aaaaaa;
}

/* Slider Container - Transparent by default, customizable */
.w8-testimonials-slider {
    position: relative;
    background: var(--w8-slider-bg);
    padding: 80px 80px 60px;
    max-width: 100%;
    margin: 0;
    overflow: hidden; /* Prevent horizontal scroll from slider */
}

.w8-slider-track-wrapper {
    overflow: hidden; /* Hide cards outside the visible area */
    position: relative;
    z-index: 1;
    padding-top: 80px; /* Space for author images that extend above cards */
    margin-top: -80px; /* Compensate for padding */
    padding-bottom: 20px; /* Space for hover shadow */
}

.w8-slider-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.w8-slider-item {
    flex: 0 0 33.333%;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Elegant Slider Card */
.w8-slider-card {
    background: var(--w8-slider-card-bg);
    border: 1px solid var(--w8-slider-card-border);
    border-radius: 16px;
    position: relative;
    padding-top: 70px;
    margin-top: 70px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.w8-slider-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Large overlayed author image - simple solid border, no gradient */
.w8-slider-card-image {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--w8-slider-image-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    background: #ffffff; /* Solid white background for transparent images */
}

.w8-slider-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.w8-slider-card:hover .w8-slider-card-image img {
    filter: brightness(1.1);
}

/* Card body */
.w8-slider-card-body {
    padding: 30px 30px 35px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Author info - Elegant typography */
.w8-slider-author-info {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--w8-slider-card-border);
}

.w8-slider-author-name {
    display: block;
    font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--w8-slider-author-name);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.w8-slider-author-title {
    display: block;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--w8-slider-author-title);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Content - Elegant italic quote */
.w8-slider-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.w8-slider-content blockquote {
    margin: 0;
    padding: 0;
    border: none;
    font-family: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--w8-slider-content);
    font-style: italic;
    position: relative;
}

.w8-slider-content blockquote::before {
    content: '"';
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 4rem;
    color: var(--w8-slider-quote);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    line-height: 1;
}

/* Read more inline link */
.w8-slider-read-more {
    display: inline;
    margin-left: 5px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--w8-slider-link);
    font-family: inherit;
    font-size: inherit;
    font-style: italic;
    font-weight: 400;
    text-decoration: underline;
    text-decoration-color: var(--w8-slider-link);
    text-underline-offset: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.w8-slider-read-more:hover {
    color: var(--w8-slider-author-name);
    text-decoration-color: var(--w8-slider-author-name);
}

/* Expanded card state */
.w8-slider-card-expanded {
    height: auto;
}

/* Stars (hidden by default but styled elegantly) */
.w8-slider-rating {
    margin-top: 20px;
}

.w8-slider-rating .w8-star {
    font-size: 16px;
    margin: 0 3px;
    color: var(--w8-slider-card-border);
}

.w8-slider-rating .w8-star.filled {
    color: var(--w8-slider-author-name);
}

/* Legacy single-slide support */
.w8-slider-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.w8-slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.w8-slider-slide.active {
    position: relative;
    opacity: 1;
    visibility: visible;
}

/* Elegant Slider Navigation */
.w8-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--w8-slider-nav-bg);
    border: 1px solid var(--w8-slider-nav-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    color: var(--w8-slider-nav);
}

.w8-slider-nav:hover {
    background: var(--w8-slider-nav-border);
    border-color: var(--w8-slider-nav);
    color: var(--w8-slider-author-name);
}

.w8-slider-nav svg {
    stroke: currentColor;
}

.w8-slider-prev {
    left: 15px;
}

.w8-slider-next {
    right: 15px;
}

/* Elegant Slider Dots - Hidden by default */
.w8-slider-dots {
    display: none; /* Disabled by default */
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

/* Enable dots when explicitly shown */
.w8-slider-dots.w8-slider-dots-visible {
    display: flex;
}

.w8-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--w8-slider-nav-bg);
    border: 1px solid var(--w8-slider-nav-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.w8-slider-dot:hover {
    background: var(--w8-slider-nav-border);
    border-color: var(--w8-slider-nav);
}

.w8-slider-dot.active {
    background: var(--w8-slider-author-name);
    border-color: var(--w8-slider-author-name);
    transform: scale(1.2);
}

/* Single Testimonial */
.w8-testimonial-single {
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .w8-testimonials-grid.w8-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .w8-testimonials-grid.w8-cols-3,
    .w8-testimonials-grid.w8-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .w8-testimonials-title {
        font-size: 2rem;
    }
    
    .w8-testimonials-carousel {
        padding: 0 40px;
    }
    
    .w8-testimonials-slider {
        padding: 70px 50px 50px;
    }
    
    /* Multi-item slider: 2 items on tablet */
    .w8-slider-item {
        flex: 0 0 50%;
        padding: 0 15px;
    }
    
    .w8-slider-card {
        margin-top: 60px;
        padding-top: 60px;
    }
    
    .w8-slider-card-image {
        width: 120px;
        height: 120px;
        top: -60px;
    }
    
    .w8-slider-card-body {
        padding: 25px 20px 30px;
    }
    
    .w8-slider-author-name {
        font-size: 1.2rem;
    }
    
    .w8-slider-content blockquote {
        font-size: 1rem;
    }
    
    .w8-slider-content blockquote::before {
        font-size: 3rem;
        top: -25px;
    }
}

@media (max-width: 576px) {
    .w8-testimonials-grid.w8-cols-2,
    .w8-testimonials-grid.w8-cols-3,
    .w8-testimonials-grid.w8-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .w8-testimonials-section {
        padding: 40px 0;
    }
    
    .w8-testimonials-header {
        margin-bottom: 30px;
    }
    
    .w8-testimonials-title {
        font-size: 1.75rem;
    }
    
    .w8-testimonial-card {
        padding: 20px;
    }
    
    .w8-testimonials-carousel {
        padding: 0;
    }
    
    .w8-carousel-nav {
        display: none;
    }
    
    /* Elegant slider mobile styles */
    .w8-testimonials-slider {
        padding: 60px 15px 40px;
    }
    
    /* Multi-item slider: 1 item on mobile */
    .w8-slider-item {
        flex: 0 0 100%;
        padding: 0 10px;
    }
    
    .w8-slider-nav {
        width: 40px;
        height: 40px;
    }
    
    .w8-slider-prev {
        left: 5px;
    }
    
    .w8-slider-next {
        right: 5px;
    }
    
    .w8-slider-nav svg {
        width: 18px;
        height: 18px;
    }
    
    /* Smaller overlayed author image on mobile */
    .w8-slider-card {
        padding-top: 55px;
        margin-top: 55px;
        border-radius: 12px;
    }
    
    .w8-slider-card-image {
        width: 110px;
        height: 110px;
        top: -55px;
        border-width: 3px;
    }
    
    .w8-slider-card-body {
        padding: 20px 18px 25px;
    }
    
    .w8-slider-author-info {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }
    
    .w8-slider-author-name {
        font-size: 1.1rem;
    }
    
    .w8-slider-author-title {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
    
    .w8-slider-content blockquote {
        font-size: 0.95rem;
        line-height: 1.8;
    }
    
    .w8-slider-content blockquote::before {
        font-size: 2.5rem;
        top: -20px;
    }
    
    .w8-slider-dots {
        margin-top: 30px;
        gap: 10px;
    }
    
    .w8-slider-dot {
        width: 8px;
        height: 8px;
    }
}

/* Animation Classes */
@keyframes w8-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.w8-testimonial-card {
    animation: w8-fade-in 0.5s ease forwards;
}

.w8-testimonials-grid .w8-testimonial-card:nth-child(1) { animation-delay: 0.1s; }
.w8-testimonials-grid .w8-testimonial-card:nth-child(2) { animation-delay: 0.2s; }
.w8-testimonials-grid .w8-testimonial-card:nth-child(3) { animation-delay: 0.3s; }
.w8-testimonials-grid .w8-testimonial-card:nth-child(4) { animation-delay: 0.4s; }
.w8-testimonials-grid .w8-testimonial-card:nth-child(5) { animation-delay: 0.5s; }
.w8-testimonials-grid .w8-testimonial-card:nth-child(6) { animation-delay: 0.6s; }

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .w8-testimonials-section.w8-dark-mode {
        --w8-testimonial-bg: #1f2937;
        --w8-testimonial-border: #374151;
        --w8-text-primary: #f9fafb;
        --w8-text-secondary: #d1d5db;
        --w8-text-muted: #9ca3af;
        --w8-quote-color: #374151;
    }
}

/* Print Styles */
@media print {
    .w8-testimonials-carousel,
    .w8-testimonials-slider {
        display: none;
    }
    
    .w8-testimonials-grid {
        display: block;
    }
    
    .w8-testimonial-card {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
