/* ===== Scroll Reveal Animations ===== */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fade-up"].visible {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="fade-in"].visible {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="fade-left"] {
    opacity: 0;
    transform: translateX(-30px);
}
[data-animate="fade-left"].visible {
    opacity: 1;
    transform: translateX(0);
}

[data-animate="fade-right"] {
    opacity: 0;
    transform: translateX(30px);
}
[data-animate="fade-right"].visible {
    opacity: 1;
    transform: translateX(0);
}

[data-animate="scale-in"] {
    opacity: 0;
    transform: scale(0.9);
}
[data-animate="scale-in"].visible {
    opacity: 1;
    transform: scale(1);
}

[data-animate="zoom-in"] {
    opacity: 0;
    transform: scale(0.85);
}
[data-animate="zoom-in"].visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
[data-stagger] > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-stagger].visible > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger].visible > *:nth-child(2) { transition-delay: 0.1s; }
[data-stagger].visible > *:nth-child(3) { transition-delay: 0.15s; }
[data-stagger].visible > *:nth-child(4) { transition-delay: 0.2s; }
[data-stagger].visible > *:nth-child(5) { transition-delay: 0.25s; }
[data-stagger].visible > *:nth-child(6) { transition-delay: 0.3s; }

[data-stagger].visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Enhanced Hero Gradient ===== */
.hero, .calculator-hero, .about-hero {
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(16, 185, 129, 0.04) 0%, transparent 40%),
                radial-gradient(circle at 50% 80%, rgba(37, 99, 235, 0.03) 0%, transparent 50%);
    animation: heroFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.hero > .container {
    position: relative;
    z-index: 1;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -1%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

/* ===== Animated Gradient Text ===== */
.gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #2563eb 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
}

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

/* ===== Enhanced Card Hover Effects ===== */
.feature-card, .pricing-card, .faq-item {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(37, 99, 235, 0.05);
}

.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px rgba(37, 99, 235, 0.12);
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border-color: rgba(37, 99, 235, 0.2);
}

/* ===== Feature Icon Pulse ===== */
.feature-icon {
    transition: all 0.3s ease;
    position: relative;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* ===== Step Number Glow ===== */
.step-number {
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.step:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
}

/* ===== Button Enhancements ===== */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}

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

.btn-primary:hover::after {
    left: 100%;
}

/* ===== Smooth Section Transitions ===== */
section, .features, .pricing, .how-it-works, .faq, .cta {
    position: relative;
}

/* ===== Scroll-to-Top Button ===== */
.scroll-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    pointer-events: none;
}

.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top-btn:hover {
    background: #1d4ed8;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.scroll-top-btn svg {
    width: 20px;
    height: 20px;
}

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

/* ===== Trust Badge Hover ===== */
.trust-item {
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
}

.trust-item:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* ===== Pricing Feature Check Animation ===== */
.pricing-features li {
    transition: all 0.2s ease;
}

.pricing-features li:hover {
    transform: translateX(4px);
    color: #1e293b;
}

/* ===== Nav Scroll Shadow ===== */
nav.scrolled, nav#main-nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-bottom-color: transparent;
}

/* ===== Badge Pulse ===== */
.badge {
    transition: all 0.3s ease;
}

.badge:hover {
    background: rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}

/* ===== Popular Badge Shine ===== */
.popular-badge {
    overflow: hidden;
    position: relative;
}

.popular-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: badgeShine 3s ease-in-out infinite;
}

@keyframes badgeShine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

/* ===== CTA Section Gradient ===== */
.cta {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.cta > .container {
    position: relative;
    z-index: 1;
}

/* ===== Loading State for Images ===== */
img {
    transition: opacity 0.3s ease;
}

/* ===== Reduce motion for accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    [data-animate] {
        opacity: 1;
        transform: none;
    }
    [data-stagger] > * {
        opacity: 1;
        transform: none;
    }
    html {
        scroll-behavior: auto;
    }
}
