/* ================================================
   Beijing Kesier Technology Development Co., Ltd.
   Animations Stylesheet
   ================================================ */

/* Text Reveal Animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: textReveal 0.8s ease forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(
        90deg,
        var(--accent-color) 0%,
        #4fd9be 25%,
        var(--accent-color) 50%,
        #4fd9be 75%,
        var(--accent-color) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 3s linear infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Floating Animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Glow Pulse */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(100, 255, 218, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(100, 255, 218, 0.8));
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(100, 255, 218, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.ripple:active::after {
    animation: rippleEffect 0.6s ease-out;
}

@keyframes rippleEffect {
    0% {
        transform: scale(0) translate(-50%, -50%);
        opacity: 1;
    }
    100% {
        transform: scale(100) translate(-50%, -50%);
        opacity: 0;
    }
}

/* Magnetic Effect */
.magnetic {
    transition: transform 0.3s ease;
}

/* Line Drawing Animation */
.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s ease forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* Fill Animation */
.fill-animation {
    fill: transparent;
    animation: fillColor 1s ease forwards 0.5s;
}

@keyframes fillColor {
    to {
        fill: var(--accent-color);
    }
}

/* Typing Animation */
.typing {
    overflow: hidden;
    border-right: 3px solid var(--accent-color);
    white-space: nowrap;
    animation: typing 3s steps(30) forwards, blink 0.5s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Scale on Hover */
.scale-hover {
    transition: transform 0.3s ease;
}

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

/* Rotate on Hover */
.rotate-hover {
    transition: transform 0.3s ease;
}

.rotate-hover:hover {
    transform: rotate(360deg);
}

/* Slide Underline */
.slide-underline {
    position: relative;
}

.slide-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.slide-underline:hover::after {
    width: 100%;
}

/* Particle Animation Container */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 15s infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* Counter Animation */
.counter {
    display: inline-block;
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(100, 255, 218, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Page Transition */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    z-index: 9999;
    transform: translateX(-100%);
}

.page-transition.active {
    animation: pageSlideOut 0.5s ease forwards;
}

.page-transition.exit {
    animation: pageSlideIn 0.5s ease forwards;
}

@keyframes pageSlideOut {
    to {
        transform: translateX(0);
    }
}

@keyframes pageSlideIn {
    to {
        transform: translateX(100%);
    }
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-color);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* Parallax Effect */
.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.parallax-layer-1 {
    transform: translateZ(-1px) scale(2);
}

.parallax-layer-2 {
    transform: translateZ(-2px) scale(3);
}

/* Hover Card Effect */
.hover-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.hover-card:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(-5deg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item.visible {
    animation: staggerFadeIn 0.5s ease forwards;
}

@keyframes staggerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Marquee Animation */
.marquee {
    display: flex;
    overflow: hidden;
    user-select: none;
}

.marquee-content {
    display: flex;
    animation: marquee 30s linear infinite;
}

.marquee-content:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Morph Shape Animation */
.morph-shape {
    animation: morphShape 8s ease-in-out infinite;
}

@keyframes morphShape {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Image Reveal */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    z-index: 1;
    transform: translateX(0);
}

.image-reveal.revealed::before {
    animation: imageReveal 1s ease forwards;
}

@keyframes imageReveal {
    to {
        transform: translateX(100%);
    }
}

/* Number Counter Animation */
.count-up {
    display: inline-block;
}

/* Button Morph Effect */
.btn-morph {
    position: relative;
    overflow: hidden;
}

.btn-morph::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-morph:hover::before {
    width: 300px;
    height: 300px;
}

/* Hero Background Animation */
.hero-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-bg-animation .shape {
    position: absolute;
    opacity: 0.1;
    animation: shapeFloat 20s ease-in-out infinite;
}

.hero-bg-animation .shape:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.hero-bg-animation .shape:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: -5s;
}

.hero-bg-animation .shape:nth-child(3) {
    top: 40%;
    left: 50%;
    animation-delay: -10s;
}

.hero-bg-animation .shape:nth-child(4) {
    top: 80%;
    left: 20%;
    animation-delay: -15s;
}

@keyframes shapeFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(20px, -30px) rotate(90deg);
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg);
    }
    75% {
        transform: translate(30px, 30px) rotate(270deg);
    }
}

/* Card Flip Animation */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Sequence Animation */
.sequence-frame {
    opacity: 0;
}

.sequence-frame.visible {
    animation: sequenceFade 0.5s ease forwards;
}

/* Smooth Scroll to Section */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* Link Underline Animation */
.link-underline {
    position: relative;
}

.link-underline::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.link-underline:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Icon Bounce */
.icon-bounce:hover {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loadingDot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Video Background Placeholder Animation */
.video-placeholder {
    position: relative;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.video-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(100, 255, 218, 0.1) 50%,
        transparent 100%
    );
    animation: videoShimmer 2s infinite;
}

@keyframes videoShimmer {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* 3D Tilt Effect */
.tilt-effect {
    transform-style: preserve-3d;
    transition: transform 0.1s ease;
}

/* Cursor Trail */
.cursor-trail {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.5;
    z-index: 9998;
}