"use client";

import { KeyRound, Shield, Users, Building2, Activity, Lock } from "lucide-react";
import { useLanguage } from "@/components/language-provider";
import { Section, SectionHeading } from "@/components/ui/section";
import { FEATURES } from "@/lib/content";

const ICONS = {
  key: KeyRound,
  shield: Shield,
  users: Users,
  building: Building2,
  activity: Activity,
  lock: Lock,
} as const;

export function Features() {
  const { t, lang } = useLanguage();
  return (
    <Section id="features" className="bg-white dark:bg-ink">
      <div className="container-x">
        <SectionHeading
          eyebrow={t.features.eyebrow}
          title={t.features.title}
          subtitle={t.features.subtitle}
        />
        <div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
          {FEATURES.map((f) => {
            const Icon = ICONS[f.icon];
            return (
              <div key={f.title.en} className="card card-hover group">
                <div className="flex h-12 w-12 items-center justify-center rounded-xl bg-brand-500/10 text-brand-600 transition group-hover:bg-brand-500/20 dark:bg-brand-500/15 dark:text-brand-300 dark:group-hover:bg-brand-500/25">
                  <Icon className="h-6 w-6" />
                </div>
                <h3 className="mt-5 text-lg font-semibold text-slate-900 dark:text-white">{f.title[lang]}</h3>
                <p className="mt-2 text-sm leading-relaxed text-slate-600 dark:text-slate-400">
                  {f.description[lang]}
                </p>
              </div>
            );
          })}
        </div>
      </div>
    </Section>
  );
}
