// BEGIN CHANGE: pagina Download (links reais do config.php legado)
"use client";

import { useI18n } from "@/i18n/LanguageProvider";
import { Navbar } from "@/components/Navbar";
import { Footer } from "@/components/Footer";

const DL_BASE = "https://ot.whiteantidote.com/Downloads";

export default function DownloadPage() {
  const { t } = useI18n();
  const items = [
    { title: t.download.windows, desc: t.download.windowsDesc, href: `${DL_BASE}/WhiteAntidote.exe` },
    { title: t.download.custom, desc: t.download.customDesc, href: `${DL_BASE}/WhiteAntidoteCustom.exe` },
    { title: t.download.android, desc: t.download.androidDesc, href: `${DL_BASE}/whiteantidote-android.apk` },
  ];

  return (
    <div className="flex min-h-screen flex-col">
      <Navbar />
      <main className="mx-auto w-full max-w-4xl flex-1 px-6 py-14">
        <h1 className="text-3xl font-semibold tracking-tight">{t.download.title}</h1>
        <p className="mt-2 text-muted">{t.download.subtitle}</p>
        {/* BEGIN CHANGE: QoL v1 hint Custom/APK */}
        <p className="mt-3 text-sm text-muted">{t.download.qolHint}</p>
        {/* END CHANGE */}

        <div className="mt-8 grid grid-cols-1 gap-5 sm:grid-cols-3">
          {items.map((it) => (
            <div key={it.title} className="flex flex-col rounded-xl border border-border bg-panel p-6">
              <h2 className="text-base font-semibold">{it.title}</h2>
              <p className="mt-2 flex-1 text-sm text-muted">{it.desc}</p>
              {/* BEGIN CHANGE: Android install hint (signature / arm64) */}
              {it.title === t.download.android && (
                <p className="mt-2 text-xs text-muted">{t.download.androidInstallHint}</p>
              )}
              {/* END CHANGE */}
              <a
                href={it.href}
                target="_blank"
                rel="noreferrer"
                className="mt-5 rounded-lg bg-brand px-4 py-2 text-center text-sm font-medium text-background transition-opacity hover:opacity-90"
              >
                {t.download.getIt}
              </a>
            </div>
          ))}
        </div>
      </main>
      <Footer />
    </div>
  );
}
// END CHANGE
