/* ========================================
   Beijing Jingbaodi - Animations
   Premium Animation Effects
   ======================================== */

/* Scroll Animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

.fade-in-up {
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

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

.fade-in-down {
    opacity: 0;
    animation: fadeInDown 1s ease forwards;
}

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

.fade-in-left {
    opacity: 0;
    animation: fadeInLeft 1s ease forwards;
}

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

.fade-in-right {
    opacity: 0;
    animation: fadeInRight 1s ease forwards;
}

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

/* Scale Animations */
.scale-in {
    opacity: 0;
    animation: scaleIn 0.6s ease forwards;
}

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

.scale-in-hover {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scale-in-hover:hover {
    transform: scale(1.05);
}

/* Slide Animations */
.slide-in-left {
    opacity: 0;
    animation: slideInLeft 0.8s ease forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    opacity: 0;
    animation: slideInRight 0.8s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-top {
    opacity: 0;
    animation: slideInTop 0.8s ease forwards;
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-bottom {
    opacity: 0;
    animation: slideInBottom 0.8s ease forwards;
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bounce Animations */
.bounce-in {
    animation: bounceIn 1s ease forwards;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

/* Pulse Animations */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(26, 95, 42, 0.4);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(26, 95, 42, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(26, 95, 42, 0);
    }
}

.pulse-glow {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(26, 95, 42, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(26, 95, 42, 0.6);
    }
}

/* Rotate Animations */
.rotate {
    animation: rotate 20s linear infinite;
}

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

.rotate-reverse {
    animation: rotateReverse 20s linear infinite;
}

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

/* Float Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

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

.float-slow {
    animation: float 8s ease-in-out infinite;
}

.float-fast {
    animation: float 4s ease-in-out infinite;
}

/* Shimmer Effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

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

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

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

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

/* Letter Spacing Animation */
.letter-spacing {
    animation: letterSpacing 3s ease forwards;
}

@keyframes letterSpacing {
    from {
        letter-spacing: -0.5em;
    }
    to {
        letter-spacing: 0.1em;
    }
}

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

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

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

/* Counter Animation */
.counter {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.counter.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax Effects */
.parallax {
    transition: transform 0.1s ease-out;
}

.parallax-slow {
    transform: translateY(0);
    transition: transform 0.3s ease-out;
}

.parallax-medium {
    transform: translateY(0);
    transition: transform 0.2s ease-out;
}

.parallax-fast {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

/* Stagger Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }
.delay-900 { animation-delay: 900ms; }
.delay-1000 { animation-delay: 1000ms; }

/* Duration Classes */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.5s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 1.5s; }
.duration-slowest { animation-duration: 2s; }

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-shrink {
    transition: transform 0.3s ease;
}

.hover-shrink:hover {
    transform: scale(0.95);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

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

.hover-flip {
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

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

/* Image Effects */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

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

.img-grayscale {
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}

.img-grayscale:hover {
    filter: grayscale(0%);
}

.img-blur {
    filter: blur(5px);
    transition: filter 0.5s ease;
}

.img-blur:hover {
    filter: blur(0);
}

/* Background Animations */
.bg-gradient-shift {
    background: linear-gradient(-45deg, #1a5f2a, #2d8f47, #f5a623, #1a5f2a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

.bg-pulse-slow {
    animation: bgPulse 4s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% {
        background-color: rgba(26, 95, 42, 0.1);
    }
    50% {
        background-color: rgba(26, 95, 42, 0.2);
    }
}

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

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

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

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

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

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

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

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

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

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

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

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

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

/* Magnetic Button Effect */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s ease;
}

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

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

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

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

/* Elastic Animation */
.elastic {
    animation: elastic 1s ease forwards;
}

@keyframes elastic {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-10px);
    }
    70% {
        transform: scale(0.95) translateY(5px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

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

.sequence-item.animate {
    animation: sequenceIn 0.6s ease forwards;
}

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

/* Page Transition */
.page-transition {
    animation: pageIn 0.5s ease forwards;
}

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

/* Smooth Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Hero Text Animation */
.hero-text-line {
    overflow: hidden;
}

.hero-text-word {
    display: inline-block;
    transform: translateY(100%);
    animation: heroReveal 1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.hero-text-word:nth-child(1) { animation-delay: 0.1s; }
.hero-text-word:nth-child(2) { animation-delay: 0.2s; }
.hero-text-word:nth-child(3) { animation-delay: 0.3s; }
.hero-text-word:nth-child(4) { animation-delay: 0.4s; }
.hero-text-word:nth-child(5) { animation-delay: 0.5s; }

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

/* Mobile Menu Animation */
.mobile-menu-enter {
    animation: menuEnter 0.4s ease forwards;
}

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

/* Icon Animations */
.icon-spin {
    animation: iconSpin 2s linear infinite;
}

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

.icon-beat {
    animation: iconBeat 1s ease infinite;
}

@keyframes iconBeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.icon-flip {
    animation: iconFlip 1s ease infinite;
}

@keyframes iconFlip {
    0%, 100% {
        transform: scaleX(1);
    }
    50% {
        transform: scaleX(-1);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-animate {
        opacity: 1;
        transform: none;
    }
}
