export default function TransparencyScore({ score = 88 }) {
  const color = score >= 80 ? "text-emerald-600" : score >= 60 ? "text-amber-500" : "text-red-500";
  const bgColor = score >= 80 ? "bg-emerald-500" : score >= 60 ? "bg-amber-500" : "bg-red-500";
  const label = score >= 80 ? "Sangat Baik" : score >= 60 ? "Cukup" : "Perlu Perbaikan";

  return (
    <div className="bg-card rounded-xl border border-border p-5">
      <div className="flex items-center justify-between mb-3">
        <h3 className="font-bold text-foreground text-sm">Skor Transparansi</h3>
        <span className={`text-xs font-semibold px-2 py-0.5 rounded-full ${score >= 80 ? "bg-emerald-100 text-emerald-700" : score >= 60 ? "bg-amber-100 text-amber-700" : "bg-red-100 text-red-700"}`}>{label}</span>
      </div>
      <div className="flex items-end gap-2">
        <span className={`text-4xl font-black ${color}`}>{score}</span>
        <span className="text-muted-foreground text-sm mb-1">/100</span>
      </div>
      <div className="mt-3 bg-muted rounded-full h-2">
        <div className={`${bgColor} h-2 rounded-full transition-all`} style={{ width: `${score}%` }} />
      </div>
      <div className="mt-3 grid grid-cols-3 gap-2 text-xs">
        {[["Pelaporan", "95%"], ["Ketepatan Waktu", "82%"], ["Kelengkapan Data", "87%"]].map(([label, val]) => (
          <div key={label} className="text-center">
            <p className="font-bold text-foreground">{val}</p>
            <p className="text-muted-foreground">{label}</p>
          </div>
        ))}
      </div>
    </div>
  );
}