/**
 * Testimony Marquee CSS Widget Styles
 * Pure CSS infinite marquee animation
 */

.smarteco-testimony-marquee-css {
    width: 100%;
    height: 100%;
    max-height: 800px;
    overflow: hidden;
    position: relative;
}

.smarteco-testimony-marquee-css::before {
    content: "";
    position: absolute;
    top: 0;
    left:0;
    right: 0;
    height: 200px;
    z-index: 10;
    background: #F3F6FC;
    background: -webkit-linear-gradient(180deg,rgba(243, 246, 252, 1) 0%, rgba(243, 246, 252, 0) 100%);
    background: -moz-linear-gradient(180deg,rgba(243, 246, 252, 1) 0%, rgba(243, 246, 252, 0) 100%);
    background: linear-gradient(180deg,rgba(243, 246, 252, 1) 0%, rgba(243, 246, 252, 0) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(
            startColorstr="#F3F6FC",
            endColorstr="#F3F6FC",
            GradientType=0
    );
    pointer-events: none;
}

.smarteco-testimony-marquee-css::after {
    content: "";
    position: absolute;
    bottom: 0;
    left:0;
    right: 0;
    height: 200px;
    z-index: 10;
    background: #F3F6FC;
    background: -webkit-linear-gradient(180deg,rgba(243, 246, 252, 0) 0%, rgba(243, 246, 252, 1) 100%);
    background: -moz-linear-gradient(180deg,rgba(243, 246, 252, 0) 0%, rgba(243, 246, 252, 1) 100%);
    background: linear-gradient(180deg,rgba(243, 246, 252, 0) 0%, rgba(243, 246, 252, 1) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(
            startColorstr="#F3F6FC",
            endColorstr="#F3F6FC",
            GradientType=0
    );
    pointer-events: none;
}

/* Horizontal layout - 2 rows stacked */
.layout-horizontal {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.layout-horizontal .testimony-marquee-track {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Vertical layout - 2 columns side by side */
.layout-vertical {
    display: flex;
    flex-direction: row;
    gap: 20px;
    height: 100%;
}

.layout-vertical .testimony-marquee-track {
    display: flex;
    flex: 1;
    width: 50%;
    height: 100%;
}

.testimony-marquee-track {
    margin-bottom: 0;
    height: 100%;
}

.testimony-marquee-content {
    display: flex;
    gap: var(--testimony-gap, 20px);
    animation: marquee-scroll var(--testimony-duration, 30s) linear infinite;
    will-change: transform;
}

/* Direction animations */
.direction-left .testimony-marquee-content {
    animation-name: marquee-scroll-left;
}

.direction-right .testimony-marquee-content {
    animation-name: marquee-scroll-right;
}

.direction-up .testimony-marquee-content {
    animation-name: marquee-scroll-up;
}

.direction-down .testimony-marquee-content {
    animation-name: marquee-scroll-down;
}

/* Vertical layout adjustments */
.layout-vertical .testimony-marquee-track {
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
}

.layout-vertical .testimony-marquee-content {
    flex-direction: column;
}

/* Different speeds for multiple columns */
.testimony-marquee-track[data-column="0"] .testimony-marquee-content {
    animation-duration: var(--testimony-duration, 30s);
}

.testimony-marquee-track[data-column="1"] .testimony-marquee-content {
    animation-duration: calc(var(--testimony-duration, 30s) * 0.7);
}

/* Hover is handled by JavaScript using playbackRate for smooth speed changes */

/* Keyframes for left scroll */
@keyframes marquee-scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Keyframes for right scroll */
@keyframes marquee-scroll-right {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Keyframes for up scroll */
@keyframes marquee-scroll-up {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* Keyframes for down scroll */
@keyframes marquee-scroll-down {
    0% {
        transform: translateY(-50%);
    }
    100% {
        transform: translateY(0);
    }
}

/* Testimony Card Styles */
.testimony-card-css {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 350px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimony-card-css:hover {
    transform: translateY(-4px);
    /*box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);*/
}

/* Ratings */
.testimony-card-css .ratings-wrapper {
    display: flex;
    gap: 4px;
    align-items: center;
}

.testimony-card-css .ratings-wrapper img {
    width: 20px;
    height: 20px;
}

/* Content */
.testimony-content-css {
    color: #333333;
    font-size: 15px;
    line-height: 1.6;
    flex-grow: 1;
}

.testimony-content-css p {
    margin: 0;
}

.testimony-content-css p:not(:last-child) {
    margin-bottom: 12px;
}

/* Author Section */
.testimony-author-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.testimony-image {
    flex-shrink: 0;
}

.testimony-image img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.testimony-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-weight: 600;
    font-size: 14px;
    color: #333333;
    margin: 0;
}

.author-job {
    font-size: 13px;
    color: #999999;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    /* Tablet responsive direction classes */
    .direction-tablet-left .testimony-marquee-content {
        animation-name: marquee-scroll-left !important;
    }

    .direction-tablet-right .testimony-marquee-content {
        animation-name: marquee-scroll-right !important;
    }

    .direction-tablet-up .testimony-marquee-content {
        animation-name: marquee-scroll-up !important;
    }

    .direction-tablet-down .testimony-marquee-content {
        animation-name: marquee-scroll-down !important;
    }

    /* Layout adjustments for tablet vertical directions */
    .direction-tablet-up,
    .direction-tablet-down {
        flex-direction: row;
    }

    .direction-tablet-up .testimony-marquee-track,
    .direction-tablet-down .testimony-marquee-track {
        flex-direction: column;
        height: 100%;
        min-height: 400px;
    }

    .direction-tablet-up .testimony-marquee-content,
    .direction-tablet-down .testimony-marquee-content {
        flex-direction: column;
    }

    /* Layout adjustments for tablet horizontal directions */
    .direction-tablet-left,
    .direction-tablet-right {
        flex-direction: column;
    }

    .direction-tablet-left .testimony-marquee-track,
    .direction-tablet-right .testimony-marquee-track {
        flex-direction: row;
        width: 100%;
    }

    .direction-tablet-left .testimony-marquee-content,
    .direction-tablet-right .testimony-marquee-content {
        flex-direction: row;
    }

    .smarteco-testimony-marquee-css::before {
        position: absolute;
        top: 0;
        bottom:0;
        left:0;
        right: auto;
        height: 100%;
        width: 20px;
        z-index: 10;
        background: #F3F6FC;
        background: -webkit-linear-gradient(90deg, rgba(243, 246, 252, 1) 0%, rgba(243, 246, 252, 0) 100%);
        background: -moz-linear-gradient(90deg, rgba(243, 246, 252, 1) 0%, rgba(243, 246, 252, 0) 100%);
        background: linear-gradient(90deg, rgba(243, 246, 252, 1) 0%, rgba(243, 246, 252, 0) 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#F3F6FC", endColorstr="#F3F6FC", GradientType=1);
        pointer-events: none;
    }

    .smarteco-testimony-marquee-css::after {
        position: absolute;
        top: 0;
        bottom:0;
        left:auto;
        right: 0;
        height: 100%;
        width: 20px;
        z-index: 10;
        background: #F3F6FC;
        background: -webkit-linear-gradient(270deg, rgba(243, 246, 252, 1) 0%, rgba(243, 246, 252, 0) 100%);
        background: -moz-linear-gradient(270deg, rgba(243, 246, 252, 1) 0%, rgba(243, 246, 252, 0) 100%);
        background: linear-gradient(270deg, rgba(243, 246, 252, 1) 0%, rgba(243, 246, 252, 0) 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#F3F6FC", endColorstr="#F3F6FC", GradientType=0);
        pointer-events: none;
    }
}

@media (max-width: 768px) {
    .testimony-card-css {
        min-width: 280px;
        max-width: 280px;
        padding: 20px;
    }

    .testimony-content-css {
        font-size: 14px;
    }

    .layout-vertical {
        gap: 15px;
    }

    /* Mobile responsive direction classes */
    .direction-mobile-left .testimony-marquee-content {
        animation-name: marquee-scroll-left !important;
    }

    .direction-mobile-right .testimony-marquee-content {
        animation-name: marquee-scroll-right !important;
    }

    .direction-mobile-up .testimony-marquee-content {
        animation-name: marquee-scroll-up !important;
    }

    .direction-mobile-down .testimony-marquee-content {
        animation-name: marquee-scroll-down !important;
    }

    /* Layout adjustments for mobile vertical directions */
    .direction-mobile-up,
    .direction-mobile-down {
        flex-direction: row;
    }

    .direction-mobile-up .testimony-marquee-track,
    .direction-mobile-down .testimony-marquee-track {
        flex-direction: column;
        height: 100%;
        min-height: 400px;
    }

    .direction-mobile-up .testimony-marquee-content,
    .direction-mobile-down .testimony-marquee-content {
        flex-direction: column;
    }

    /* Layout adjustments for mobile horizontal directions */
    .direction-mobile-left,
    .direction-mobile-right {
        flex-direction: column;
    }

    .direction-mobile-left .testimony-marquee-track,
    .direction-mobile-right .testimony-marquee-track {
        flex-direction: row;
        width: 100%;
    }

    .direction-mobile-left .testimony-marquee-content,
    .direction-mobile-right .testimony-marquee-content {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .testimony-card-css {
        min-width: 240px;
        max-width: 240px;
        padding: 16px;
    }

    .testimony-content-css {
        font-size: 13px;
    }

    .testimony-image img {
        width: 40px;
        height: 40px;
    }

    .author-name {
        font-size: 13px;
    }

    .author-job {
        font-size: 12px;
    }

    .layout-vertical {
        flex-direction: column;
        gap: 10px;
    }

    .layout-vertical .testimony-marquee-track {
        width: 100%;
    }
}

/* Elementor Editor Preview */
.elementor-editor-active .testimony-marquee-content {
    animation: none !important;
}

.elementor-editor-active .testimony-marquee-content {
    flex-wrap: wrap;
}
