"use client";
import { Container } from "@/components/container";
import { Heading } from "@/components/heading";
import { motion } from "framer-motion";
import { ExternalLink } from "lucide-react";

const projects = [
  {
    title: "FinTech Revolution",
    category: "Web Design & Development",
    description: "A cutting-edge financial platform that redefined digital banking",
    image: "https://images.unsplash.com/photo-1551288049-bebda4e38f71?w=800&q=80",
    color: "from-blue-500 to-cyan-500",
  },
  {
    title: "Luxe Fashion",
    category: "E-commerce & Branding",
    description: "Premium fashion brand with immersive shopping experience",
    image: "https://images.unsplash.com/photo-1441986300917-64674bd600d8?w=800&q=80",
    color: "from-pink-500 to-rose-500",
  },
  {
    title: "TechFlow AI",
    category: "SaaS Platform",
    description: "AI-powered workflow automation for modern teams",
    image: "https://images.unsplash.com/photo-1677442136019-21780ecad995?w=800&q=80",
    color: "from-violet-500 to-purple-500",
  },
  {
    title: "GreenEarth",
    category: "Brand Identity & Web",
    description: "Sustainable living platform connecting eco-conscious consumers",
    image: "https://images.unsplash.com/photo-1542601906990-b4d3fb778b09?w=800&q=80",
    color: "from-green-500 to-emerald-500",
  },
  {
    title: "StreamVibe",
    category: "Mobile App Design",
    description: "Next-gen music streaming app with social features",
    image: "https://images.unsplash.com/photo-1611339555312-e607c8352fd7?w=800&q=80",
    color: "from-orange-500 to-red-500",
  },
  {
    title: "HealthHub Pro",
    category: "Healthcare Platform",
    description: "Comprehensive telemedicine solution for modern healthcare",
    image: "https://images.unsplash.com/photo-1576091160399-112ba8d25d1d?w=800&q=80",
    color: "from-teal-500 to-cyan-500",
  },
];

export function Work() {
  return (
    <section id="work" className="py-32 bg-white dark:bg-slate-900">
      <Container>
        <motion.div
          initial={{ opacity: 0, y: 20 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: true }}
          transition={{ duration: 0.6 }}
          className="text-center mb-20"
        >
          <Heading className="mb-4">Featured Work</Heading>
          <p className="text-xl text-slate-600 dark:text-slate-400 max-w-2xl mx-auto">
            Explore our portfolio of award-winning projects that push boundaries and deliver results
          </p>
        </motion.div>

        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
          {projects.map((project, index) => (
            <motion.div
              key={index}
              initial={{ opacity: 0, y: 30 }}
              whileInView={{ opacity: 1, y: 0 }}
              viewport={{ once: true }}
              transition={{ duration: 0.6, delay: index * 0.1 }}
              className="group relative overflow-hidden rounded-2xl bg-slate-100 dark:bg-slate-800 cursor-pointer"
            >
              <div className="aspect-[4/3] overflow-hidden">
                <img
                  src={project.image}
                  alt={project.title}
                  className="w-full h-full object-cover transition-transform duration-700 group-hover:scale-110"
                />
              </div>
              
              <div className="absolute inset-0 bg-gradient-to-t from-black/90 via-black/50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300">
                <div className="absolute bottom-0 left-0 right-0 p-6 text-white transform translate-y-4 group-hover:translate-y-0 transition-transform duration-300">
                  <div className={`inline-block px-3 py-1 rounded-full bg-gradient-to-r ${project.color} text-white text-xs font-semibold mb-3`}>
                    {project.category}
                  </div>
                  <h3 className="text-2xl font-bold mb-2">{project.title}</h3>
                  <p className="text-slate-200 mb-4">{project.description}</p>
                  <div className="flex items-center gap-2 text-sm font-semibold">
                    View Case Study <ExternalLink className="w-4 h-4" />
                  </div>
                </div>
              </div>
            </motion.div>
          ))}
        </div>
      </Container>
    </section>
  );
}
