/*===========================
    CUSTOM ANIMATIONS CSS
    Enhanced animations for 聚全信息 website
===========================*/

/* Particle background container */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Enhanced preloader with modern spinner */
.preloader {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-loader {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #2fbbe8;
    border-radius: 50%;
    animation: modernSpin 1s linear infinite;
}

@keyframes modernSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Typing animation for main title */
.typing-animation {
    overflow: hidden;
    border-right: 3px solid #2fbbe8;
    white-space: nowrap;
    animation: typing 3s steps(10, 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: #2fbbe8; }
}

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

.floating-delayed {
    animation: floating 3s ease-in-out infinite;
    animation-delay: 1.5s;
}

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

/* Enhanced service cards with 3D effect */
.service-card-3d {
    perspective: 1000px;
    transition: all 0.3s ease;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.service-card-3d:hover .service-card-inner {
    transform: rotateY(180deg);
}

.service-card-front, .service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.service-card-back {
    background: linear-gradient(135deg, #2fbbe8, #1e90ff);
    color: white;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Gradient background animation */
.gradient-bg {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    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%; }
}

/* Pulse animation for buttons */
.pulse-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(47, 187, 232, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(47, 187, 232, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(47, 187, 232, 0);
    }
}

/* Slide in animations */
.slide-in-left {
    animation: slideInLeft 1s ease-out;
}

.slide-in-right {
    animation: slideInRight 1s ease-out;
}

.slide-in-up {
    animation: slideInUp 1s ease-out;
}

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

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

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

/* Enhanced hover effects */
.hover-lift {
    transition: all 0.3s ease;
}

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

/* Glowing text effect */
.glow-text {
    text-shadow: 0 0 10px #2fbbe8, 0 0 20px #2fbbe8, 0 0 30px #2fbbe8;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px #2fbbe8, 0 0 20px #2fbbe8, 0 0 30px #2fbbe8;
    }
    to {
        text-shadow: 0 0 20px #2fbbe8, 0 0 30px #2fbbe8, 0 0 40px #2fbbe8;
    }
}

/* Stagger animation for service items */
.stagger-item {
    opacity: 0;
    transform: translateY(50px);
    animation: staggerFadeIn 0.6s ease forwards;
}

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

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

/* Modern card design */
.modern-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.modern-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Enhanced navigation styles */
.navigation.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

/* Button ripple effect */
.main-btn {
    position: relative;
    overflow: hidden;
}

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

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

/* Enhanced contact cards */
.contact-box.modern-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(47, 187, 232, 0.2);
    transition: all 0.3s ease;
}

.contact-box.modern-card:hover {
    background: rgba(47, 187, 232, 0.1);
    border-color: #2fbbe8;
    transform: translateY(-5px);
}

/* Enhanced work cards */
.single-work {
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.single-work:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

/* Loading states */
.loading {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced typography */
.glow-text {
    color: #2fbbe8;
    text-shadow: 0 0 10px rgba(47, 187, 232, 0.3);
}

/* Scroll indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #2fbbe8, #1e90ff);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Enhanced service card animations */
.service-card-3d .service-card-inner.hovered {
    transform: rotateY(180deg);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .typing-animation {
        animation: typing 2s steps(8, end), blink-caret 0.75s step-end infinite;
    }

    .floating, .floating-delayed {
        animation-duration: 2s;
    }

    .service-card-3d:hover .service-card-inner {
        transform: none;
    }

    .service-card-3d .service-card-inner.hovered {
        transform: none;
    }

    .hover-lift:hover {
        transform: none;
    }

    .gradient-bg {
        background: linear-gradient(135deg, #2fbbe8 0%, #1e90ff 100%);
        background-size: 100% 100%;
    }
}

/* Print styles */
@media print {
    .floating, .floating-delayed {
        animation: none;
    }

    .gradient-bg {
        background: #2fbbe8 !important;
    }
}

/* ========== 新增炫酷效果 ========== */

/* 鼠标跟随粒子效果 */
.cursor-particle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #2fbbe8, #1e90ff);
    pointer-events: none;
    z-index: 9998;
    box-shadow: 0 0 10px #2fbbe8, 0 0 20px #2fbbe8;
    animation: particleFade 1s ease-out forwards;
}

@keyframes particleFade {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-50px);
    }
}

/* 增强服务卡片3D效果 */
.single-service {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.single-service:hover {
    transform: translateY(-15px) rotateX(5deg);
    box-shadow: 0 25px 50px rgba(47, 187, 232, 0.3);
}

.single-service .service-icon {
    transition: all 0.5s ease;
    transform-style: preserve-3d;
}

.single-service:hover .service-icon {
    transform: rotateY(360deg) scale(1.1);
}

.single-service:hover .service-icon i {
    color: #2fbbe8;
    text-shadow: 0 0 20px rgba(47, 187, 232, 0.8);
    animation: iconGlow 1.5s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(47, 187, 232, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(47, 187, 232, 1));
    }
}

/* 产品卡片光晕效果 */
.single-work {
    position: relative;
    overflow: hidden;
}

.single-work::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(47, 187, 232, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.single-work:hover::before {
    opacity: 1;
    animation: rotateGlow 3s linear infinite;
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.single-work:hover .work-overlay {
    background: linear-gradient(135deg, rgba(47, 187, 232, 0.95), rgba(30, 144, 255, 0.95));
    backdrop-filter: blur(5px);
}

/* 文字渐变动画 */
.title-gradient {
    background: linear-gradient(90deg, #2fbbe8, #1e90ff, #667eea, #764ba2, #2fbbe8);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 5s linear infinite;
}

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

/* 按钮霓虹灯效果 */
.main-btn {
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #2fbbe8, #1e90ff);
    transition: all 0.3s ease;
}

.main-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #2fbbe8, #1e90ff, #667eea, #764ba2, #2fbbe8);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: neonGlow 3s linear infinite;
}

.main-btn:hover::before {
    opacity: 1;
}

.main-btn:hover {
    box-shadow: 0 0 20px rgba(47, 187, 232, 0.6),
                0 0 40px rgba(47, 187, 232, 0.4),
                0 0 60px rgba(47, 187, 232, 0.2);
    transform: translateY(-2px);
}

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

/* 导航栏滚动增强 */
.navigation {
    transition: all 0.3s ease;
    backdrop-filter: blur(0px);
}

.navigation.scrolled {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(15px) saturate(180%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(47, 187, 232, 0.1);
}

.navigation.scrolled .navbar-brand {
    color: #2fbbe8;
    text-shadow: 0 0 10px rgba(47, 187, 232, 0.3);
    transition: all 0.3s ease;
}

.navigation.scrolled .nav-item a {
    position: relative;
    transition: all 0.3s ease;
}

.navigation.scrolled .nav-item a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #2fbbe8, #1e90ff);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(47, 187, 232, 0.8);
}

.navigation.scrolled .nav-item a:hover::after,
.navigation.scrolled .nav-item.active a::after {
    width: 100%;
}

/* 背景动态网格效果 */
.header-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(47, 187, 232, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(47, 187, 232, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    animation: gridMove 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* 联系卡片增强 */
.contact-box {
    position: relative;
    overflow: hidden;
}

.contact-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(47, 187, 232, 0.1), transparent);
    transition: left 0.5s ease;
}

.contact-box:hover::before {
    left: 100%;
}

.contact-box:hover .contact-icon {
    transform: scale(1.2) rotate(360deg);
    color: #2fbbe8;
    text-shadow: 0 0 20px rgba(47, 187, 232, 0.8);
}

.contact-icon {
    transition: all 0.6s ease;
}

/* 滚动指示器增强 */
.scroll-indicator {
    height: 4px;
    background: linear-gradient(90deg, #2fbbe8, #1e90ff, #667eea, #764ba2);
    background-size: 200% 100%;
    animation: scrollIndicatorGlow 2s linear infinite;
    box-shadow: 0 0 10px rgba(47, 187, 232, 0.8);
}

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

/* 标题文字闪烁效果 */
.sub-title {
    position: relative;
    display: inline-block;
}

.sub-title::after {
    content: '·';
    animation: blinkDot 1.5s infinite;
    color: #2fbbe8;
    text-shadow: 0 0 10px rgba(47, 187, 232, 0.8);
}

@keyframes blinkDot {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* 图标旋转动画 */
.icon-rotating {
    animation: iconRotate 0.6s ease-in-out;
}

@keyframes iconRotate {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* 图标弹跳动画 */
.icon-bounce {
    animation: iconBounce 0.6s ease-in-out;
}

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

/* 工作卡片覆盖层过渡 */
.work-overlay {
    transition: opacity 0.3s ease, background 0.3s ease;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .cursor-particle {
        display: none;
    }
    
    .single-service:hover {
        transform: translateY(-10px);
    }
    
    .main-btn:hover {
        box-shadow: 0 0 15px rgba(47, 187, 232, 0.4);
    }
    
    .title-gradient {
        background-size: 200% 100%;
    }
}
