/**
 * Advanced Popup Manager - Ticker Styles (Premium)
 *
 * @package AdvancedPopupManager
 */

/* Ticker Container - Premium */
.apm-ticker-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.apm-ticker-container:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Ticker Wrapper */
.apm-ticker-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Ticker Content */
.apm-ticker-content {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    height: 100%;
}

/* Individual Messages - Premium */
.apm-ticker-message {
    display: inline-flex;
    align-items: center;
    padding: 0 3em;
    position: relative;
    font-weight: 500;
    letter-spacing: 0.3px;
    height: 100%;
}

.apm-ticker-message:not(:last-child)::after {
    content: '◆';
    position: absolute;
    right: 1.5em;
    opacity: 0.4;
    font-size: 0.6em;
    top: 50%;
    transform: translateY(-50%);
}

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

@keyframes apm-ticker-scroll-right {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Apply animations when ticker is initialized */
.apm-ticker-container.apm-ticker-initialized .apm-ticker-content {
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Direction: Left (default) */
.apm-ticker-container.apm-ticker-initialized[data-direction="left"] .apm-ticker-content {
    animation-name: apm-ticker-scroll-left;
}

/* Direction: Right */
.apm-ticker-container.apm-ticker-initialized[data-direction="right"] .apm-ticker-content {
    animation-name: apm-ticker-scroll-right;
}

/* Pause on Hover */
.apm-ticker-container[data-pause-hover="1"]:hover .apm-ticker-content {
    animation-play-state: paused;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .apm-ticker-message {
        padding: 0 2em;
        font-size: 0.95em;
    }

    .apm-ticker-message:not(:last-child)::after {
        right: 1em;
    }
}

@media screen and (max-width: 480px) {
    .apm-ticker-message {
        padding: 0 1.5em;
        font-size: 0.9em;
    }

    .apm-ticker-message:not(:last-child)::after {
        right: 0.75em;
    }
}

/* Print - Hide Ticker */
@media print {
    .apm-ticker-container {
        display: none !important;
    }
}

/* Loading state - but show content after 500ms if JS doesn't load */
.apm-ticker-container:not(.apm-ticker-initialized) .apm-ticker-content {
    opacity: 0;
    animation: apm-ticker-fallback-show 0.5s 0.5s forwards;
}

@keyframes apm-ticker-fallback-show {
    to { opacity: 1; }
}

.apm-ticker-container.apm-ticker-initialized .apm-ticker-content {
    opacity: 1;
    transition: opacity 0.3s ease;
    animation: none;
}

/* Fallback animation if JS doesn't load */
.apm-ticker-container:not(.apm-ticker-initialized)[data-direction="left"] .apm-ticker-content {
    animation: apm-ticker-scroll-left 30s linear infinite, apm-ticker-fallback-show 0.5s 0.5s forwards;
}

.apm-ticker-container:not(.apm-ticker-initialized)[data-direction="right"] .apm-ticker-content {
    animation: apm-ticker-scroll-right 30s linear infinite, apm-ticker-fallback-show 0.5s 0.5s forwards;
}
