/* ============================================================
   枫云预测 - SaaS Landing Page Custom Styles
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --nav-transition-speed: 300ms;
}

/* ---------- Smooth Scrolling ---------- */
html {
    scroll-behavior: smooth;
}

/* ---------- Scrollbar Styling ---------- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366f1, #818cf8);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4f46e5, #6366f1);
}

/* ---------- Navbar Scroll State ---------- */
#navbar.scrolled {
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- Feature Card Hover Effects ---------- */
.feature-card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.feature-card:hover {
    transform: translateY(-6px);
}
.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(139, 92, 246, 0.03));
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.feature-card:hover::after {
    opacity: 1;
}

/* ---------- Pricing Card Enhancements ---------- */
.pricing-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.pricing-card:hover {
    transform: translateY(-8px);
}

/* ---------- Testimonial Card ---------- */
.testimonial-card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.testimonial-card:hover {
    transform: translateY(-6px);
}

/* ---------- FAQ Accordion ---------- */
.faq-item {
    transition: all 0.3s ease;
}
.faq-item.active {
    background: #eef2ff;
    border-color: #c7d2fe;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.08);
}
.faq-icon {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-item.active .faq-icon {
    transform: rotate(45deg);
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}
.faq-item.active .faq-icon i {
    color: white;
}
.faq-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.faq-content.open {
    max-height: 500px;
}

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

/* ---------- Stat Items Counter Highlight ---------- */
.stat-item {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
}

/* ---------- CTA Section Pulse ---------- */
@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    }
}
#cta a:first-child {
    animation: subtlePulse 2.5s ease-in-out infinite;
}

/* ---------- Scroll Indicator Bounce ---------- */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    50% {
        transform: translateY(8px) translateX(-50%);
    }
}
#hero .animate-bounce {
    animation: bounce 2s ease-in-out infinite;
}

/* ---------- Fade In Up Animation ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in-up {
    animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.fade-in-up-delay-1 { animation-delay: 0.1s; }
.fade-in-up-delay-2 { animation-delay: 0.2s; }
.fade-in-up-delay-3 { animation-delay: 0.3s; }
.fade-in-up-delay-4 { animation-delay: 0.4s; }
.fade-in-up-delay-5 { animation-delay: 0.5s; }
.fade-in-up-delay-6 { animation-delay: 0.6s; }

/* ---------- Reveal on Scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Mobile Menu Transitions ---------- */
#mobile-menu {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
}
#mobile-menu:not(.hidden) {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Button Ripple Effect ---------- */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.btn-ripple::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.btn-ripple:hover::after {
    opacity: 1;
}

/* ---------- Image Loading ---------- */
img {
    transition: opacity 0.4s ease;
}
img[loading="lazy"] {
    opacity: 0;
}
img[loading="lazy"].loaded {
    opacity: 1;
}

/* ---------- Focus Visible ---------- */
:focus-visible {
    outline: 2px solid var(--brand-600);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Selection ---------- */
::selection {
    background: rgba(79, 70, 229, 0.25);
    color: #1e1b4b;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ---------- Responsive Tweaks ---------- */
@media (max-width: 640px) {
    #hero h1 {
        font-size: 2.25rem;
    }
    .feature-card {
        padding: 1.5rem;
    }
    .pricing-card {
        padding: 1.5rem;
    }
    .pricing-card .text-5xl {
        font-size: 2.5rem;
    }
    .stat-item .text-4xl,
    .stat-item .text-5xl {
        font-size: 2rem;
    }
}

/* ---------- Print Styles ---------- */
@media print {
    #navbar,
    #mobile-menu,
    #cta,
    footer {
        display: none;
    }
    body {
        color: #000;
        background: #fff;
    }
}
