`).join('');
}function generateRecommendationsArray(scores, metrics, readability) {
const recommendations = [];
if (scores.overall < 70) {
recommendations.push('Improve overall content quality by focusing on clarity, structure, and engagement');
}
if (scores.quality < 75) {
recommendations.push('Enhance content depth with more comprehensive information and examples');
}
if (scores.readability < 70) {
recommendations.push('Simplify sentence structure and use shorter paragraphs for better readability');
}
if (scores.seo < 65) {
recommendations.push('Optimize content with relevant keywords and improve meta information');
}
if (scores.engagement < 75) {
recommendations.push('Add more engaging elements like questions, statistics, and actionable tips');
}
if (metrics.wordCount < 800) {
recommendations.push('Consider expanding content length for better topic coverage and SEO value');
}
if (parseFloat(metrics.avgSentenceLength) > 20) {
recommendations.push('Break down long sentences into shorter, more digestible ones');
}
if (metrics.headingStructure === 'Needs Improvement') {
recommendations.push('Improve heading structure with proper H1, H2, H3 hierarchy for better organization');
}
recommendations.push('Add relevant internal links to improve user navigation and SEO');
recommendations.push('Include visual elements like images, infographics, or videos to enhance engagement');
return recommendations.slice(0, 8);
}function showError(msg) {
const el = document.getElementById('errorMessage');
el.textContent = msg;
el.classList.add('show');
}function hideError() {
document.getElementById('errorMessage').classList.remove('show');
}function showNotification(msg) {
const notif = document.getElementById('notification');
notif.textContent = msg;
notif.classList.add('show');
setTimeout(() => notif.classList.remove('show'), 2500);
}