"use client"; import { useMemo } from "react"; import { Upload, Cpu, MessageSquare, Shield, FileText, Check, Sparkles, Zap, Link, Target, } from "lucide-react"; import { useScrollAnimation } from "@/hooks/useScrollAnimation"; import { GlowingEffect } from "@/components/ui/glowing-effect"; import { BackgroundBeams } from "@/components/ui/background-beams"; // Step Card Component with Glowing Effect interface StepCardProps { number: string; title: string; description: string; icon: React.ElementType; gradient: string; glowColor: string; delay: number; children?: React.ReactNode; } function StepCard({ number, title, description, icon: Icon, gradient, glowColor, delay, children, }: StepCardProps) { const { ref, isVisible } = useScrollAnimation({ threshold: 0.2, }); return (
{/* Glowing Border Card */}
{/* Rainbow Glowing Effect */}
{/* Modern Number Badge */}
{/* Outer glow ring */}
{/* Badge container */}
{/* Glass background */}
{/* Gradient border */}
{/* Number */}
{number}
{/* Icon with Glow */}
{/* Content */}

{title}

{description}

{/* Animation Content */} {children &&
{children}
}
); } // Upload Animation function UploadAnimation() { const { ref, isVisible } = useScrollAnimation({ threshold: 0.3, }); return (
{/* Drop Zone */}

Drop files here

{/* File List */}
{[ { name: "contract.pdf", size: "2.4 MB", progress: 100 }, { name: "agreement.jpg", size: "1.8 MB", progress: 75 }, ].map((file, i) => (

{file.name}

{file.size} {file.progress === 100 && ( )}
))}
); } // AI Analysis Animation function AIAnalysisAnimation() { const { ref, isVisible } = useScrollAnimation({ threshold: 0.3, }); const scanHeights = useMemo( () => [ 22, 38, 55, 40, 62, 30, 70, 45, 58, 35, 66, 28, 52, 48, 60, 33, 57, 41, 64, 36, ], [], ); const analysisPoints = [ { label: "Clauses", value: "47", icon: Target, color: "text-blue-500" }, { label: "Risk", value: "Low", icon: Shield, color: "text-emerald-500" }, { label: "Speed", value: "2.3s", icon: Zap, color: "text-amber-500" }, ]; return (
{/* AI Brain */}
{/* Analysis Points */}
{analysisPoints.map((point, i) => (

{point.value}

{point.label}

))}
{/* Scanning Bar with Waveform */}
{/* Background waveform */}
{scanHeights.map((height, i) => (
))}
{/* Scanning line */}
); } // Chat Animation function ChatStepAnimation() { const { ref, isVisible } = useScrollAnimation({ threshold: 0.3, }); const messages = [ { text: "Explain termination clause", isUser: true }, { text: "Section 12.3: 30 days notice...", isUser: false }, ]; return (
{messages.map((msg, i) => (
{!msg.isUser && (
)}
{msg.text}
))}
{/* RAG Indicator */}
{[0, 0.2, 0.4].map((delay, i) => ( ))}
RAG Powered
); } // Blockchain Animation function BlockchainStepAnimation() { const { ref, isVisible } = useScrollAnimation({ threshold: 0.3, }); return (
{/* Blockchain Chain */}
{[0, 1, 2].map((i) => (
{i < 2 && (
)}
))}
{/* Certificate */}

Polygon Verified

0x3f7a...9e2d

); } export function HowItWorks() { const { ref: headerRef, isVisible: headerVisible } = useScrollAnimation(); const steps = [ { number: "01", title: "Upload Contract", description: "PDF, images, or scans. Drag and drop or browse to upload instantly.", icon: Upload, gradient: "bg-gradient-to-br from-blue-500 to-blue-600", glowColor: "rgba(59, 130, 246, 0.5)", animation: , }, { number: "02", title: "AI Analysis", description: "AI extracts and analyzes every clause, term, and detail automatically.", icon: Cpu, gradient: "bg-gradient-to-br from-violet-500 to-purple-600", glowColor: "rgba(139, 92, 246, 0.5)", animation: , }, { number: "03", title: "Chat with AI", description: "Ask anything. Get instant, precise answers powered by RAG technology.", icon: MessageSquare, gradient: "bg-gradient-to-br from-teal-500 to-cyan-600", glowColor: "rgba(20, 184, 166, 0.5)", animation: , }, { number: "04", title: "Blockchain Proof", description: "Immutable certification on Polygon. Legally valid timestamped proof.", icon: Shield, gradient: "bg-gradient-to-br from-emerald-500 to-green-600", glowColor: "rgba(16, 185, 129, 0.5)", animation: , }, ]; return (
{/* Background with Beams */}
{/* Section Header */}
Simple Process

From Upload to Certification in{" "} 4 Easy Steps

Our intelligent system handles everything automatically

{/* Steps Grid - Better Alignment */}
{steps.map((step, index) => ( {step.animation} ))}
); }