"use client";

import { motion } from "framer-motion";
import { ShieldCheck, Award, Globe2, Wrench, PackageCheck, HeadphonesIcon } from "lucide-react";

export default function TrustSection({ dict, clients }: { dict: any, clients?: any[] }) {
  const defaultTrustItems = [
    {
      icon: <Award className="w-8 h-8 text-brand-accent" />,
      title: "ISO Certified",
      desc: "Manufacturing to the highest global standards"
    },
    {
      icon: <ShieldCheck className="w-8 h-8 text-brand-accent" />,
      title: "NSA Approved",
      desc: "Meets military data destruction requirements"
    },
    {
      icon: <PackageCheck className="w-8 h-8 text-brand-accent" />,
      title: "Premium Build",
      desc: "Engineered for heavy-duty industrial use"
    },
    {
      icon: <Globe2 className="w-8 h-8 text-brand-accent" />,
      title: "Global Delivery",
      desc: "Shipping and installation worldwide"
    },
    {
      icon: <Wrench className="w-8 h-8 text-brand-accent" />,
      title: "5-Year Warranty",
      desc: "Guaranteed reliability on cutting knives"
    },
    {
      icon: <HeadphonesIcon className="w-8 h-8 text-brand-accent" />,
      title: "24/7 Support",
      desc: "Dedicated technical assistance"
    }
  ];

  const trustItems = dict.trustSection?.items ? defaultTrustItems.map((c, i) => ({...c, title: dict.trustSection.items[i]?.title || c.title, desc: dict.trustSection.items[i]?.desc || c.desc})) : defaultTrustItems;

  return (
    <section className="py-16 bg-background border-b border-border/50">
      <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        
        <div className="text-center mb-12">
          <h2 className="text-sm font-black tracking-widest text-gray-400 uppercase">
            {dict.trustSection?.title || 'Trusted by Government & Military Worldwide'}
          </h2>
        </div>

        <div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-8 mb-20">
          {trustItems.map((item, index) => (
            <motion.div
              key={index}
              initial={{ opacity: 0, y: 20 }}
              whileInView={{ opacity: 1, y: 0 }}
              viewport={{ once: true }}
              transition={{ delay: index * 0.1, duration: 0.5 }}
              className="flex flex-col items-center text-center group"
            >
              <div className="w-16 h-16 rounded-full bg-muted flex items-center justify-center mb-4 group-hover:bg-brand-accent/10 group-hover:scale-110 transition-all duration-300">
                {item.icon}
              </div>
              <h3 className="font-bold text-foreground text-sm mb-1">{item.title}</h3>
              <p className="text-xs text-gray-500">{item.desc}</p>
            </motion.div>
          ))}
        </div>

        {clients && clients.length > 0 && (
          <div className="pt-16 border-t border-border/50">
            <div className="text-center mb-10">
              <h2 className="text-2xl font-black text-foreground">
                Qui nous fait confiance
              </h2>
            </div>
            <div className="flex flex-wrap justify-center gap-10 items-center opacity-70 hover:opacity-100 transition-opacity">
              {clients.map((client, index) => (
                <img key={client.id} src={client.logoUrl} alt={client.name} className="h-16 object-contain grayscale hover:grayscale-0 transition-all duration-300 cursor-pointer" />
              ))}
            </div>
          </div>
        )}
      </div>
    </section>
  );
}
