/**
 * Marquee Anything Widget Styles
 * Symmetric animation logic
 */

.wml-marquee-anything {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.wml-ma-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.wml-ma-line {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.wml-ma-scroller {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Edge blur - only when enabled */
.wml-marquee-anything[data-blur="1"] .wml-ma-scroller {
    mask-image: linear-gradient(to right, transparent, white 10%, white 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, white 10%, white 90%, transparent);
}

.wml-ma-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    padding: 0;
    width: max-content;
}

.wml-ma-item {
    flex-shrink: 0;
}

.wml-ma-item>* {
    width: 100%;
    height: 100%;
}

.wml-ma-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    min-width: 300px;
    border: 2px dashed rgba(128, 128, 128, 0.3);
    border-radius: 12px;
    background: rgba(128, 128, 128, 0.05);
}

.wml-ma-placeholder p {
    color: rgba(128, 128, 128, 0.6);
    font-size: 14px;
    margin: 0;
}

/* 
 * Symmetric Animation Keyframes
 * Logic: Animate from a calculated start position to a calculated end position
 * Both positions are set via CSS variables from JS
 */
@keyframes wml-marquee-symmetric {
    0% {
        transform: translateX(var(--start-x));
    }

    100% {
        transform: translateX(var(--end-x));
    }
}

.wml-ma-list.wml-animate {
    animation: wml-marquee-symmetric var(--animation-duration, 40s) linear infinite;
}

.wml-marquee-anything.wml-pause-hover:hover .wml-ma-list {
    animation-play-state: paused;
}