/* ========================================
   Beijing Longyu Construction Engineering Co., Ltd.
   Advanced Animations - Cadillac 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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@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 bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceInUp {
    0% {
        transform: translateY(40px);
        opacity: 0;
    }
    60% {
        transform: translateY(-10px);
        opacity: 1;
    }
    80% {
        transform: translateY(5px);
    }
    100% {
        transform: translateY(0);
    }
}

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(201, 169, 98, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(201, 169, 98, 0.6);
    }
}

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

@keyframes rotateIn {
    from {
        transform: rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: rotate(0);
        opacity: 1;
    }
}

@keyframes flipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

@keyframes expandWidth {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

/* Hero Animations */
.hero-badge {
    animation: fadeInDown 1s ease-out;
}

.hero-title {
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.hero-buttons {
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

/* Scroll Reveal Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger Animation for Grid Items */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-item.active {
    opacity: 1;
    transform: translateY(0);
}

/* Card Hover Effects */
.card-hover-lift {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card-hover-glow:hover {
    box-shadow: 0 0 40px rgba(201, 169, 98, 0.4);
}

.card-hover-scale {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-scale:hover {
    transform: scale(1.02);
}

/* Button Animations */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-animate::before {
    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;
}

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

.btn-animate:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(201, 169, 98, 0.4);
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.btn-ripple:active::after {
    transform: scale(0);
    opacity: 0.3;
    transition: 0s;
}

/* Icon Animations */
.icon-spin {
    transition: transform 0.4s ease;
}

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

.icon-bounce {
    transition: transform 0.4s ease;
}

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

.icon-pulse {
    transition: transform 0.4s ease;
}

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

/* Text Animations */
.text-gradient-animate {
    background: linear-gradient(
        90deg,
        #c9a962 0%,
        #e8d5a3 25%,
        #c9a962 50%,
        #e8d5a3 75%,
        #c9a962 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

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

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

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

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

.nav-link-animate::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

/* Section Divider Animation */
.divider-line {
    width: 80px;
    height: 3px;
    background: var(--gradient-gold);
    margin: 1.5rem auto;
    position: relative;
    overflow: hidden;
}

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

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

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

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

/* Loading Animation */
.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: bounceIn 0.6s ease infinite alternate;
}

.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;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(45, 45, 45, 0.5) 25%,
        rgba(60, 60, 60, 0.5) 50%,
        rgba(45, 45, 45, 0.5) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

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

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

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

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

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

/* Rotating Animation */
.rotating {
    animation: rotating 20s linear infinite;
}

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

/* Background Gradient Animation */
.gradient-bg-animate {
    background: linear-gradient(
        -45deg,
        #1a1a1a,
        #2d2d2d,
        #1a1a1a,
        #2d2d2d
    );
    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%;
    }
}

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

.img-zoom img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Overlay Slide */
.overlay-slide {
    position: relative;
    overflow: hidden;
}

.overlay-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(201, 169, 98, 0.3);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.overlay-slide:hover::after {
    transform: translateX(0);
}

/* Line Animation */
.line-animate {
    position: relative;
}

.line-animate::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-gold);
    transition: width 0.4s ease;
}

.line-animate:hover::after {
    width: 100%;
}

/* Focus Animation */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.5);
}

/* Transition Classes */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.slide-up {
    animation: slideInUp 0.6s ease forwards;
}

.zoom-in {
    animation: zoomIn 0.6s ease 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; }
.delay-6 { animation-delay: 0.6s; }

/* Performance Optimized Animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Animations Disabled */
@media print {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
