import {
  Award,
  BookOpen,
  Mic,
  Users,
  Video,
  ChevronRight,
} from "lucide-react";


const icons = {
  book: BookOpen,
  mic: Mic,
  users: Users,
  video: Video,
  award: Award,
};

export default function MasterclassSection({
  data,
}) {
  return (
    <section className="py-20 bg-gradient-to-br from-[#F6EFE9] to-white">
      <div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
        {/* Header */}
        <div className="text-center mb-12">
          <p className="text-xs font-black text-[#8B1C1C] uppercase tracking-widest mb-2">
            {data.badge}
          </p>

          <h2 className="text-3xl md:text-4xl font-black text-[#4A141E]">
            {data.title}
          </h2>

          {data.description ? (
            <p className="text-[#4A141E]/70 mt-3 max-w-3xl mx-auto">
              {data.description}
            </p>
          ) : null}
        </div>

        {/* Cards */}
        <div className={data.variant === "steps" ? "grid md:grid-cols-3 gap-8" : "grid md:grid-cols-2 lg:grid-cols-4 gap-5"}>
          {data.sections.map((section) => {
            const Icon = icons[section.icon];

            if (data.variant === "steps") {
              return (
                <div key={section.title} className="relative">
                  <div className="p-8 rounded-3xl bg-white border-2 border-[#E6D3B1]/40 hover:border-[#D4AF37] transition-all duration-300 h-full">
                    <div className="absolute -top-6 left-8 w-12 h-12 rounded-full bg-gradient-to-r from-[#8B1C1C] to-[#D4AF37] flex items-center justify-center border-4 border-white">
                      <span className="text-white font-black text-xl">{section.number}</span>
                    </div>
                    <div className="mt-6">
                      <Icon className="w-12 h-12 text-[#D4AF37] mb-4" />
                      <h3 className="text-2xl font-black text-[#4A141E] mb-3">{section.title}</h3>
                      <p className="text-[#4A141E]/70 leading-relaxed">{section.description}</p>
                    </div>
                  </div>
                </div>
              );
            }

            return (
              <div
                key={section.title}
                className="p-7 rounded-2xl bg-white border-2 border-[#E6D3B1]/40 hover:border-[#D4AF37] transition-all duration-300 shadow-lg"
              >
                <div className="w-12 h-12 rounded-xl bg-gradient-to-br from-[#4A141E] to-[#3B0F18] flex items-center justify-center mb-4">
                  <Icon className="w-6 h-6 text-[#D4AF37]" />
                </div>

                <h3 className="font-black text-[#4A141E] mb-3">
                  {section.title}
                </h3>

                <ul className="space-y-1.5">
                  {section.items.map((item) => (
                    <li
                      key={item}
                      className="flex items-start gap-2 text-sm text-[#4A141E]/70"
                    >
                      <ChevronRight className="w-4 h-4 text-[#8B1C1C] flex-shrink-0 mt-0.5" />
                      <span>{item}</span>
                    </li>
                  ))}
                </ul>
              </div>
            );
          })}
        </div>

        {/* Bottom Highlight */}
        {data.highlight ? (
          <div className="mt-8 p-6 rounded-2xl bg-gradient-to-r from-[#4A141E] to-[#3B0F18] border-2 border-[#D4AF37] text-center">
          <p className="text-base md:text-lg font-bold text-[#E6D3B1]">
            {data.highlight.prefix}{" "}
            <span className="text-[#D4AF37]">
              {data.highlight.title}
            </span>{" "}
            — {data.highlight.description}
          </p>
          </div>
        ) : null}
      </div>
    </section>
  );
}
