/* ===========================
   BMOON TV - Animations
   =========================== */

/* Channel Switch Animations */

/* Fade Transition */
.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.fade-in {
    animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Transition */
.slide-out-left {
    animation: slideOutLeft 0.3s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-out forwards;
}

.slide-in-left {
    animation: slideInLeft 0.4s ease-out forwards;
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Zoom Transition */
.zoom-out {
    animation: zoomOut 0.3s ease-out forwards;
}

.zoom-in {
    animation: zoomIn 0.4s ease-out forwards;
}

@keyframes zoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Flip Transition */
.flip-out {
    animation: flipOut 0.3s ease-out forwards;
}

.flip-in {
    animation: flipIn 0.4s ease-out forwards;
}

@keyframes flipOut {
    from {
        transform: rotateY(0deg);
        opacity: 1;
    }
    to {
        transform: rotateY(90deg);
        opacity: 0;
    }
}

@keyframes flipIn {
    from {
        transform: rotateY(-90deg);
        opacity: 0;
    }
    to {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* Static Effect Animation */
@keyframes staticEffect {
    0% {
        background-position: 0 0;
        opacity: 0.8;
    }
    25% {
        opacity: 0.6;
    }
    50% {
        background-position: 10px 10px;
        opacity: 0.9;
    }
    75% {
        opacity: 0.5;
    }
    100% {
        background-position: 0 0;
        opacity: 0.8;
    }
}

/* Button Press Effect */
.btn-press {
    animation: btnPress 0.2s ease;
}

@keyframes btnPress {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
}

/* Glow Pulse Effect */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 10px var(--glow-color);
    }
    50% {
        box-shadow: 0 0 25px var(--glow-color);
    }
}

/* Channel Number Animation */
.channel-number-change {
    animation: channelNumberBounce 0.3s ease;
}

@keyframes channelNumberBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Screen Flicker Effect */
@keyframes screenFlicker {
    0%, 100% {
        opacity: 1;
    }
    10%, 30%, 50%, 70%, 90% {
        opacity: 0.8;
    }
    20%, 40%, 60%, 80% {
        opacity: 1;
    }
}

.screen-flicker {
    animation: screenFlicker 0.5s ease;
}

/* Scan Line Effect */
@keyframes scanLine {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    animation: scanLine 2s linear infinite;
    pointer-events: none;
}

/* Loading Dots */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-gold);
    border-radius: 50%;
    animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--shadow-color);
}

/* Shake Animation (for errors) */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

/* Notification Slide */
@keyframes notificationSlide {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-slide {
    animation: notificationSlide 0.4s ease-out;
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-gold);
    opacity: 0;
    animation: ripple 0.6s ease;
}

/* Smooth Entry Animation */
.smooth-entry {
    animation: smoothEntry 0.6s ease-out;
}

@keyframes smoothEntry {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid Item Stagger */
.grid-stagger {
    animation: gridStagger 0.4s ease-out backwards;
}

@keyframes gridStagger {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply stagger delay with nth-child */
.grid-stagger:nth-child(1) { animation-delay: 0.05s; }
.grid-stagger:nth-child(2) { animation-delay: 0.1s; }
.grid-stagger:nth-child(3) { animation-delay: 0.15s; }
.grid-stagger:nth-child(4) { animation-delay: 0.2s; }
.grid-stagger:nth-child(5) { animation-delay: 0.25s; }
.grid-stagger:nth-child(6) { animation-delay: 0.3s; }
.grid-stagger:nth-child(7) { animation-delay: 0.35s; }
.grid-stagger:nth-child(8) { animation-delay: 0.4s; }
.grid-stagger:nth-child(9) { animation-delay: 0.45s; }

/* Utility Classes */
.no-animation {
    animation: none !important;
    transition: none !important;
}

.fast-transition {
    transition-duration: 0.15s !important;
}

.slow-transition {
    transition-duration: 0.6s !important;
}
