/* ============================================================
   PREMIUM TESTIMONIALS COMPONENT
   AMCleaning-Service
   
   Hochwertige, intelligente Bewertungssektion mit:
   - Automatische Erkennung ob Navigation nötig ist
   - GPU-beschleunigte Animationen (fade, slide, scale)
   - Responsive: 3 Karten Desktop, 2 Tablet, 1 Mobile
   - Konfigurierbar über data-Attribute
   - Dark Mode Support
   - Reduced Motion Support
   ============================================================ */

/* === Section Background === */
.testimonials-section {
    position: relative;
    overflow: hidden;
}
.testimonials-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

/* === Main Container === */
.testimonials-premium {
    position: relative;
    max-width: 1200px;
    margin: 2rem auto 0;
}

/* === Viewport & Track === */
.testimonials-viewport {
    overflow: hidden;
    border-radius: 1.5rem;
    padding: 0.5rem 0;
}
.testimonials-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

/* === Individual Slide === */
.testimonial-slide {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0.75rem;
    box-sizing: border-box;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
/* Tablet */
@media (max-width: 991.98px) {
    .testimonial-slide {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
/* Mobile */
@media (max-width: 767.98px) {
    .testimonial-slide {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0.5rem;
    }
}

/* === Animation States === */
.testimonial-slide.entering {
    animation: slideEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.testimonial-slide.leaving {
    animation: slideLeave 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideEnter {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}
@keyframes slideLeave {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
}

/* Fade animation variant */
.testimonials-premium[data-animation="fade"] .testimonials-track {
    transition: none;
}
.testimonials-premium[data-animation="fade"] .testimonial-slide {
    transition: opacity 0.5s ease;
}

/* === Card Premium Design === */
.testimonial-card-premium {
    height: 100%;
    perspective: 1000px;
}
.testimonial-card-inner {
    position: relative;
    height: 100%;
    padding: 2rem 1.75rem;
    background: var(--color-surface-solid, #ffffff);
    border: 1px solid var(--color-border, rgba(15, 23, 42, 0.08));
    border-radius: 1.25rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease;
    overflow: hidden;
}
.testimonial-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary, linear-gradient(135deg, #34d399, #10b981));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.testimonial-card-inner:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
    border-color: rgba(16, 185, 129, 0.2);
}
.testimonial-card-inner:hover::before {
    opacity: 1;
}

/* === Quote Icon === */
.testimonial-quote-icon {
    margin-bottom: 0.75rem;
    color: var(--color-primary, #10b981);
}

/* === Stars === */
.testimonial-stars-premium {
    display: flex;
    gap: 0.2rem;
    margin-bottom: 1rem;
}
.testimonial-stars-premium i {
    font-size: 1rem;
    color: #f59e0b;
}
.testimonial-stars-premium i.bi-star {
    color: var(--color-border-strong, rgba(15, 23, 42, 0.14));
}

/* === Text === */
.testimonial-text-premium {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-text-soft, #475569);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Footer (Author) === */
.testimonial-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border, rgba(15, 23, 42, 0.06));
}
.testimonial-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-primary, linear-gradient(135deg, #34d399, #10b981));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.testimonial-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.testimonial-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.testimonial-location-premium {
    font-size: 0.78rem;
    color: var(--color-text-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.testimonial-location-premium i {
    font-size: 0.7rem;
}
.testimonial-verified {
    color: var(--color-primary, #10b981);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* === Navigation Container === */
.testimonials-nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.testimonials-nav-container.hidden {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
    overflow: hidden;
}

/* === Nav Buttons === */
.testimonials-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--color-border-strong, rgba(15, 23, 42, 0.12));
    background: var(--color-surface-solid, #ffffff);
    color: var(--color-text, #0f172a);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    -webkit-tap-highlight-color: transparent;
}
.testimonials-btn:hover {
    background: var(--color-primary, #10b981);
    color: white;
    border-color: var(--color-primary, #10b981);
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}
.testimonials-btn:active {
    transform: scale(0.95);
}

/* === Dots === */
.testimonials-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.testimonials-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--color-border-strong, rgba(15, 23, 42, 0.15));
    cursor: pointer;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-tap-highlight-color: transparent;
}
.testimonials-dot.active {
    width: 24px;
    border-radius: 999px;
    background: var(--color-primary, #10b981);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.testimonials-dot:hover:not(.active) {
    background: rgba(16, 185, 129, 0.4);
    transform: scale(1.3);
}

/* === Progress Bar (Autoplay Indicator) === */
.testimonials-progress {
    width: 100%;
    max-width: 200px;
    height: 3px;
    background: var(--color-border, rgba(15, 23, 42, 0.06));
    border-radius: 999px;
    margin: 1.25rem auto 0;
    overflow: hidden;
    transition: opacity 0.3s ease;
}
.testimonials-progress.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
}
.testimonials-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary, linear-gradient(135deg, #34d399, #10b981));
    border-radius: 999px;
    transition: width 0.1s linear;
}
.testimonials-progress-bar.animating {
    transition: width linear;
}

/* === Dark Mode === */
html[data-theme='dark'] .testimonial-card-inner {
    background: var(--color-surface, rgba(15, 23, 42, 0.8));
    border-color: var(--color-border, rgba(148, 163, 184, 0.12));
}
html[data-theme='dark'] .testimonial-card-inner:hover {
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.08), 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}
html[data-theme='dark'] .testimonial-text-premium {
    color: var(--color-text-soft, #94a3b8);
}
html[data-theme='dark'] .testimonial-name {
    color: var(--color-text, #f1f5f9);
}
html[data-theme='dark'] .testimonials-btn {
    background: var(--color-surface, rgba(15, 23, 42, 0.6));
    border-color: var(--color-border, rgba(148, 163, 184, 0.16));
    color: var(--color-text, #f1f5f9);
}
html[data-theme='dark'] .testimonials-btn:hover {
    background: var(--color-primary, #10b981);
    color: white;
}
html[data-theme='dark'] .testimonials-dot {
    background: rgba(148, 163, 184, 0.25);
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
    .testimonials-track {
        transition: none !important;
    }
    .testimonial-slide {
        transition: none !important;
        animation: none !important;
    }
    .testimonial-card-inner {
        transition: none !important;
    }
    .testimonials-btn {
        transition: none !important;
    }
    .testimonials-dot {
        transition: none !important;
    }
    .testimonials-progress-bar {
        transition: none !important;
    }
}

/* === Mobile Optimizations === */
@media (max-width: 767.98px) {
    .testimonials-premium {
        margin-top: 1rem;
    }
    .testimonial-card-inner {
        padding: 1.5rem 1.25rem;
    }
    .testimonials-nav-container {
        margin-top: 1.5rem;
    }
    .testimonials-btn {
        width: 40px;
        height: 40px;
    }
}
