/**
 * KuroStream Animations & Motion Effects
 * Provides 60fps micro-interactions, smooth hover lifts, neon glow pulses,
 * marquee animations, skeleton shimmers, and carousel transitions.
 */

/* ── Smooth Transitions ─────────────────────────────────────────────────── */
.transition-smooth {
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.transition-bounce {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Glow & Pulse Keyframes ────────────────────────────────────────────── */
@keyframes neon-pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(var(--accent-primary-rgb), 0.35),
                    inset 0 0 15px rgba(var(--accent-primary-rgb), 0.15);
    }
    50% {
        box-shadow: 0 0 30px rgba(var(--accent-primary-rgb), 0.7),
                    inset 0 0 25px rgba(var(--accent-primary-rgb), 0.3);
    }
}

.animate-neon-pulse {
    animation: neon-pulse 3s infinite ease-in-out;
}

@keyframes float-slow {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

.animate-float {
    animation: float-slow 4s infinite ease-in-out;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 18s linear infinite;
}

/* ── Spotlight Progress Bar ────────────────────────────────────────────── */
@keyframes progress-fill {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

.animate-progress {
    animation: progress-fill 6s linear infinite;
}

/* ── Shimmer Skeleton Loader ───────────────────────────────────────────── */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-surface) 25%,
        var(--bg-surface-elevated) 50%,
        var(--bg-surface) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite linear;
}

/* ── Anime Card Hover Transformations ──────────────────────────────────── */
.anime-card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center bottom;
}

.anime-card:hover {
    transform: translateY(-6px) scale(1.02);
}

.anime-card .poster-img {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.3s ease;
}

.anime-card:hover .poster-img {
    transform: scale(1.08);
}

.anime-card .overlay-actions {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.anime-card:hover .overlay-actions {
    opacity: 1;
    transform: translateY(0);
}

/* ── Play Button Pulse ─────────────────────────────────────────────────── */
@keyframes play-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--accent-primary-rgb), 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 14px rgba(var(--accent-primary-rgb), 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--accent-primary-rgb), 0);
    }
}

.play-btn-pulse {
    animation: play-pulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

/* ── Live Airing Dot Pulse ─────────────────────────────────────────────── */
@keyframes live-ping {
    75%, 100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.animate-live-ping {
    animation: live-ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ── Custom Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ── Glassmorphism Utility Classes ─────────────────────────────────────── */
.glass-panel {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-subtle);
}

.glass-dropdown {
    background: rgba(15, 17, 26, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* ── Reduced Motion Accessibility ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

[data-motion='reduced'] *,
[data-motion='reduced'] ::before,
[data-motion='reduced'] ::after {
    animation: none !important;
    transition: none !important;
}
