/**
 * Sports Ticker Styles
 *
 * Real-time sports ticker with live scores and goal animations
 *
 * @package StreamBox
 * @since 0.1.0
 */

/* ==========================================================================
   Ticker Container
   ========================================================================== */
.sports-ticker {
    position: relative;
    width: 100%;
    height: 60px;
    background: #0B0B1E;
    border-bottom: 1px solid rgba(157, 78, 255, 0.3);
    overflow: hidden;
}

/* ==========================================================================
   Live Badge
   ========================================================================== */
.sports-ticker__badge {
    position: absolute;
    top: 50%;
    left: 24px;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.2);
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.9);
    }
}

.badge-text {
    font-size: 11px;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   Ticker Track
   ========================================================================== */
.sports-ticker__track-wrapper {
    position: absolute;
    top: 0;
    left: 180px;
    right: 0;
    height: 100%;
    overflow: hidden;
}

.sports-ticker__track {
    display: flex;
    gap: 48px;
    height: 100%;
    align-items: center;
    animation: ticker-scroll 30s linear infinite;
    will-change: transform;
}

.sports-ticker__track[data-paused="true"] {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Pause on hover */
.sports-ticker:hover .sports-ticker__track {
    animation-play-state: paused;
}

/* ==========================================================================
   Ticker Items
   ========================================================================== */
.ticker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    font-size: 14px;
    color: #fff;
}

/* Live Match Item */
.ticker-item--live {
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    border-left: 3px solid #22c55e;
}

.ticker-item__league {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: #22c55e;
}

.ticker-item__teams {
    font-weight: 600;
}

.ticker-item__status {
    font-size: 12px;
    color: #22c55e;
    font-weight: 700;
}

/* News Item */
.ticker-item--news {
    padding: 6px 12px;
}

.ticker-item__icon {
    font-size: 16px;
}

.ticker-item__link {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ticker-item__link:hover {
    color: #ec4899;
}

/* Loading State */
.ticker-item--loading {
    color: #6b7280;
    font-style: italic;
}

/* Live Match Item - Enhanced */
.ticker-item--live {
    padding: 6px 12px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    border-left: 3px solid #22c55e;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ticker-item--live:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateY(-1px);
}

.ticker-item__live-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    background: #ef4444;
    border-radius: 3px;
    color: #fff;
    text-transform: uppercase;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.ticker-item__team {
    font-weight: 600;
    color: #fff;
}

.ticker-item__score {
    font-weight: 700;
    font-size: 16px;
    color: #22c55e;
    padding: 0 8px;
}

.ticker-item__time {
    font-size: 11px;
    color: #a3e635;
    font-weight: 600;
    padding: 2px 6px;
    background: rgba(163, 230, 53, 0.15);
    border-radius: 3px;
}

.ticker-item__text {
    color: #fff;
}

/* News Item - Enhanced */
.ticker-item--news {
    padding: 6px 12px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ticker-item--news:hover {
    color: #ec4899;
}

.ticker-item--news:hover .ticker-item__text {
    color: #ec4899;
}

/* ==========================================================================
   Goal Animation Overlay
   ========================================================================== */
.goal-animation {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.95);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 20;
}

.goal-animation.active {
    opacity: 1;
    transform: scale(1);
}

.goal-text {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: goal-bounce 0.6s ease;
}

@keyframes goal-bounce {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ==========================================================================
   Mute Toggle Button
   ========================================================================== */
.sports-ticker__mute {
    position: absolute;
    bottom: 8px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sports-ticker__mute:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.sports-ticker__mute:active {
    transform: scale(0.95);
}

.sports-ticker__mute:focus {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

.sports-ticker__mute[data-muted="true"] {
    background: rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   Skeleton Loader
   ========================================================================== */
.sports-ticker__skeleton {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    height: 100%;
}

.skeleton-badge {
    width: 120px;
    height: 32px;
    background: linear-gradient(90deg, #1a1a2e 25%, #2a2a3e 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 16px;
}

.skeleton-text {
    flex: 1;
    height: 20px;
    background: linear-gradient(90deg, #1a1a2e 25%, #2a2a3e 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .sports-ticker {
        height: 50px;
    }

    .sports-ticker__badge {
        left: 16px;
        padding: 6px 12px;
    }

    .badge-text {
        font-size: 10px;
    }

    .sports-ticker__track-wrapper {
        left: 140px;
    }

    .ticker-item {
        font-size: 13px;
        gap: 8px;
    }

    .goal-text {
        font-size: 24px;
    }

    .sports-ticker__mute {
        bottom: 7px;
        right: 8px;
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .sports-ticker {
        height: 44px;
    }

    .sports-ticker__badge {
        padding: 4px 10px;
    }

    .badge-dot {
        width: 6px;
        height: 6px;
    }

    .sports-ticker__track-wrapper {
        left: 120px;
    }

    .ticker-item {
        font-size: 12px;
    }

    .ticker-item__league {
        display: none;
    }

    .goal-text {
        font-size: 20px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .sports-ticker__track {
        animation: none;
    }

    .goal-animation {
        transition: none;
    }

    .goal-text {
        animation: none;
    }

    .badge-dot {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .sports-ticker {
        border-bottom: 2px solid #fff;
    }

    .sports-ticker__badge {
        border: 2px solid #ef4444;
    }

    .ticker-item--live {
        border-left: 4px solid #22c55e;
    }
}
