/**
 * Crypto Ticker Block Styles
 */

.crypto-news-crypto-ticker-block {
    width: 100%;
    background: var(--wp--preset--color--background, #fff);
    border-bottom: 1px solid var(--wp--preset--color--foreground, #e0e0e0);
    padding: 14px 0;
    overflow: hidden;
    position: relative;
}

body.is-dark .crypto-news-crypto-ticker-block {
    background: var(--color-header);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.crypto-news-ticker-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px);
    overflow: hidden;
    position: relative;
}

.crypto-news-ticker-items {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-shrink: 0;
    width: max-content;
    animation: ticker-scroll 60s linear infinite;
    will-change: transform;
    animation-delay: 0s;
    animation-fill-mode: both;
}

/* Pause animation on hover */
.crypto-news-crypto-ticker-block:hover .crypto-news-ticker-items {
    animation-play-state: paused;
}

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

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .crypto-news-ticker-items {
        animation: none;
    }
    
    .crypto-news-ticker-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .crypto-news-ticker-items {
        flex-wrap: nowrap;
    }
}

.crypto-news-ticker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.4;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.crypto-news-ticker-item:hover {
    background-color: rgba(245, 165, 36, 0.08);
    transform: translateY(-1px);
}

body.is-dark .crypto-news-ticker-item:hover {
    background-color: rgba(245, 165, 36, 0.15);
}

.ticker-coin-name {
    font-weight: 700;
    color: var(--wp--preset--color--foreground, #1a1a1a);
    letter-spacing: -0.01em;
}

body.is-dark .ticker-coin-name {
    color: #f8fafc;
}

.ticker-price {
    font-weight: 600;
    color: var(--wp--preset--color--foreground, #1a1a1a);
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

body.is-dark .ticker-price {
    color: #f8fafc;
}

.ticker-change {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.ticker-change.positive {
    color: #16a34a;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.15) 0%, rgba(22, 163, 74, 0.1) 100%);
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.ticker-change.negative {
    color: #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.ticker-change.price-updated {
    animation: pricePulse 0.4s ease-out;
}

@keyframes pricePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Editor Preview Styles */
.crypto-news-ticker-preview {
    padding: 16px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 12px;
}

.ticker-header {
    margin-bottom: 12px;
}

.ticker-label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

.ticker-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.ticker-item-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
}

.ticker-coin-name {
    font-weight: 600;
}

.ticker-price-preview {
    color: #666;
}

.ticker-change-preview {
    color: #dc2626;
    font-size: 12px;
}

.ticker-more-preview {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.crypto-news-ticker-placeholder {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-top: 12px;
}

.crypto-news-ticker-error {
    padding: 16px;
    background: #fee;
    color: #c33;
    text-align: center;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .crypto-news-ticker-items {
        gap: 16px;
        animation-duration: 40s;
    }

    .crypto-news-ticker-item {
        font-size: 13px;
        gap: 6px;
        padding: 4px 8px;
    }

    .ticker-change {
        font-size: 11px;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .crypto-news-ticker-items {
        gap: 12px;
        animation-duration: 35s;
    }

    .crypto-news-ticker-item {
        font-size: 12px;
        gap: 4px;
        padding: 3px 6px;
    }

    .ticker-change {
        font-size: 10px;
        padding: 1px 4px;
    }
}

