import Link from "next/link";
import { FileQuestion, ArrowLeft, LayoutDashboard } from "lucide-react";
import { Button } from "@/components/ui/button";

export const metadata = {
  title: "Page not found",
};

/**
 * 404.
 *
 * The previous version was off the design system entirely: a 12rem bouncing
 * numeral, three pulsing orange squares, a hard-coded `#FFA626` accent that
 * appears nowhere else in the product, and a "Close" button calling
 * `window.close()` — which silently does nothing for any page the user
 * navigated to rather than opened via script, so it read as a dead control.
 *
 * It is now a plain centred panel using the app's own tokens, offering the two
 * actions that actually work from a dead URL: go back, or go to the dashboard.
 */
export default function NotFound() {
  return (
    <main className="flex min-h-screen items-center justify-center bg-background px-4 py-16">
      <div className="w-full max-w-md text-center">
        <span
          className="mx-auto mb-5 flex size-12 items-center justify-center rounded-full bg-muted text-muted-foreground"
          aria-hidden
        >
          <FileQuestion className="size-6" />
        </span>

        <p className="oxy-eyebrow">Error 404</p>
        <h1 className="mt-1.5 text-2xl font-semibold tracking-tight text-foreground">
          We couldn&rsquo;t find that page
        </h1>
        <p className="mx-auto mt-2 max-w-sm text-sm leading-relaxed text-muted-foreground">
          The link may be out of date, or the record it pointed to may have been
          removed.
        </p>

        <div className="mt-6 flex flex-col-reverse items-center justify-center gap-2 sm:flex-row">
          <Button variant="outline" asChild className="w-full sm:w-auto">
            <Link href="/">
              <ArrowLeft className="size-4" aria-hidden />
              Back to site
            </Link>
          </Button>
          <Button asChild className="w-full sm:w-auto">
            <Link href="/dashboard">
              <LayoutDashboard className="size-4" aria-hidden />
              Go to dashboard
            </Link>
          </Button>
        </div>
      </div>
    </main>
  );
}
