`).join('');
container.innerHTML = `
Insurance Plan Comparison
${resultsHtml}
Disclaimer: This is a simplified comparison for informational purposes only. Coverage amounts and terms vary by provider. Always read the full policy details before purchasing.
`;
downloadBtn.classList.remove('hidden');
}
function downloadPDF() {
const { jsPDF } = window.jspdf;
const pdf = new jsPDF({ orientation: 'p', unit: 'mm', format: 'a4' });
const contentToPrint = document.getElementById('dashboard-content');
if (!contentToPrint) return;
html2canvas(contentToPrint, { scale: 2, useCORS: true }).then(canvas => {
const imgData = canvas.toDataURL('image/png');
const pdfWidth = pdf.internal.pageSize.getWidth();
const pdfHeight = (canvas.height * pdfWidth) / canvas.width;
pdf.addImage(imgData, 'PNG', 10, 10, pdfWidth - 20, pdfHeight > 277 ? 277 : pdfHeight - 20);
pdf.save('Travel-Insurance-Comparison.pdf');
});
}
