`;
}
// --- PDF EXPORT ---
function handleDownloadPdf() {
if (!window.jspdf) {
console.error("jsPDF library not loaded.");
return;
}
const { jsPDF } = window.jspdf;
const doc = new jsPDF();
doc.setFont('helvetica', 'bold');
doc.setFontSize(18);
doc.setTextColor(40);
doc.text(pdfData.title, 14, 22);
if (pdfData.type === 'list') {
doc.autoTable({
head: [pdfData.headers],
body: pdfData.rows,
startY: 30,
theme: 'grid',
headStyles: { fillColor: [59, 130, 246] }, // Tailwind blue-500
styles: { font: 'inter', cellPadding: 3 },
});
} else if (pdfData.type === 'single') {
doc.autoTable({
body: pdfData.rows,
startY: 30,
theme: 'striped',
styles: { font: 'inter', cellPadding: 3 },
columnStyles: {
0: { fontStyle: 'bold' }
}
});
}
doc.save('baby-name-results.pdf');
}
// --- RUN INITIALIZATION ---
initialize();
});
