import { ExternalLink } from "lucide-react";

export default function Journal() {
  return (
    <div className="flex flex-col gap-16 w-full">
      {/* Journal de campagne */}
      <section className="w-full py-1">
        <div className="flex flex-col gap-16 w-full">
          <h2 className="text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50 mb-4">
            JOURNAL SYNTHÈSE
          </h2>
        </div>

        {/* Affichage du PDF */}
        <div className="bg-white rounded-2xl shadow-lg overflow-hidden border border-zinc-200">
          {/* Version mobile : bouton pour ouvrir le PDF */}
          <div className="block md:hidden p-6">
            <a
              href="/JournalSynthese.pdf"
              target="_blank"
              rel="noopener noreferrer"
              className="flex items-center justify-center gap-3 w-full px-6 py-4 bg-orange text-white rounded-lg font-semibold hover:bg-orange/90 transition-colors shadow-md"
            >
              <ExternalLink size={20} />
              <span>Ouvrir le journal synthèse</span>
            </a>
            <p className="text-sm text-zinc-600 dark:text-zinc-400 text-center mt-4">
              Pour une meilleure lecture sur mobile, ouvrez le PDF dans un
              nouvel onglet
            </p>
          </div>

          {/* Version desktop : iframe optimisée */}
          <div className="hidden md:block relative w-full h-[calc(100vh-200px)] min-h-[800px]">
            <iframe
              src="/JournalSynthese.pdf#view=FitH&zoom=page-width"
              className="w-full h-full border-0"
              title="Journal synthèse"
              style={{
                overflow: "hidden",
              }}
            />
          </div>
        </div>
      </section>
    </div>
  );
}
