import Link from "next/link";
import { SiteFooter } from "../../../components/site-footer";
import { SiteHeader } from "../../../components/site-header";
import { PageSchema } from "../../../components/page-schema";
import { siteInfo } from "../../../data/site";

export const metadata = {
    title: "LedgerOne vs YNAB",
    description: "Compare LedgerOne's audit-ready financial platform with YNAB's zero-based budgeting tool.",
    keywords: siteInfo.keywords
};

export default function CompareYnabPage() {
    const schema = [
        {
            "@context": "https://schema.org",
            "@type": "WebPage",
            name: "LedgerOne vs YNAB",
            description: "Comparison of LedgerOne and YNAB.",
            url: `${siteInfo.url}/compare/vs-ynab`
        }
    ];

    return (
        <div className="min-h-screen bg-background font-sans text-foreground flex flex-col">
            <SiteHeader />

            <main className="flex-1 pt-32 pb-24">
                <div className="max-w-7xl mx-auto px-6 lg:px-8">
                    <div className="text-center max-w-3xl mx-auto mb-16">
                        <div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-secondary/50 border border-border text-xs font-medium text-muted-foreground mb-6">
                            Comparison
                        </div>
                        <h1 className="text-4xl font-bold tracking-tight text-foreground sm:text-5xl mb-6">
                            Beyond Budgeting.
                        </h1>
                        <p className="text-lg text-muted-foreground">
                            YNAB is great for personal envelopes. LedgerOne is built for business growth, audit trails, and total financial control.
                        </p>
                    </div>

                    <div className="glass-panel rounded-3xl overflow-hidden shadow-sm border border-border">
                        <div className="grid grid-cols-3 bg-secondary/30 border-b border-border p-6 text-sm font-bold text-muted-foreground uppercase tracking-wider">
                            <div className="col-span-1">Feature</div>
                            <div className="col-span-1 text-center text-foreground">LedgerOne</div>
                            <div className="col-span-1 text-center">YNAB</div>
                        </div>

                        {[
                            { feature: "Primary Focus", l1: "Business & Wealth Growth", sheet: "Zero-Based Budgeting" },
                            { feature: "Audit Trail", l1: "Immutable Logs", sheet: "None" },
                            { feature: "Forecasting", l1: "Cash Flow Projections", sheet: "Current Cash Only" },
                            { feature: "Collaboration", l1: "Accountant & Team Access", sheet: "Partner Sharing" },
                            { feature: "Reporting", l1: "P&L, Tax-Ready Exports", sheet: "Spending Reports" },
                            { feature: "Asset Tracking", l1: "Real Estate, Crypto, Equity", sheet: "Manual Accounts" },
                        ].map((row, i) => (
                            <div key={row.feature} className={`grid grid-cols-3 p-6 items-center border-b border-border last:border-0 ${i % 2 === 0 ? 'bg-background/50' : 'bg-secondary/10'}`}>
                                <div className="col-span-1 font-medium text-foreground">{row.feature}</div>
                                <div className="col-span-1 text-center font-bold text-primary flex justify-center items-center gap-2">
                                    <svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M5 13l4 4L19 7"></path></svg>
                                    {row.l1}
                                </div>
                                <div className="col-span-1 text-center text-muted-foreground">
                                    {row.sheet}
                                </div>
                            </div>
                        ))}
                    </div>

                    <div className="mt-16 text-center">
                        <h2 className="text-2xl font-bold text-foreground mb-6">Ready to scale?</h2>
                        <Link
                            href="/register"
                            className="rounded-full bg-primary px-8 py-3 text-sm font-bold text-primary-foreground shadow-lg hover:bg-primary/90 transition-all"
                        >
                            Start your free trial
                        </Link>
                    </div>
                </div>
            </main>

            <SiteFooter />
            <PageSchema schema={schema} />
        </div>
    );
}
