/* =====================================================
   ANIMATIONS.CSS - Centralized Animation Library
   RoarZone TV Streaming Platform
   ===================================================== */

/* ===== CSS VARIABLES ===== */
:root {
    --anim-duration-fast: 0.2s;
    --anim-duration-normal: 0.3s;
    --anim-duration-slow: 0.5s;
    --anim-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --anim-timing-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ====================================================
   ENTRANCE ANIMATIONS
   ==================================================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn var(--anim-duration-normal) var(--anim-timing);
}

/* Slide Up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideUp {
    animation: slideUp var(--anim-duration-normal) var(--anim-timing);
}

/* Slide Down */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideDown {
    animation: slideDown var(--anim-duration-normal) var(--anim-timing);
}

/* Slide In (from bottom right - for shoutbox) */
@keyframes slideIn {
    from {
        transform: translateY(100%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.animate-slideIn {
    animation: slideIn 0.4s var(--anim-timing-bounce);
}

/* Slide Left */
@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slideLeft {
    animation: slideLeft var(--anim-duration-normal) var(--anim-timing);
}

/* Slide Right */
@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slideRight {
    animation: slideRight var(--anim-duration-normal) var(--anim-timing);
}

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-zoomIn {
    animation: zoomIn var(--anim-duration-normal) var(--anim-timing);
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.animate-bounceIn {
    animation: bounceIn 0.6s var(--anim-timing);
}

/* ====================================================
   HOVER & INTERACTIVE ANIMATIONS
   ==================================================== */

/* Pulse - for download button */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(229, 9, 20, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(229, 9, 20, 0);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Glow */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(229, 9, 20, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(229, 9, 20, 0.8), 0 0 30px rgba(229, 9, 20, 0.6);
    }
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Float */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Shake */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.animate-shake {
    animation: shake 0.5s;
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-rotate {
    animation: rotate 1s linear infinite;
}

/* ====================================================
   LOADING ANIMATIONS
   ==================================================== */

/* Spinner */
@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color, #e50914);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

/* Dots */
@keyframes dotPulse {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--primary-color, #e50914);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Wave */
@keyframes wave {

    0%,
    40%,
    100% {
        transform: scaleY(0.4);
    }

    20% {
        transform: scaleY(1);
    }
}

.loading-wave {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
    height: 40px;
}

.loading-wave span {
    width: 6px;
    height: 100%;
    background: var(--primary-color, #e50914);
    border-radius: 3px;
    animation: wave 1.2s ease-in-out infinite;
}

.loading-wave span:nth-child(2) {
    animation-delay: 0.1s;
}

.loading-wave span:nth-child(3) {
    animation-delay: 0.2s;
}

.loading-wave span:nth-child(4) {
    animation-delay: 0.3s;
}

.loading-wave span:nth-child(5) {
    animation-delay: 0.4s;
}

/* ====================================================
   SPECIAL EFFECTS
   ==================================================== */

/* Shimmer - for loading skeletons */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.animate-shimmer {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Neon */
@keyframes neon {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(229, 9, 20, 0.8),
            0 0 20px rgba(229, 9, 20, 0.6),
            0 0 30px rgba(229, 9, 20, 0.4);
    }

    50% {
        text-shadow: 0 0 20px rgba(229, 9, 20, 1),
            0 0 40px rgba(229, 9, 20, 0.8),
            0 0 60px rgba(229, 9, 20, 0.6);
    }
}

.animate-neon {
    animation: neon 1.5s ease-in-out infinite;
}

/* Glitch */
@keyframes glitch {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

.animate-glitch {
    animation: glitch 0.3s;
}

/* ====================================================
   UTILITY CLASSES
   ==================================================== */

/* Animation Delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Animation Durations */
.duration-fast {
    animation-duration: var(--anim-duration-fast) !important;
}

.duration-normal {
    animation-duration: var(--anim-duration-normal) !important;
}

.duration-slow {
    animation-duration: var(--anim-duration-slow) !important;
}

/* Infinite Loop */
.animate-infinite {
    animation-iteration-count: infinite;
}

/* Smooth Transitions (for hover effects) */
.transition-all {
    transition: all var(--anim-duration-normal) var(--anim-timing);
}

.transition-transform {
    transition: transform var(--anim-duration-normal) var(--anim-timing);
}

.transition-opacity {
    transition: opacity var(--anim-duration-normal) var(--anim-timing);
}

.transition-colors {
    transition: background-color var(--anim-duration-normal) var(--anim-timing), color var(--anim-duration-normal) var(--anim-timing);
}

/* Hover State Utilities */
.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.6);
}

/* ====================================================
   PERFORMANCE OPTIMIZATIONS
   ==================================================== */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU Acceleration Hints */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize for mobile */
@media (max-width: 768px) {
    :root {
        --anim-duration-fast: 0.15s;
        --anim-duration-normal: 0.25s;
        --anim-duration-slow: 0.4s;
    }
}