/* ===================================
   Animations Stylesheet
   Advanced Animation Effects
   =================================== */

/* Fade In Animations - 默认全部可见，避免"加载遮罩"错觉；
   仅在 JS 主动添加 .visible 之后才播放动画增强效果 */
.fade-in,
.fade-in-left,
.fade-in-right,
.fade-in-up,
.fade-in-scale,
.scale-in,
.rotate-in,
.slide-in-bottom,
.stagger-item,
.smooth-reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.is-animating,
.fade-in-left.is-animating,
.fade-in-right.is-animating,
.fade-in-up.is-animating {
    opacity: 0;
    transform: translateY(30px);
}

.fade-in-left.is-animating { transform: translateX(-50px); }
.fade-in-right.is-animating { transform: translateX(50px); }
.fade-in-up.is-animating { transform: translateY(50px); }


/* Scale Animation */
.scale-in {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scale-in.is-animating {
    opacity: 0;
    transform: scale(0.8);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Animation */
.stagger-item {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-item.is-animating {
    opacity: 0;
    transform: translateY(30px);
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* Rotate Animation */
.rotate-in {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.rotate-in.is-animating {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Slide Animations */
.slide-in-bottom {
    transition: opacity 1s ease, transform 1s ease;
}

.slide-in-bottom.is-animating {
    opacity: 0;
    transform: translateY(100px);
}

.slide-in-bottom.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Morphing Background */
.morphing-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.morphing-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(220, 111, 55, 0.1);
    animation: morphing 20s infinite ease-in-out;
}

.morphing-shape:nth-child(1) {
    width: 400px;
    height: 400px;
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.morphing-shape:nth-child(2) {
    width: 300px;
    height: 300px;
    bottom: -150px;
    left: -150px;
    animation-delay: 5s;
}

.morphing-shape:nth-child(3) {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes morphing {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        border-radius: 50%;
    }
    33% {
        transform: translate(50px, -50px) scale(1.2);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
        border-radius: 70% 30% 50% 50% / 30% 60% 40% 70%;
    }
}

/* Glow Effect */
.glow-effect {
    position: relative;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    filter: blur(15px);
}

.glow-effect:hover::before {
    opacity: 0.7;
}

/* Text Reveal Animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.text-reveal.visible span {
    transform: translateY(0);
    opacity: 1;
}

.text-reveal.visible span:nth-child(1) { transition-delay: 0.1s; }
.text-reveal.visible span:nth-child(2) { transition-delay: 0.2s; }
.text-reveal.visible span:nth-child(3) { transition-delay: 0.3s; }
.text-reveal.visible span:nth-child(4) { transition-delay: 0.4s; }
.text-reveal.visible span:nth-child(5) { transition-delay: 0.5s; }

/* Counter Animation */
.counter {
    display: inline-block;
}

/* Parallax Effect */
.parallax-section {
    position: relative;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Hover Line Effect */
.hover-line {
    position: relative;
    display: inline-block;
}

.hover-line::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.5s ease;
    transform: translateX(-50%);
}

.hover-line:hover::after {
    width: 100%;
}

/* Shimmer Effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 111, 55, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(220, 111, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 111, 55, 0);
    }
}

/* Float Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Typing Animation */
.typing {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

/* Gradient Border Animation */
.gradient-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--gradient-primary) border-box;
    border-radius: 20px;
}

/* 3D Card Effect */
.card-3d {
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(-10deg);
}

/* Smooth Reveal */
.smooth-reveal {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1s ease;
}

.smooth-reveal.visible {
    clip-path: inset(0 0 0 0);
}

/* Wave Animation */
.wave {
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-20deg); }
}

/* Bounce In */
.bounce-in {
    animation: bounceIn 1s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Fade In Scale */
.fade-in-scale {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-scale.is-animating {
    opacity: 0;
    transform: scale(0.5);
}

.fade-in-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Slide In Left Right */
.slide-in-left-right {
    position: relative;
    overflow: hidden;
}

.slide-in-left-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
    z-index: 1;
}

.slide-in-left-right.visible::before {
    transform: translateX(100%);
}



/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: scrollMouse 2s infinite;
}

@keyframes scrollMouse {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    transform: translate(-50%, -50%);
}

.custom-cursor.hover {
    transform: translate(-50%, -50%) scale(2);
    background: rgba(220, 111, 55, 0.1);
}

/* Smooth Page Transition */
.page-transition {
    animation: pageTransition 0.8s ease;
}

@keyframes pageTransition {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-effect 3s infinite linear alternate-reverse;
    color: #ff00ff;
    z-index: -1;
}

.glitch::after {
    animation: glitch-effect 2s infinite linear alternate-reverse;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-effect {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Neon Glow */
.neon-glow {
    text-shadow: 
        0 0 7px rgba(220, 111, 55, 0.8),
        0 0 10px rgba(220, 111, 55, 0.6),
        0 0 21px rgba(220, 111, 55, 0.4),
        0 0 42px rgba(220, 111, 55, 0.2);
}

/* Tilt Effect */
.tilt-effect {
    transition: transform 0.5s ease;
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
}
