/**
 * Music Scraper - 动画效果
 * 赛博朋克风格动效
 */

/* ==================== 基础动画关键帧 ==================== */

/* 淡入 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 淡入上滑 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 淡入下滑 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 淡入缩放 */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 弹入 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 滑入左 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 滑入右 */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 滑入底部 */
@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 霓虹发光动画 ==================== */

/* 霓虹呼吸 */
@keyframes neonBreath {
    0%, 100% {
        box-shadow: 0 0 5px var(--neon-cyan),
                    0 0 10px var(--neon-cyan),
                    0 0 20px var(--neon-cyan);
    }
    50% {
        box-shadow: 0 0 10px var(--neon-cyan),
                    0 0 20px var(--neon-cyan),
                    0 0 40px var(--neon-cyan),
                    0 0 80px var(--neon-cyan);
    }
}

/* 霓虹文字闪烁 */
@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 4px var(--neon-cyan),
            0 0 11px var(--neon-cyan),
            0 0 19px var(--neon-cyan);
        opacity: 1;
    }
    20%, 24%, 55% {
        text-shadow: none;
        opacity: 0.8;
    }
}

/* 渐变流动 */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 边框流光 */
@keyframes borderGlow {
    0%, 100% {
        border-color: var(--neon-cyan);
        box-shadow: 0 0 5px var(--neon-cyan);
    }
    33% {
        border-color: var(--neon-purple);
        box-shadow: 0 0 5px var(--neon-purple);
    }
    66% {
        border-color: var(--neon-pink);
        box-shadow: 0 0 5px var(--neon-pink);
    }
}

/* ==================== 特效动画 ==================== */

/* 故障效果 */
@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

/* 打字机效果 */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

/* 光标闪烁 */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 波纹扩散 */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* 旋转发光 */
@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ==================== 动画工具类 ==================== */

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.4s ease forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.4s ease forwards;
}

.animate-fadeInScale {
    animation: fadeInScale 0.3s ease forwards;
}

.animate-bounceIn {
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.animate-slideInLeft {
    animation: slideInLeft 0.3s ease forwards;
}

.animate-slideInRight {
    animation: slideInRight 0.3s ease forwards;
}

.animate-slideInBottom {
    animation: slideInBottom 0.3s ease forwards;
}

/* 霓虹效果 */
.animate-neonBreath {
    animation: neonBreath 2s ease-in-out infinite;
}

.animate-neonFlicker {
    animation: neonFlicker 3s linear infinite;
}

.animate-gradientFlow {
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
}

.animate-borderGlow {
    animation: borderGlow 3s ease infinite;
}

/* 特效 */
.animate-glitch {
    animation: glitch 0.3s ease infinite;
}

/* ==================== 延迟动画 ==================== */

.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; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ==================== 交互过渡 ==================== */

/* 悬停放大 */
.hover-scale {
    transition: transform var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* 悬停发光 */
.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: var(--glow-cyan);
}

/* 点击缩小 */
.active-shrink:active {
    transform: scale(0.95);
}

/* ==================== 页面切换动画 ==================== */

.page-enter {
    animation: fadeInUp 0.4s ease forwards;
}

.page-leave {
    animation: fadeIn 0.3s ease reverse forwards;
}

/* ==================== 列表项动画 ==================== */

.list-item-enter {
    opacity: 0;
    transform: translateX(-20px);
}

.list-item-enter-active {
    animation: slideInLeft 0.3s ease forwards;
}

/* 列表项交错动画 */
.stagger-item {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

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

/* ==================== 骨架屏动画 ==================== */

.skeleton {
    background: linear-gradient(90deg,
        var(--bg-secondary) 25%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease infinite;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== 粒子背景（可选） ==================== */

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--neon-cyan);
    border-radius: 50%;
    opacity: 0.5;
    animation: particleFloat 10s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

