/**
 * 情侣纪念日H5 - 动画样式文件
 * Created by Jason on 2026/01/12
 */

/* ==================== 爱心跳动动画 ==================== */

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.05);
    }
}

/* ==================== 爱心飘落动画 ==================== */

.heart {
    position: absolute;
    color: var(--heart-color);
    font-size: 20px;
    opacity: 0;
    pointer-events: none;
    animation: float-up 6s ease-in-out;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }
    10% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) rotate(360deg);
    }
}

/* ==================== 淡入动画 ==================== */

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* ==================== 滑入动画 ==================== */

.slide-in {
    animation: slideIn 0.4s ease-out;
}

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

/* ==================== 弹跳动画 ==================== */

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

@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);
    }
}

/* ==================== 数字增长动画 ==================== */

.number-grow {
    animation: numberGrow 1s ease-out;
}

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

/* ==================== 闪烁动画 ==================== */

.sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* ==================== 摇摆动画 ==================== */

.shake {
    animation: shake 0.5s ease-in-out;
}

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

/* ==================== 脉冲动画 ==================== */

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

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px var(--shadow-light);
    }
    50% {
        box-shadow: 0 8px 24px var(--shadow-medium);
    }
}

/* ==================== 旋转动画 ==================== */

.rotate {
    animation: rotate 0.3s ease-out;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(180deg);
    }
}

/* ==================== 缩放进入动画 ==================== */

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

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

/* ==================== 缩放退出动画 ==================== */

.zoom-out {
    animation: zoomOut 0.3s ease-out;
}

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

/* ==================== 模态框动画 ==================== */

.modal.show .modal-content {
    animation: modalSlideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==================== 卡片翻转动画 ==================== */

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

@keyframes flip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

/* ==================== 渐变背景动画 ==================== */

.gradient-animation {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ==================== 光晕效果 ==================== */

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px var(--primary-color),
                    0 0 20px var(--primary-color),
                    0 0 30px var(--primary-color);
    }
    50% {
        box-shadow: 0 0 20px var(--secondary-color),
                    0 0 40px var(--secondary-color),
                    0 0 60px var(--secondary-color);
    }
}

/* ==================== 波纹效果 ==================== */

.ripple {
    position: relative;
    overflow: hidden;
}

.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%);
    animation: ripple-effect 0.6s ease-out;
}

@keyframes ripple-effect {
    from {
        width: 0;
        height: 0;
        opacity: 1;
    }
    to {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* ==================== 卡片悬浮效果增强 ==================== */

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px var(--shadow-medium);
}

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

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* ==================== 响应式动画调整 ==================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
