"use client";

import { ArrowRight, Bell, MessageCircle, Zap, Users } from "lucide-react";
import Link from "next/link";
import { motion } from "framer-motion";

export function Features() {
    return (
        <section className="py-32 relative z-10" id="features">
            <div className="max-w-7xl mx-auto px-6">
                {/* Candidate Features */}
                <div className="flex flex-col lg:flex-row items-center gap-16 mb-32">
                    <motion.div 
                        initial={{ opacity: 0, x: -50 }}
                        whileInView={{ opacity: 1, x: 0 }}
                        viewport={{ once: true, margin: "-100px" }}
                        transition={{ duration: 0.6 }}
                        className="flex-1 lg:pr-12"
                    >
                        <div className="inline-block px-3 py-1 bg-primary/10 text-primary text-sm font-bold rounded-full mb-6">
                            For Talent
                        </div>
                        <h2 className="text-4xl lg:text-5xl font-extrabold text-deep-navy mb-6 leading-tight font-display">
                            Stop Searching, <br /> Start Matching
                        </h2>
                        <p className="text-lg text-slate-600 mb-8 leading-relaxed">
                            Our AI-driven matching engine analyzes your skills and preferences to surface roles that actually fit your career trajectory.
                        </p>
                        
                        <ul className="space-y-5 mb-10">
                            <li className="flex items-start gap-4">
                                <div className="w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0 mt-1">
                                    <Bell className="text-primary h-4 w-4" />
                                </div>
                                <div>
                                    <h4 className="font-bold text-deep-navy font-display">AI-curated job alerts</h4>
                                    <p className="text-slate-500 text-sm mt-1">
                                        Receive highly targeted opportunities directly to your inbox based on your evolving profile.
                                    </p>
                                </div>
                            </li>
                            <li className="flex items-start gap-4">
                                <div className="w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0 mt-1">
                                    <MessageCircle className="text-primary h-4 w-4" />
                                </div>
                                <div>
                                    <h4 className="font-bold text-deep-navy font-display">Direct messaging with hiring leads</h4>
                                    <p className="text-slate-500 text-sm mt-1">
                                        Skip the HR filter and talk directly to the engineering or design managers.
                                    </p>
                                </div>
                            </li>
                        </ul>
                        
                        <Link 
                            href="/jobs"
                            className="w-fit px-6 py-3 bg-white border border-slate-200 hover:border-primary text-deep-navy font-bold rounded-xl transition-all flex items-center gap-2 group cursor-pointer shadow-sm"
                        >
                            Explore Talent Features
                            <ArrowRight className="h-5 w-5 group-hover:translate-x-1 transition-transform" />
                        </Link>
                    </motion.div>
                    
                    <div className="flex-1 relative w-full pt-10 lg:pt-0">
                        <motion.div 
                            initial={{ opacity: 0, y: 50 }}
                            whileInView={{ opacity: 1, y: 0 }}
                            viewport={{ once: true, margin: "-100px" }}
                            transition={{ duration: 0.8, type: "spring" }}
                            className="bg-white rounded-2xl shadow-[0_20px_50px_rgba(8,_112,_184,_0.07)] border border-slate-100 p-6 relative z-10 w-full max-w-lg mx-auto transform lg:translate-x-8"
                        >
                            <div className="flex justify-between items-center mb-6 border-b border-slate-100 pb-4">
                                <div className="flex items-center gap-3">
                                    <div className="w-10 h-10 bg-slate-100 rounded-full"></div>
                                    <div>
                                        <div className="h-3 w-24 bg-slate-200 rounded mb-2"></div>
                                        <div className="h-2 w-16 bg-slate-100 rounded"></div>
                                    </div>
                                </div>
                                <span className="px-2 py-1 bg-green-100 text-green-600 text-xs font-bold rounded border border-green-200">98% Match</span>
                            </div>
                            <div className="space-y-4">
                                <motion.div 
                                    initial={{ opacity: 0, x: -20 }}
                                    whileInView={{ opacity: 1, x: 0 }}
                                    transition={{ delay: 0.3, duration: 0.5 }}
                                    className="flex items-center gap-4 p-3 bg-slate-50 border border-slate-100 rounded-xl"
                                >
                                    <div className="w-8 h-8 bg-blue-100 rounded flex items-center justify-center text-blue-600">
                                        <span className="material-symbols-outlined text-sm">work</span>
                                    </div>
                                    <div className="flex-1">
                                        <div className="h-3 w-3/4 bg-slate-200 rounded mb-2"></div>
                                        <div className="h-2 w-1/2 bg-slate-100 rounded"></div>
                                    </div>
                                </motion.div>
                                <motion.div 
                                    initial={{ opacity: 0, x: -20 }}
                                    whileInView={{ opacity: 1, x: 0 }}
                                    transition={{ delay: 0.5, duration: 0.5 }}
                                    className="flex items-center gap-4 p-3 bg-slate-50 border border-slate-100 rounded-xl"
                                >
                                    <div className="w-8 h-8 bg-purple-100 rounded flex items-center justify-center text-purple-600">
                                        <span className="material-symbols-outlined text-sm">code</span>
                                    </div>
                                    <div className="flex-1">
                                        <div className="h-3 w-2/3 bg-slate-200 rounded mb-2"></div>
                                        <div className="h-2 w-1/3 bg-slate-100 rounded"></div>
                                    </div>
                                </motion.div>
                                <motion.button 
                                    initial={{ opacity: 0 }}
                                    whileInView={{ opacity: 0.7 }}
                                    transition={{ delay: 0.8 }}
                                    className="w-full py-3 bg-primary text-white text-sm font-bold rounded-lg mt-2 relative overflow-hidden group hover:opacity-100"
                                >
                                    <span className="relative z-10">Apply with 1-Click</span>
                                    <div className="absolute inset-0 bg-white/20 translate-y-full group-hover:translate-y-0 transition-transform duration-300 ease-in-out"></div>
                                </motion.button>
                            </div>
                        </motion.div>
                        <motion.div 
                            initial={{ opacity: 0, scale: 0.8, rotate: -10 }}
                            whileInView={{ opacity: 1, scale: 1, rotate: -3 }}
                            viewport={{ once: true }}
                            transition={{ delay: 1, duration: 0.5, type: "spring" }}
                            className="absolute lg:-top-8 lg:-left-4 top-0 left-0 bg-white p-4 rounded-xl shadow-xl border border-slate-100 z-20 animate-[bounce_8s_infinite] hidden sm:block"
                        >
                            <div className="flex items-center gap-2">
                                <span className="relative flex h-3 w-3">
                                    <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"></span>
                                    <span className="relative inline-flex rounded-full h-3 w-3 bg-green-500"></span>
                                </span>
                                <span className="text-sm font-bold text-slate-700">New Match Found</span>
                            </div>
                        </motion.div>
                    </div>
                </div>

                {/* Company Features */}
                <div className="flex flex-col-reverse lg:flex-row items-center gap-16">
                    <div className="flex-1 relative w-full pt-10 lg:pt-0">
                        <motion.div 
                            initial={{ opacity: 0, y: 50 }}
                            whileInView={{ opacity: 1, y: 0 }}
                            viewport={{ once: true, margin: "-100px" }}
                            transition={{ duration: 0.8, type: "spring" }}
                            className="bg-[#0b1b3d] rounded-2xl shadow-[0_20px_50px_rgba(11,_27,_61,_0.3)] border border-[#1a2f5c] p-6 relative z-10 w-full max-w-lg mx-auto transform lg:-translate-x-8"
                        >
                            <div className="flex justify-between items-center mb-6 border-b border-[#1a2f5c] pb-4">
                                <h3 className="text-white font-bold font-display">Candidate Pipeline</h3>
                                <span className="material-symbols-outlined text-slate-400">more_horiz</span>
                            </div>
                            <div className="space-y-4">
                                <motion.div 
                                    initial={{ scale: 0.9, opacity: 0 }}
                                    whileInView={{ scale: 1, opacity: 1 }}
                                    transition={{ delay: 0.3 }}
                                    className="flex items-center justify-between p-3 bg-[#112249] rounded-xl border border-[#1a2f5c] hover:border-slate-500 transition-colors"
                                >
                                    <div className="flex items-center gap-3">
                                        <div className="w-10 h-10 bg-[#1a2f5c] rounded-full"></div>
                                        <div>
                                            <div className="h-3 w-24 bg-[#2a437c] rounded mb-2"></div>
                                            <div className="h-2 w-16 bg-[#1a2f5c] rounded"></div>
                                        </div>
                                    </div>
                                    <span className="px-2 py-1 bg-accent-yellow/10 text-accent-yellow text-xs font-bold rounded border border-accent-yellow/20">Interviewing</span>
                                </motion.div>
                                <motion.div 
                                    initial={{ scale: 0.9, opacity: 0 }}
                                    whileInView={{ scale: 1, opacity: 1 }}
                                    transition={{ delay: 0.5 }}
                                    className="flex items-center justify-between p-3 bg-[#112249] rounded-xl border border-[#1a2f5c] hover:border-slate-500 transition-colors"
                                >
                                    <div className="flex items-center gap-3">
                                        <div className="w-10 h-10 bg-[#1a2f5c] rounded-full"></div>
                                        <div>
                                            <div className="h-3 w-20 bg-[#2a437c] rounded mb-2"></div>
                                            <div className="h-2 w-24 bg-[#1a2f5c] rounded"></div>
                                        </div>
                                    </div>
                                    <span className="px-2 py-1 bg-emerald-500/10 text-emerald-400 text-xs font-bold rounded border border-emerald-500/20">Offer Sent</span>
                                </motion.div>
                                <motion.div 
                                    initial={{ scale: 0.9, opacity: 0 }}
                                    whileInView={{ scale: 1, opacity: 1 }}
                                    transition={{ delay: 0.7 }}
                                    className="flex items-center justify-between p-3 bg-[#112249] rounded-xl border border-[#1a2f5c] hover:border-slate-500 transition-colors"
                                >
                                    <div className="flex items-center gap-3">
                                        <div className="w-10 h-10 bg-[#1a2f5c] rounded-full"></div>
                                        <div>
                                            <div className="h-3 w-28 bg-[#2a437c] rounded mb-2"></div>
                                            <div className="h-2 w-16 bg-[#1a2f5c] rounded"></div>
                                        </div>
                                    </div>
                                    <span className="px-2 py-1 bg-blue-500/10 text-blue-400 text-xs font-bold rounded border border-blue-500/20">Screening</span>
                                </motion.div>
                            </div>
                        </motion.div>
                        <motion.div 
                            initial={{ opacity: 0, scale: 0.8, rotate: 10 }}
                            whileInView={{ opacity: 1, scale: 1, rotate: 3 }}
                            viewport={{ once: true }}
                            transition={{ delay: 1, duration: 0.5, type: "spring" }}
                            className="absolute lg:-bottom-6 lg:-right-4 bottom-0 right-0 bg-accent-yellow p-4 rounded-xl shadow-xl z-20 animate-[bounce_7s_infinite_reverse]"
                        >
                            <div className="flex flex-col">
                                <span className="text-3xl font-extrabold text-deep-navy">60%</span>
                                <span className="text-sm font-bold text-deep-navy/80">Faster Time-to-Hire</span>
                            </div>
                        </motion.div>
                    </div>
                    
                    <motion.div 
                        initial={{ opacity: 0, x: 50 }}
                        whileInView={{ opacity: 1, x: 0 }}
                        viewport={{ once: true, margin: "-100px" }}
                        transition={{ duration: 0.6 }}
                        className="flex-1 lg:pl-12"
                    >
                        <div className="inline-block px-3 py-1 bg-deep-navy/5 text-deep-navy/80 text-sm font-bold rounded-full mb-6">
                            For Companies
                        </div>
                        <h2 className="text-4xl lg:text-5xl font-extrabold text-deep-navy mb-6 leading-tight font-display">
                            Hire Better, <br /> Faster
                        </h2>
                        <p className="text-lg text-slate-600 mb-8 leading-relaxed">
                            Access a vetted pool of professionals and streamline your hiring pipeline with our collaborative recruiter tools.
                        </p>
                        
                        <ul className="space-y-5 mb-10">
                            <li className="flex items-start gap-4">
                                <div className="w-8 h-8 rounded-full bg-deep-navy/5 flex items-center justify-center shrink-0 mt-1">
                                    <Zap className="text-deep-navy h-4 w-4" />
                                </div>
                                <div>
                                    <h4 className="font-bold text-deep-navy font-display">One-click applicant screening</h4>
                                    <p className="text-slate-500 text-sm mt-1">
                                        Automatically filter candidates based on non-negotiable requirements before you even look at a resume.
                                    </p>
                                </div>
                            </li>
                            <li className="flex items-start gap-4">
                                <div className="w-8 h-8 rounded-full bg-deep-navy/5 flex items-center justify-center shrink-0 mt-1">
                                    <Users className="text-deep-navy h-4 w-4" />
                                </div>
                                <div>
                                    <h4 className="font-bold text-deep-navy font-display">Diversity & Inclusion metrics</h4>
                                    <p className="text-slate-500 text-sm mt-1">
                                        Track and improve your pipeline diversity with real-time analytics and anonymous initial screenings.
                                    </p>
                                </div>
                            </li>
                        </ul>
                        
                        <Link 
                            href="/dashboard/employer/post-job"
                            className="w-fit px-6 py-3 bg-deep-navy hover:bg-deep-navy/90 text-white font-bold rounded-xl transition-all flex items-center gap-2 group cursor-pointer shadow-md"
                        >
                            Explore Employer Tools
                            <ArrowRight className="h-5 w-5 group-hover:translate-x-1 transition-transform" />
                        </Link>
                    </motion.div>
                </div>
            </div>
        </section>
    );
}
