import Link from 'next/link';
import { ArrowLeft, LayoutGrid } from 'lucide-react';
import LightHeaderLogo from '@/components/brand/LightHeaderLogo';

export default function ToolWorkspaceShell({ title, description, landingHref, children }) {
  return (
    <main className="min-h-screen bg-[#F8F4F0] text-[#421125]">
      <header className="border-b border-white/10 bg-[#3B0D20] shadow-lg">
        <div className="mx-auto flex min-h-20 max-w-7xl items-center justify-between gap-4 px-4 sm:px-6 lg:px-8">
          <Link href="/" aria-label="Cambridge Veritas home">
            <LightHeaderLogo className="h-9 w-auto object-contain sm:h-10" />
          </Link>
          <nav className="flex items-center gap-2" aria-label="Tool workspace navigation">
            <Link href="/tools-dashboard" className="inline-flex min-h-10 items-center gap-2 rounded-xl px-3 py-2 text-sm font-bold text-white/75 transition hover:bg-white/10 hover:text-white sm:px-4">
              <LayoutGrid className="h-4 w-4" aria-hidden="true" /> <span className="hidden sm:inline">All tools</span>
            </Link>
            <Link href={landingHref} className="inline-flex min-h-10 items-center gap-2 rounded-xl px-3 py-2 text-sm font-bold text-white/75 transition hover:bg-white/10 hover:text-white sm:px-4">
              <ArrowLeft className="h-4 w-4" aria-hidden="true" /> <span className="hidden sm:inline">About this tool</span>
            </Link>
          </nav>
        </div>
      </header>

      <section className="border-b border-[#E6D9D1] bg-white">
        <div className="mx-auto max-w-7xl px-4 py-7 sm:px-6 lg:px-8">
          <p className="text-xs font-black uppercase tracking-[0.18em] text-[#A27918]">My tools workspace</p>
          <h1 className="mt-2 text-3xl font-black tracking-tight text-[#421125] sm:text-4xl">{title}</h1>
          <p className="mt-3 max-w-3xl text-sm leading-7 text-[#765D67] sm:text-base">{description}</p>
        </div>
      </section>

      {children}
    </main>
  );
}
