/* ===== Keyframe Animations ===== */

/* ===== Enhanced Particle Animations ===== */

/* Original Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

/* Particle Float Animation 1 - Gentle Vertical Movement */
@keyframes particleFloat1 {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-30px) translateX(10px);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-15px) translateX(-5px);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-40px) translateX(15px);
        opacity: 0.8;
    }
}

/* Particle Float Animation 2 - Diagonal Movement */
@keyframes particleFloat2 {
    0%, 100% {
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0.4;
    }
    33% {
        transform: translateY(-25px) translateX(-20px) scale(1.2);
        opacity: 0.6;
    }
    66% {
        transform: translateY(-10px) translateX(25px) scale(0.8);
        opacity: 0.5;
    }
}

/* Particle Float Animation 3 - Circular Movement */
@keyframes particleFloat3 {
    0% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(20px) rotate(90deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-40px) translateX(0px) rotate(180deg);
        opacity: 0.4;
    }
    75% {
        transform: translateY(-20px) translateX(-20px) rotate(270deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(0px) translateX(0px) rotate(360deg);
        opacity: 0.3;
    }
}

/* Particle Float Animation 4 - Wave Movement */
@keyframes particleFloat4 {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.5;
    }
    20% {
        transform: translateY(-15px) translateX(8px);
        opacity: 0.7;
    }
    40% {
        transform: translateY(-30px) translateX(-5px);
        opacity: 0.4;
    }
    60% {
        transform: translateY(-20px) translateX(12px);
        opacity: 0.8;
    }
    80% {
        transform: translateY(-35px) translateX(-8px);
        opacity: 0.6;
    }
}

/* Particle Float Animation 5 - Spiral Movement */
@keyframes particleFloat5 {
    0% {
        transform: translateY(0px) translateX(0px) rotate(0deg) scale(1);
        opacity: 0.4;
    }
    25% {
        transform: translateY(-15px) translateX(15px) rotate(90deg) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-30px) translateX(0px) rotate(180deg) scale(0.9);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-15px) translateX(-15px) rotate(270deg) scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0px) translateX(0px) rotate(360deg) scale(1);
        opacity: 0.4;
    }
}

/* Particle Float Animation 6 - Large Slow Movement */
@keyframes particleFloat6 {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.2;
    }
    50% {
        transform: translateY(-50px) translateX(30px);
        opacity: 0.4;
    }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right Animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Typing Animation */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: #64ffda;
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

/* Slide In Animation */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(100, 255, 218, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(100, 255, 218, 0.6);
    }
}

/* ===== Animation Classes ===== */

/* Fade Animations */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

/* Delay Classes */
.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;
}

/* Typing Effect */
.typing-text {
    display: inline-block;
    overflow: hidden;
    border-right: 3px solid #64ffda;
    white-space: nowrap;
    animation: typing 3s steps(30, end), blink 1s infinite;
}

/* Hover Animations */
.hover-float:hover {
    animation: float 2s ease-in-out infinite;
}

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

.hover-bounce:hover {
    animation: bounce 1s ease-in-out;
}

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

/* Background Animations */
.animated-gradient {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Loading Animations */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #64ffda;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Navbar Animation */
.navbar-slide {
    animation: slideInDown 0.8s ease-out;
}

/* Button Animations */
.btn-animate {
    position: relative;
    overflow: hidden;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-animate:hover::before {
    left: 100%;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Text Animations */
.text-glow {
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
}

.text-gradient {
    background: linear-gradient(45deg, #64ffda, #00bcd4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Enhanced Particle System ===== */

/* Base Particle Styles */
.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Particle Type 1 - Small Cyan */
.particle-small-cyan {
    width: 2px;
    height: 2px;
    background: rgba(100, 255, 218, 0.7);
    animation: particleFloat1 12s ease-in-out infinite;
}

/* Particle Type 2 - Medium Cyan */
.particle-medium-cyan {
    width: 4px;
    height: 4px;
    background: rgba(100, 255, 218, 0.5);
    animation: particleFloat2 15s ease-in-out infinite;
}

/* Particle Type 3 - Large Cyan */
.particle-large-cyan {
    width: 6px;
    height: 6px;
    background: rgba(100, 255, 218, 0.4);
    animation: particleFloat3 18s ease-in-out infinite;
}

/* Particle Type 4 - Small Blue */
.particle-small-blue {
    width: 3px;
    height: 3px;
    background: rgba(0, 188, 212, 0.6);
    animation: particleFloat4 14s ease-in-out infinite;
}

/* Particle Type 5 - Medium Blue */
.particle-medium-blue {
    width: 5px;
    height: 5px;
    background: rgba(0, 188, 212, 0.4);
    animation: particleFloat5 16s ease-in-out infinite;
}

/* Particle Type 6 - Large Blue */
.particle-large-blue {
    width: 8px;
    height: 8px;
    background: rgba(0, 188, 212, 0.3);
    animation: particleFloat6 20s ease-in-out infinite;
}

/* Particle Type 7 - Glowing Cyan */
.particle-glow-cyan {
    width: 4px;
    height: 4px;
    background: rgba(100, 255, 218, 0.8);
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
    animation: particleGlow 10s ease-in-out infinite;
}

/* Particle Type 8 - Glowing Blue */
.particle-glow-blue {
    width: 3px;
    height: 3px;
    background: rgba(0, 188, 212, 0.8);
    box-shadow: 0 0 8px rgba(0, 188, 212, 0.4);
    animation: particleGlow2 13s ease-in-out infinite;
}

/* ===== Glowing Particle Animations ===== */

/* Glow Animation 1 - Pulsing Glow */
@keyframes particleGlow {
    0%, 100% {
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0.6;
        box-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
    }
    25% {
        transform: translateY(-20px) translateX(10px) scale(1.2);
        opacity: 0.8;
        box-shadow: 0 0 20px rgba(100, 255, 218, 0.8);
    }
    50% {
        transform: translateY(-35px) translateX(-5px) scale(0.9);
        opacity: 0.4;
        box-shadow: 0 0 5px rgba(100, 255, 218, 0.3);
    }
    75% {
        transform: translateY(-15px) translateX(15px) scale(1.1);
        opacity: 0.9;
        box-shadow: 0 0 15px rgba(100, 255, 218, 0.7);
    }
}

/* Glow Animation 2 - Blue Pulsing */
@keyframes particleGlow2 {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 0.5;
        box-shadow: 0 0 8px rgba(0, 188, 212, 0.4);
    }
    33% {
        transform: translateY(-25px) translateX(-10px);
        opacity: 0.8;
        box-shadow: 0 0 16px rgba(0, 188, 212, 0.7);
    }
    66% {
        transform: translateY(-10px) translateX(20px);
        opacity: 0.3;
        box-shadow: 0 0 4px rgba(0, 188, 212, 0.2);
    }
}

/* ===== Interactive Particle Effects ===== */

/* Particle Attraction Animation */
@keyframes particleAttract {
    0% {
        transform: translateY(0px) translateX(0px) scale(1);
    }
    100% {
        transform: translateY(-20px) translateX(-20px) scale(1.5);
    }
}

/* Particle Repulsion Animation */
@keyframes particleRepel {
    0% {
        transform: translateY(0px) translateX(0px) scale(1);
    }
    100% {
        transform: translateY(30px) translateX(30px) scale(0.5);
    }
}

/* Particle Fade In */
@keyframes particleFadeIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Particle Fade Out */
@keyframes particleFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* Progress Bar Animation */
@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-width);
    }
}

.progress-bar {
    animation: progressFill 2s ease-out forwards;
}

/* Ripple Effect */
.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.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

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

/* Smooth Transitions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Entrance Animations */
.entrance-fade {
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.entrance-slide {
    transform: translateX(-100px);
    opacity: 0;
    animation: fadeInLeft 1s ease-out 0.3s forwards;
}

.entrance-scale {
    transform: scale(0);
    opacity: 0;
    animation: scaleIn 0.8s ease-out 0.4s forwards;
}

/* ===== Mobile Performance Optimizations ===== */
@media (max-width: 768px) {
    .particle {
        /* 移动设备上简化动画以提高性能 */
        animation-duration: 8s !important;
    }

    .particle-glow-cyan,
    .particle-glow-blue {
        /* 移动设备上移除发光效果以节省性能 */
        box-shadow: none !important;
    }
}

/* ===== Reduced Motion Support ===== */
@media (prefers-reduced-motion: reduce) {
    .particle {
        animation: none !important;
        opacity: 0.3 !important;
    }
}

/* ===== High Performance Mode ===== */
@media (max-width: 480px) {
    .particle-large-cyan,
    .particle-large-blue,
    .particle-glow-cyan,
    .particle-glow-blue {
        /* 在小屏幕设备上隐藏大粒子和发光粒子 */
        display: none !important;
    }
}
