"use client";

import { Target, Layers, Handshake } from "lucide-react";
import { motion } from "framer-motion";
import { TRUST_PRINCIPLES } from "~/lib/data";

const ICON_MAP = [Target, Layers, Handshake] as const;

export function Trust() {
  return (
    <section className="bg-gradient-to-b from-white to-amber-50/20 py-20 md:py-28">
      <div className="container mx-auto px-4 md:px-6">
        <motion.h2
          initial={{ opacity: 0, y: 12 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: true, margin: "-80px" }}
          className="text-center text-2xl font-bold text-neutral-900 md:text-3xl"
        >
          💎 我们的原则
        </motion.h2>
        <motion.p
          initial={{ opacity: 0 }}
          whileInView={{ opacity: 1 }}
          viewport={{ once: true }}
          className="mx-auto mt-3 max-w-2xl text-center text-neutral-600"
        >
          不吹嘘，不夸大，只说清楚我们相信什么
        </motion.p>

        <div className="mt-12 grid gap-6 md:grid-cols-3">
          {TRUST_PRINCIPLES.map((p, i) => {
            const Icon = ICON_MAP[i];
            return (
              <motion.div
                key={p.title}
                initial={{ opacity: 0, y: 20 }}
                whileInView={{ opacity: 1, y: 0 }}
                viewport={{ once: true, margin: "-40px" }}
                transition={{ delay: i * 0.06 }}
                className="rounded-2xl border-2 border-neutral-200/80 bg-white p-6 text-center shadow-sm transition-all hover:border-amber-200 hover:shadow-lg"
              >
                <Icon className="mx-auto h-9 w-9 text-neutral-600" />
                <h3 className="mt-4 font-medium text-neutral-900">
                  {p.title}
                </h3>
                <p className="mt-2 text-sm text-neutral-600">
                  {p.description}
                </p>
              </motion.div>
            );
          })}
        </div>
      </div>
    </section>
  );
}
