/* Testimonials Widget Styles - Maintaining exact original styling */

/* Base */
.elementor-widget-testimonials-widget {
    /* Deep forest-night blues with cyan glow accents */
    --bg-primary: #060723; /* midnight blue */
    --bg-secondary: #060723; /* deep marine */
    --bg-tertiary: #0c3a53; /* teal-navy */
    --card: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(255, 255, 255, 0.12);
    --text: #f8fafc;
    --text-secondary: #d6e7f5; /* cool pale blue for body text */
    --muted: #8fb3c9; /* desaturated blue for metadata */
    --ring: rgba(56, 189, 248, 0.22); /* sky-400 */
    --ring-hover: rgba(56, 189, 248, 0.45);
    --brand: #22d3ee; /* cyan-400 */
    --brand-secondary: #60a5fa; /* blue-400 */
    --star-filled: #22d3ee;
    --star-empty: #64748b;
}

.elementor-widget-testimonials-widget * {
    box-sizing: border-box;
}

/* Section styling */
.elementor-widget-testimonials-widget .testimonials-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(to bottom, var(--bg-tertiary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 56px 16px;
}

/* Animated background for widgets with has-animated-bg class */
.elementor-widget-testimonials-widget .testimonials-section.has-animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Cyan/blue fireflies */
    background-image: radial-gradient(2px 2px at 20px 30px, rgba(34, 211, 238, 0.95), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(96, 165, 250, 0.9), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(34, 211, 238, 0.9), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(56, 189, 248, 0.75), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(34, 211, 238, 0.95), transparent),
    radial-gradient(1px 1px at 300px 200px, rgba(56, 189, 248, 0.85), transparent),
    radial-gradient(2px 2px at 350px 120px, rgba(34, 211, 238, 0.95), transparent),
    radial-gradient(1px 1px at 450px 90px, rgba(96, 165, 250, 0.75), transparent);
    background-repeat: repeat;
    background-size: 400px 200px;
    opacity: 0.75;
    z-index: 0;
    pointer-events: none;
    animation: twinkle 4s ease-in-out infinite alternate;
}

.elementor-widget-testimonials-widget .testimonials-section.has-animated-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(1px 1px at 80px 120px, rgba(34, 211, 238, 0.8), transparent),
    radial-gradient(1px 1px at 180px 150px, rgba(96, 165, 250, 0.7), transparent),
    radial-gradient(1px 1px at 280px 50px, rgba(34, 211, 238, 0.9), transparent),
    radial-gradient(1px 1px at 380px 180px, rgba(56, 189, 248, 0.75), transparent);
    background-repeat: repeat;
    background-size: 600px 300px;
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
    animation: twinkle 6s ease-in-out infinite alternate-reverse;
}

@keyframes twinkle {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.6;
        transform: scale(1.01);
    }
}

/* Apply Dana font to the entire testimonials section */
.elementor-widget-testimonials-widget .testimonials-section,
.elementor-widget-testimonials-widget .testimonials-section * {
    font-family: "Dana", "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

.elementor-widget-testimonials-widget .container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    position: relative;
    z-index: 1;
}

.elementor-widget-testimonials-widget .section-header {
    text-align: center;
    margin-bottom: 28px;
}

/* Base title styles - color will be controlled by Elementor */
.elementor-widget-testimonials-widget .title {
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.35);
}

/* Base subtitle styles - color will be controlled by Elementor */
.elementor-widget-testimonials-widget .subtitle {
    margin: 0 auto;
    font-size: 14px;
}

/* Default colors only when Elementor controls are not used */
.elementor-widget-testimonials-widget .title:not([style*="color"]) {
    color: #f8fafc;
}

.elementor-widget-testimonials-widget .subtitle:not([style*="color"]) {
    color: #d6e7f5;
}

/* Swiper container */
.elementor-widget-testimonials-widget .testimonials-swiper {
    padding: 12px 4px 12px; /* minimal bottom by default */
    position: relative;
    direction: rtl; /* Default RTL */
}

/* Add bottom padding only when controls are present */
.elementor-widget-testimonials-widget .testimonials-swiper.has-navigation {
    padding-bottom: 40px;
}

.elementor-widget-testimonials-widget .testimonials-swiper.has-pagination {
    padding-bottom: 60px; /* extra space for pagination */
}

/* LTR Support */
.elementor-widget-testimonials-widget .testimonials-swiper[data-direction="ltr"] {
    direction: ltr;
}

.elementor-widget-testimonials-widget .testimonials-swiper[data-direction="ltr"] .card-footer {
    direction: ltr;
}

/* Card */
.elementor-widget-testimonials-widget .card {
    height: 100%;
    background: var(--card);
    border: 1px solid var(--ring);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 6px 20px rgba(15, 15, 35, 0.3);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    will-change: transform;
}

.elementor-widget-testimonials-widget .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 15, 35, 0.5);
    border-color: var(--ring-hover);
    background: var(--card-hover);
}

.elementor-widget-testimonials-widget .card-quote {
    font-size: 28px;
    line-height: 1;
    color: var(--brand);
    user-select: none;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.55);
}

.elementor-widget-testimonials-widget .card-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.9;
}

.elementor-widget-testimonials-widget .card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.elementor-widget-testimonials-widget .avatar {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-secondary) 100%);
    color: var(--bg-primary);
    font-weight: 700;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.35);
}

.elementor-widget-testimonials-widget .meta {
    flex: 1;
}

.elementor-widget-testimonials-widget .meta .name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.elementor-widget-testimonials-widget .meta .role {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

/* Rating Stars */
.elementor-widget-testimonials-widget .rating {
    display: flex;
    gap: 2px;
    margin-top: 0;
}

.elementor-widget-testimonials-widget .rating .star {
    font-size: 14px;
    color: var(--star-filled);
    text-shadow: 0 0 6px rgba(34, 211, 238, 0.5);
    transition: all 0.2s ease;
    will-change: transform;
}

.elementor-widget-testimonials-widget .rating .star.empty {
    color: var(--star-empty);
    text-shadow: none;
}

.elementor-widget-testimonials-widget .rating:hover .star {
    transform: scale(1.1);
}

/* Controls container */
.elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
}

/* Make pagination inline inside controls */
.elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-pagination {
    position: static;
    transform: none;
}

/* Minimal arrows inline next to pagination */
.elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-prev,
.elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-next {
    position: static;
    width: 32px;
    height: 32px;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    transition: all 0.2s ease;
    display: grid;
    place-items: center;
    margin-top: -5px; /* slight offset from pagination */
    border-radius: 50%;
}

.elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-prev:hover,
.elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-next:hover {
    background: var(--card);
    border-color: var(--ring-hover);
    transform: none;
}

/* Arrow icons */
.elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-prev::after,
.elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-next::after {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.45);
}

/* Pagination Dots */
.elementor-widget-testimonials-widget .testimonials-swiper .swiper-pagination {
    width: auto;
    height: auto;
    text-align: center;
}

.elementor-widget-testimonials-widget .testimonials-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 50%;
    background: var(--muted);
    opacity: 0.7;
    margin: 0 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.elementor-widget-testimonials-widget .testimonials-swiper .swiper-pagination-bullet:hover {
    background: var(--brand-secondary);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.55);
}

.elementor-widget-testimonials-widget .testimonials-swiper .swiper-pagination-bullet-active {
    background: var(--brand);
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.7);
}

/* Disabled state */
.elementor-widget-testimonials-widget .testimonials-swiper .swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Responsive */
@media (min-width: 768px) {
    .elementor-widget-testimonials-widget .title {
        font-size: 32px;
    }
}

@media (min-width: 1024px) {
    .elementor-widget-testimonials-widget .title {
        font-size: 36px;
    }
}

@media (max-width: 640px) {
    .elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-prev,
    .elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-next {
        width: 28px;
        height: 28px;
    }

    .elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-prev::after,
    .elementor-widget-testimonials-widget .testimonials-swiper .swiper-controls .swiper-button-next::after {
        font-size: 12px;
    }

    .elementor-widget-testimonials-widget .testimonials-swiper .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        margin: 0 3px;
    }
}

/* RTL Support */
.elementor-widget-testimonials-widget .testimonials-section {
    direction: rtl;
}

/* Editor specific styles */
.elementor-editor .elementor-widget-testimonials-widget .testimonials-swiper {
    overflow: visible;
}

/* Ensure proper z-index in Elementor */
.elementor-widget-testimonials-widget .container {
    position: relative;
    z-index: 2;
}

/* Ensure swiper container has proper positioning */
.elementor-widget-testimonials-widget .swiper {
    overflow: hidden;
}

/* Fix for Elementor editor preview */
.elementor-editor .elementor-widget-testimonials-widget .swiper-slide {
    height: auto;
}

/* Accessibility improvements */
.elementor-widget-testimonials-widget .swiper-controls button:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .elementor-widget-testimonials-widget {
        --ring: rgba(56, 189, 248, 0.8);
        --brand: #00bcd4;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .elementor-widget-testimonials-widget .card,
    .elementor-widget-testimonials-widget .rating .star,
    .elementor-widget-testimonials-widget .swiper-pagination-bullet {
        transition: none;
    }

    .elementor-widget-testimonials-widget .testimonials-section.has-animated-bg::before,
    .elementor-widget-testimonials-widget .testimonials-section.has-animated-bg::after {
        animation: none;
    }
}