import { ShieldCheck, FileCheck } from "lucide-react";
import { formatDateTimeEST } from "@/lib/timezoneUtils";

interface ValidationProofPageProps {
  documentName?: string;
  issuerName?: string;
  timestamp?: string;
  validationId?: string;
}

export function ValidationProofPage({
  documentName = "Official Document",
  issuerName = "ACM Community Management",
  timestamp = new Date().toISOString(),
  validationId = "XXXX-XXXX-XXXX-XXXX",
}: ValidationProofPageProps) {
  const formattedDate = formatDateTimeEST(timestamp);

  return (
    <div className="w-[8.5in] min-h-[11in] mx-auto bg-card p-[0.5in] relative border-2 shadow-sm print:shadow-none print:border-none">
      <div className="w-full h-full border-[3px] border-foreground p-1">
        <div className="w-full h-full border border-foreground p-8 flex flex-col items-center relative">
          <div className="mb-6 mt-12 text-foreground">
            <ShieldCheck className="w-20 h-20 mx-auto opacity-20 absolute top-12 left-1/2 -translate-x-1/2" />
          </div>

          <h1 className="text-3xl font-bold text-foreground tracking-wider mb-2 relative z-10 text-center">
            CERTIFICATE OF VALIDATION
          </h1>

          <p className="text-muted-foreground mb-12 text-center italic relative z-10">
            This page serves as cryptographic proof of document generation and integrity.
          </p>

          <div className="w-full max-w-2xl text-left space-y-6 relative z-10 mt-8">
            <div className="grid grid-cols-3 border-b pb-2">
              <span className="font-bold text-foreground">Document Name:</span>
              <span className="col-span-2 text-foreground">{documentName}</span>
            </div>
            <div className="grid grid-cols-3 border-b pb-2">
              <span className="font-bold text-foreground">Generated On:</span>
              <span className="col-span-2 text-foreground">{formattedDate}</span>
            </div>
            <div className="grid grid-cols-3 border-b pb-2">
              <span className="font-bold text-foreground">Issued By:</span>
              <span className="col-span-2 text-foreground">{issuerName}</span>
            </div>
            <div className="grid grid-cols-3 border-b pb-2 mt-4">
              <span className="font-bold text-foreground">Validation ID:</span>
              <span className="col-span-2 font-mono font-bold text-primary">{validationId}</span>
            </div>
          </div>

          <div className="mt-12 w-full max-w-2xl text-muted-foreground text-sm italic leading-relaxed">
            To verify the authenticity of this document, please scan the QR code below or reference
            the Validation ID with the issuing authority.
          </div>

          <div className="mt-16 w-full max-w-2xl flex items-end justify-between">
            <div className="w-32 h-32 bg-muted border flex items-center justify-center p-2">
              <div className="w-full h-full border-4 border-foreground border-dashed opacity-50 flex items-center justify-center">
                <span className="text-[10px] font-bold text-muted-foreground">QR CODE</span>
              </div>
            </div>

            <div className="flex-1 ml-16 flex items-center justify-between">
              <div className="flex-1 max-w-xs">
                <div className="border-b border-foreground w-full mb-2" />
                <div className="text-xs text-muted-foreground">Authorized Digital System Signature</div>
                <div className="text-xs text-muted-foreground/70 italic mt-1">{issuerName}</div>
              </div>

              <div className="w-24 h-24 rounded-full border-4 border-primary/30 flex flex-col items-center justify-center -rotate-12">
                <FileCheck className="w-6 h-6 text-primary/50 mb-1" />
                <span className="text-[9px] font-bold text-primary/50">OFFICIAL</span>
                <span className="text-[9px] font-bold text-primary/50">SEAL</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  );
}

export default ValidationProofPage;
