/* ============================================
   Jincheng Huaxia - Animations Stylesheet
   Rich Animation Effects - BMW Style
   ============================================ */

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

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

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

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

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

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

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

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

@keyframes scaleInBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

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

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

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

@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(20deg);
    }
    75% {
        transform: rotate(-20deg);
    }
}

@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.5;
    }
}

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

@keyframes parallax {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(20%);
    }
}

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

@keyframes borderGlow {
    0%, 100% {
        box-shadow: 0 0 5px var(--primary-blue),
                    0 0 10px var(--primary-blue),
                    0 0 15px var(--primary-blue);
    }
    50% {
        box-shadow: 0 0 10px var(--primary-blue),
                    0 0 20px var(--primary-blue),
                    0 0 30px var(--primary-blue);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

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

/* Animation Classes */
.animate-fadeIn {
    animation: fadeIn 1s ease forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 1s ease forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 1s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 1s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 1s ease forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.8s ease forwards;
}

.animate-scaleInBounce {
    animation: scaleInBounce 0.8s ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 1.5s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-gradient {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Delay Classes */
.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; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

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

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

.reveal-left {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 1;
    transform: scale(1);
    transition: all 0.8s ease;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Animation for Lists */
.stagger-item {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item.visible {
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-item:nth-child(1).visible { animation-delay: 0.1s; }
.stagger-item:nth-child(2).visible { animation-delay: 0.2s; }
.stagger-item:nth-child(3).visible { animation-delay: 0.3s; }
.stagger-item:nth-child(4).visible { animation-delay: 0.4s; }
.stagger-item:nth-child(5).visible { animation-delay: 0.5s; }
.stagger-item:nth-child(6).visible { animation-delay: 0.6s; }
.stagger-item:nth-child(7).visible { animation-delay: 0.7s; }
.stagger-item:nth-child(8).visible { animation-delay: 0.8s; }

/* Fallback for browsers without JavaScript */
.no-js .reveal,
.no-js .reveal-left,
.no-js .reveal-right,
.no-js .reveal-scale,
.no-js .stagger-item {
    opacity: 1;
    transform: none;
}

/* Hero Animations */
.hero-animate {
    animation: fadeInUp 1.2s ease forwards;
}

.hero-title-animate {
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.hero-subtitle-animate {
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.hero-buttons-animate {
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.9s;
    opacity: 0;
}

/* Background Animations */
.bg-gradient-animate {
    background: linear-gradient(-45deg,
        var(--primary-blue),
        var(--primary-blue-light),
        #23a6d5,
        #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.bg-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-hover:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

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

.card-hover-3d:hover {
    transform: perspective(1000px) rotateX(5deg) translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 102, 177, 0.2);
}

/* Button Animations */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

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

.btn-animate:hover::after {
    width: 300px;
    height: 300px;
}

.btn-animate-scale {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-animate-scale:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 102, 177, 0.3);
}

.btn-animate-scale:active {
    transform: scale(0.98);
}

/* Icon Animations */
.icon-hover {
    transition: all 0.4s ease;
}

.icon-hover:hover {
    transform: scale(1.1) rotate(10deg);
}

.icon-spin-hover:hover {
    animation: rotate 0.8s ease-in-out;
}

.icon-bounce-hover:hover {
    animation: bounce 0.8s ease;
}

/* Navigation Animations */
.nav-link-animate {
    position: relative;
}

.nav-link-animate::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-blue-light);
    transition: width 0.4s ease;
}

.nav-link-animate:hover::after,
.nav-link-animate.active::after {
    width: 100%;
}

.nav-dropdown-animate {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.nav-dropdown:hover .nav-dropdown-animate {
    opacity: 1;
    visibility: visible;
    transform: translateY(10px);
}

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

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

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

.img-slide {
    position: relative;
    overflow: hidden;
}

.img-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    transition: left 0.5s ease;
}

.img-slide:hover::after {
    left: 100%;
}

/* Loading Animations */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 102, 177, 0.2);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--primary-blue);
    border-radius: 50%;
    animation: bounce 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; }

/* Counter Animation */
.counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.counter-animate {
    animation: numberCount 1s ease forwards;
}

/* Text Animations */
.text-gradient-animate {
    background: linear-gradient(90deg,
        var(--primary-blue),
        var(--primary-blue-light),
        #23a6d5,
        var(--primary-blue));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

.text-shadow-animate {
    animation: pulse 2s ease-in-out infinite;
}

/* Modal Animations */
.modal-animate {
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-animate.active {
    opacity: 1;
    visibility: visible;
}

.modal-content-animate {
    transform: scale(0.9) translateY(50px);
    opacity: 0;
    transition: all 0.4s ease 0.2s;
}

.modal-animate.active .modal-content-animate {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Parallax Effects */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.parallax-element {
    transition: transform 0.1s ease-out;
}

/* Progress Bar Animation */
.progress-bar-animate {
    width: 0;
    transition: width 1.5s ease;
}

.progress-bar-animate.active {
    width: var(--progress);
}

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

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

/* Swirl Animation */
@keyframes swirl {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(0.8);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.animate-swirl {
    animation: swirl 2s ease-in-out infinite;
}

/* Elastic Animation */
@keyframes elasticIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-elasticIn {
    animation: elasticIn 0.8s ease forwards;
}

/* Swing Animation */
@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(15deg);
    }
    75% {
        transform: rotate(-15deg);
    }
}

.animate-swing {
    transform-origin: top center;
    animation: swing 1s ease-in-out infinite;
}

/* Light Speed Animation */
@keyframes lightSpeedIn {
    from {
        transform: translateX(100%) skewX(-30deg);
        opacity: 0;
    }
    to {
        transform: translateX(0) skewX(0);
        opacity: 1;
    }
}

.animate-lightSpeedIn {
    animation: lightSpeedIn 0.8s ease forwards;
}

/* Roll Animation */
@keyframes rollIn {
    from {
        opacity: 0;
        transform: translateX(-100%) rotate(-120deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotate(0);
    }
}

.animate-rollIn {
    animation: rollIn 0.8s ease forwards;
}

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

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 10000;
    transition: width 0.1s ease;
}

/* Hover Lift Effect */
.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);
}

/* Spotlight Effect */
.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::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 ease;
}

.spotlight:hover::before {
    left: 100%;
}

/* Glow Effect */
.glow {
    transition: box-shadow 0.3s ease;
}

.glow:hover {
    box-shadow: 0 0 30px rgba(0, 102, 177, 0.5);
}

/* Border Animation */
.border-animate {
    position: relative;
}

.border-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--primary-blue);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.9);
}

.border-animate:hover::before {
    opacity: 1;
    transform: scale(1);
}

/* Animated Background Pattern */
.pattern-bg {
    background-image:
        radial-gradient(circle at 20% 80%, rgba(0, 102, 177, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 133, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 102, 177, 0.05) 0%, transparent 50%);
    animation: fadeIn 2s ease forwards;
}

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

.scroll-indicator svg {
    width: 30px;
    height: 30px;
    fill: var(--white);
    opacity: 0.8;
}
