/**
 * 交互动画样式
 * Interactive Animations
 */

/* ============================================
   淡入动画
   ============================================ */
@keyframes fadeIn {
    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 fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   脉冲动画
   ============================================ */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--primary-color);
    }
    50% {
        box-shadow: 0 0 20px 10px transparent;
    }
}

/* ============================================
   弹跳动画
   ============================================ */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(-2px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   旋转动画
   ============================================ */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg) scale(0);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* ============================================
   闪烁动画
   ============================================ */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes glow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   摇晃动画
   ============================================ */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-3deg);
    }
    75% {
        transform: rotate(3deg);
    }
}

/* ============================================
   波纹动画
   ============================================ */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   渐变背景动画
   ============================================ */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ============================================
   悬浮动画
   ============================================ */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

/* ============================================
   滑入动画
   ============================================ */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ============================================
   工具类 - 应用动画
   ============================================ */
.animate-fadeIn {
    animation: fadeIn var(--transition-normal) ease-out;
}

.animate-fadeInScale {
    animation: fadeInScale var(--transition-normal) ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft var(--transition-normal) ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight var(--transition-normal) ease-out;
}

.animate-bounce {
    animation: bounce 0.6s ease-in-out;
}

.animate-bounceIn {
    animation: bounceIn 0.8s ease-out;
}

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

.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-shimmer {
    background: linear-gradient(
        90deg,
        var(--surface-color) 0%,
        var(--surface-hover) 50%,
        var(--surface-color) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

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

.animate-glow {
    animation: glow 2s ease-in-out 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; }

/* ============================================
   过渡效果
   ============================================ */
.transition-all {
    transition: all var(--transition-normal) ease;
}

.transition-transform {
    transition: transform var(--transition-normal) ease;
}

.transition-opacity {
    transition: opacity var(--transition-normal) ease;
}

.transition-colors {
    transition: background-color var(--transition-normal) ease,
                color var(--transition-normal) ease,
                border-color var(--transition-normal) ease;
}

/* ============================================
   悬停效果
   ============================================ */
.hover-lift {
    transition: transform var(--transition-normal) ease,
                box-shadow var(--transition-normal) ease;
}

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

.hover-scale {
    transition: transform var(--transition-fast) ease;
}

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

.hover-glow {
    transition: box-shadow var(--transition-normal) ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px var(--primary-color);
}

/* ============================================
   点击效果
   ============================================ */
.click-ripple {
    position: relative;
    overflow: hidden;
}

.click-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.click-ripple:active::after {
    width: 300px;
    height: 300px;
}

