/* 高级动画效果 */

/* 渐显动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

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

/* 波纹动画 */
@keyframes ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35),
                    0 0 0 10px rgba(34, 211, 238, 0.35),
                    0 0 0 20px rgba(34, 211, 238, 0.35);
    }
    100% {
        box-shadow: 0 0 0 10px rgba(34, 211, 238, 0.35),
                    0 0 0 20px rgba(34, 211, 238, 0.35),
                    0 0 0 40px rgba(34, 211, 238, 0);
    }
}

/* 应用类 - 简化动画 */
.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.4s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.4s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.4s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* 移除过度的动画效果 */
.animate-pulse {
    /* 禁用脉冲动画 */
}

.animate-float {
    /* 禁用浮动动画 */
}

/* 延迟动画 */
.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; }

/* 光泽效果 */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 3s infinite;
}

/* 悬浮发光效果 */
.glow-on-hover {
    transition: all 0.3s ease;
}

.glow-on-hover:hover {
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.45),
                0 0 40px rgba(59, 130, 246, 0.35),
                0 0 60px rgba(59, 130, 246, 0.2);
}

/* 玻璃态效果 */
.glass-morphism {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* 渐变文字 */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 渐变边框 */
.gradient-border {
    position: relative;
    background: white;
    border-radius: 20px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    padding: 2px;
    background: var(--primary-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* 3D卡片效果 */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

/* 涟漪按钮效果 */
.ripple-button {
    position: relative;
    overflow: hidden;
}

.ripple-button::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;
}

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

/* 页面加载动画 - 专业简洁 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 250, 252, 0.75);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* Fail-safe: if JS fails to run, still hide the overlay after a few seconds. */
    animation: cwLoaderFailSafe 0.01s linear 3s forwards;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes cwLoaderFailSafe {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid rgba(34, 211, 238, 0.9);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

.loader-text {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}
