* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #007bff;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #333;
    color: #fff;
    padding: 1rem;
    z-index: 1000;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.cookie-content p {
    margin: 0;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Page Header */
.page-header {
    background: #f8f9fa;
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.125rem;
    color: #666;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.comparison-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s;
}

.comparison-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.comparison-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.comparison-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.comparison-card .category {
    color: #007bff;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.comparison-card p {
    color: #666;
    margin-bottom: 1rem;
}

.comparison-card .btn {
    width: 100%;
    text-align: center;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box input,
.category-filter select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    min-width: 200px;
}

/* Features */
.features {
    padding: 4rem 0;
    background: #f8f9fa;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature {
    text-align: center;
    padding: 2rem;
}

.feature h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* Comparison Detail */
.comparison-detail {
    padding: 2rem 0;
}

.comparison-header {
    text-align: center;
    margin-bottom: 3rem;
}

.comparison-header img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.comparison-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.comparison-header .category {
    color: #007bff;
    font-size: 1.1rem;
    font-weight: 500;
}

.comparison-content {
    max-width: 800px;
    margin: 0 auto;
}

.comparison-section {
    margin-bottom: 3rem;
}

.comparison-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.comparison-section ul {
    list-style: none;
    padding: 0;
}

.comparison-section li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.comparison-section li:before {
    content: "•";
    color: #007bff;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.pros, .cons {
    padding: 1.5rem;
    border-radius: 8px;
}

.pros {
    background: #f8fff8;
    border-left: 4px solid #28a745;
}

.cons {
    background: #fff8f8;
    border-left: 4px solid #dc3545;
}

.external-links {
    margin: 2rem 0;
}

.external-links a {
    display: inline-block;
    margin: 0.5rem 1rem 0.5rem 0;
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    color: #007bff;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid #e5e5e5;
    transition: all 0.3s;
}

.external-links a:hover {
    background: #e9ecef;
}

/* Content Pages */
.content {
    padding: 2rem 0;
}

.content-body {
    max-width: 800px;
    margin: 0 auto;
}

.content-body h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    color: #333;
}

.content-body h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem 0;
    color: #333;
}

.content-body ul, .content-body ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.content-body li {
    margin: 0.5rem 0;
}

.content-body a {
    color: #007bff;
    text-decoration: none;
}

.content-body a:hover {
    text-decoration: underline;
}

/* Contact */
.contact {
    padding: 2rem 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-form {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.form-message {
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.contact-info h2 {
    margin-bottom: 1.5rem;
}

.contact-details {
    margin-bottom: 2rem;
}

.contact-item {
    margin-bottom: 1.5rem;
}

.contact-item h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.contact-item p {
    color: #666;
}

.contact-item a {
    color: #007bff;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: #333;
    color: #fff;
    padding: 3rem 0 1rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #fff;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 1rem;
    text-align: center;
    color: #ccc;
}

/* Not Found */
.not-found {
    padding: 4rem 0;
    text-align: center;
}

.not-found h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .search-box input,
    .category-filter select {
        width: 100%;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 2rem 0;
    }

    .page-header {
        padding: 2rem 0;
    }

    .comparison-card,
    .contact-form {
        padding: 1rem;
    }
}

/* FILE: assets/app.js -->
// Comparison data
const comparisons = [
    {
        id: 1,
        title: "Project Management Tools Comparison",
        category: "Productivity Apps",
        overview: "A comprehensive comparison of popular project management tools including features, pricing, and use cases. This comparison examines tools designed to help teams organize tasks, track progress, and collaborate effectively.",
        features: [
            "Task management and organization",
            "Team collaboration features",
            "Timeline and Gantt chart views",
            "File sharing and document management",
            "Integration with other tools",
            "Mobile applications",
            "Reporting and analytics",
            "Custom workflows"
        ],
        pros: [
            "Streamlines team communication and task tracking",
            "Provides visual project timelines and progress tracking",
            "Integrates with many popular business tools",
            "Offers mobile access for remote work",
            "Customizable to different project types"
        ],
        cons: [
            "Can have a learning curve for new users",
            "Advanced features often require higher-tier plans",
            "May be overwhelming for simple projects",
            "Pricing can escalate with team size"
        ],
        bestFor: "Teams of 5+ members working on complex projects with multiple stakeholders and deadlines",
        notIdealFor: "Individual users or very small teams with simple task management needs",
        pricingNote: "Most tools offer free tiers for small teams, with paid plans typically ranging from $5-15 per user per month",
        externalLinks: [
            { name: "Asana", url: "https://asana.com" },
            { name: "Trello", url: "https://trello.com" },
            { name: "Monday.com", url: "https://monday.com" }
        ],
        image: "/assets/compare-01.svg"
    },
    {
        id: 2,
        title: "Online Learning Platforms",
        category: "Learning Platforms",
        overview: "An educational comparison of major online learning platforms, examining their course offerings, teaching methods, and learning experiences for different types of learners.",
        features: [
            "Course variety and subject coverage",
            "Video lectures and interactive content",
            "Assignments and practical exercises",
            "Certificates and credentials",
            "Community features and discussion forums",
            "Mobile learning applications",
            "Progress tracking and analytics",
            "Instructor support and feedback"
        ],
        pros: [
            "Flexible learning schedules and self-paced options",
            "Access to courses from top universities and experts",
            "Cost-effective compared to traditional education",
            "Wide variety of subjects and specializations",
            "Can learn from anywhere with internet access"
        ],
        cons: [
            "Requires high self-motivation and discipline",
            "Limited hands-on practical experience in some fields",
            "Less direct interaction with instructors",
            "Quality can vary significantly between courses"
        ],
        bestFor: "Self-motivated learners seeking to develop new skills or advance their careers through flexible online education",
        notIdealFor: "Learners who need significant hands-on practice or prefer traditional classroom environments",
        pricingNote: "Pricing varies widely, from free courses to monthly subscriptions ($20-80) or individual course purchases ($50-500)",
        externalLinks: [
            { name: "Coursera", url: "https://coursera.org" },
            { name: "Udemy", url: "https://udemy.com" },
            { name: "edX", url: "https://edx.org" }
        ],
        image: "/assets/compare-02.svg"
    },
    {
        id: 3,
        title: "Code Editor and IDE Comparison",
        category: "Software Tools",
        overview: "A technical comparison of popular code editors and integrated development environments (IDEs), focusing on features, performance, and suitability for different programming languages and development workflows.",
        features: [
            "Syntax highlighting and code completion",
            "Debugging tools and error detection",
            "Plugin and extension ecosystem",
            "Version control integration",
            "Multi-language support",
            "Customizable interface and themes",
            "Built-in terminal and command line tools",
            "Project management and file organization"
        ],
        pros: [
            "Significantly improves coding efficiency and productivity",
            "Helps catch errors and bugs during development",
            "Extensible through plugins and extensions",
            "Supports multiple programming languages",
            "Integrates well with development workflows"
        ],
        cons: [
            "Can be resource-intensive on older computers",
            "Learning curve for advanced features",
            "Some IDEs are language-specific",
            "Plugin management can become complex"
        ],
        bestFor: "Developers working on medium to large projects who need advanced debugging and project management features",
        notIdealFor: "Beginners who might be overwhelmed by features, or developers working on very simple scripts",
        pricingNote: "Many excellent options are free and open-source, while professional IDEs typically cost $100-700 annually",
        externalLinks: [
            { name: "Visual Studio Code", url: "https://code.visualstudio.com" },
            { name: "IntelliJ IDEA", url: "https://jetbrains.com/idea" },
            { name: "Sublime Text", url: "https://sublimetext.com" }
        ],
        image: "/assets/compare-03.svg"
    },
    {
        id: 4,
        title: "Video Conferencing Solutions",
        category: "Productivity Apps",
        overview: "A comparison of video conferencing platforms examining their features, reliability, and suitability for different types of meetings and organizations.",
        features: [
            "HD video and audio quality",
            "Screen sharing and presentation tools",
            "Recording and playback capabilities",
            "Chat and messaging during calls",
            "Participant management and controls",
            "Calendar integration and scheduling",
            "Mobile and desktop applications",
            "Security and encryption features"
        ],
        pros: [
            "Enables remote work and global collaboration",
            "Reduces travel costs and time",
            "Supports large group meetings and webinars",
            "Integrates with productivity and calendar tools",
            "Provides recording for future reference"
        ],
        cons: [
            "Dependent on internet connection quality",
            "Can experience technical issues during important meetings",
            "May lack the personal touch of in-person meetings",
            "Privacy and security concerns with some platforms"
        ],
        bestFor: "Organizations with remote teams, frequent client meetings, or need for large-scale webinars and presentations",
        notIdealFor: "Organizations that primarily work in-person or have very limited internet connectivity",
        pricingNote: "Basic plans often free for small groups, professional plans typically $10-20 per host per month",
        externalLinks: [
            { name: "Zoom", url: "https://zoom.us" },
            { name: "Microsoft Teams", url: "https://teams.microsoft.com" },
            { name: "Google Meet", url: "https://meet.google.com" }
        ],
        image: "/assets/compare-04.svg"
    },
    {
        id: 5,
        title: "Cloud Storage Services",
        category: "Productivity Apps",
        overview: "An analysis of major cloud storage services, comparing their storage options, synchronization features, security measures, and collaboration capabilities.",
        features: [
            "File synchronization across devices",
            "Sharing and collaboration tools",
            "Version history and file recovery",
            "Security and encryption options",
            "Mobile and desktop applications",
            "Integration with other services",
            "Backup and restore capabilities",
            "Admin controls for business accounts"
        ],
        pros: [
            "Access files from anywhere with internet connection",
            "Automatic backup prevents data loss",
            "Easy sharing and collaboration on documents",
            "Frees up local storage space",
            "Version control helps track document changes"
        ],
        cons: [
            "Requires internet connection for full functionality",
            "Ongoing subscription costs for larger storage",
            "Privacy concerns with storing data on external servers",
            "Sync conflicts can occur with multiple users"
        ],
        bestFor: "Individuals and teams who need to access files across multiple devices and collaborate on documents",
        notIdealFor: "Users with very limited internet access or strict data privacy requirements",
        pricingNote: "Most services offer 2-15GB free storage, with paid plans typically $2-10 per month for 100GB-2TB",
        externalLinks: [
            { name: "Google Drive", url: "https://drive.google.com" },
            { name: "Dropbox", url: "https://dropbox.com" },
            { name: "OneDrive", url: "https://onedrive.microsoft.com" }
        ],
        image: "/assets/compare-05.svg"
    },
    {
        id: 6,
        title: "Email Marketing Platforms",
        category: "Software Tools",
        overview: "A comparison of email marketing platforms focusing on their automation capabilities, design tools, analytics, and deliverability features for businesses of different sizes.",
        features: [
            "Email template design tools",
            "List management and segmentation",
            "Automation and drip campaigns",
            "A/B testing capabilities",
            "Analytics and reporting",
            "Integration with CRM and other tools",
            "Deliverability optimization",
            "Compliance and privacy features"
        ],
        pros: [
            "Cost-effective marketing channel with high ROI",
            "Allows personalized communication at scale",
            "Detailed analytics help optimize campaigns",
            "Automation saves time and improves consistency",
            "Direct communication channel with customers"
        ],
        cons: [
            "Risk of emails being marked as spam",
            "Requires ongoing content creation and management",
            "List building can be slow and challenging",
            "Compliance with privacy regulations can be complex"
        ],
        bestFor: "Businesses with established customer bases looking to maintain regular communication and drive sales",
        notIdealFor: "Very new businesses without email lists or those in industries with strict communication regulations",
        pricingNote: "Free tiers often available for small lists, paid plans typically $10-100+ monthly based on subscriber count",
        externalLinks: [
            { name: "Mailchimp", url: "https://mailchimp.com" },
            { name: "ConvertKit", url: "https://convertkit.com" },
            { name: "Constant Contact", url: "https://constantcontact.com" }
        ],
        image: "/assets/compare-06.svg"
    },
    {
        id: 7,
        title: "Design Software Comparison",
        category: "Software Tools",
        overview: "An evaluation of graphic design software options, comparing their features, learning curves, and suitability for different types of design work and skill levels.",
        features: [
            "Vector and raster graphics editing",
            "Typography and text tools",
            "Color management and palettes",
            "Layer management and organization",
            "Templates and design assets",
            "Collaboration and sharing features",
            "Export options and file formats",
            "Plugin and extension support"
        ],
        pros: [
            "Professional-quality design capabilities",
            "Wide range of creative tools and effects",
            "Industry-standard formats and compatibility",
            "Large communities and learning resources",
            "Scalable from basic to advanced projects"
        ],
        cons: [
            "Steep learning curve for beginners",
            "Can be expensive for professional versions",
            "Resource-intensive on computer systems",
            "Overwhelming number of features for simple tasks"
        ],
        bestFor: "Designers, marketers, and content creators who need professional-quality graphics and have time to learn the tools",
        notIdealFor: "Casual users who need only basic image editing or those with very limited budgets",
        pricingNote: "Ranges from free open-source options to $20-50 monthly subscriptions for professional software",
        externalLinks: [
            { name: "Adobe Creative Suite", url: "https://adobe.com" },
            { name: "Canva", url: "https://canva.com" },
            { name: "Figma", url: "https://figma.com" }
        ],
        image: "/assets/compare-07.svg"
    },
    {
        id: 8,
        title: "Password Management Tools",
        category: "Software Tools",
        overview: "A security-focused comparison of password management solutions, examining their encryption methods, usability, and features for personal and business use.",
        features: [
            "Secure password generation",
            "Encrypted password storage",
            "Auto-fill for websites and apps",
            "Multi-device synchronization",
            "Two-factor authentication support",
            "Secure sharing capabilities",
            "Security breach monitoring",
            "Emergency access features"
        ],
        pros: [
            "Significantly improves online security",
            "Eliminates need to remember multiple passwords",
            "Generates strong, unique passwords automatically",
            "Convenient auto-fill saves time",
            "Helps identify and update weak passwords"
        ],
        cons: [
            "Single point of failure if master password is compromised",
            "Requires trust in the password manager company",
            "Can be inconvenient if service is temporarily unavailable",
            "Learning curve for new users"
        ],
        bestFor: "Anyone who uses multiple online accounts and wants to improve their digital security without complexity",
        notIdealFor: "Users who are uncomfortable with cloud storage or prefer to manage passwords manually",
        pricingNote: "Basic versions often free, premium features typically $2-8 per month for individuals, more for families/teams",
        externalLinks: [
            { name: "1Password", url: "https://1password.com" },
            { name: "Bitwarden", url: "https://bitwarden.com" },
            { name: "LastPass", url: "https://lastpass.com" }
        ],
        image: "/assets/compare-08.svg"
    }
];

// App state
let filteredComparisons = [...comparisons];

// Utility functions
function getUrlParams() {
    const params = new URLSearchParams(window.location.search);
    return {
        id: params.get('id')
    };
}

function createComparisonCard(comparison) {
    return `
        <div class="comparison-card">
            <img src="${comparison.image}" alt="${comparison.title}" width="60" height="60">
            <div class="category">${comparison.category}</div>
            <h3>${comparison.title}</h3>
            <p>${comparison.overview.substring(0, 150)}...</p>
            <a href="/comparison/?id=${comparison.id}" class="btn btn-primary">View Comparison</a>
        </div>
    `;
}

function renderComparisonGrid(container, comparisonsToRender) {
    if (container) {
        container.innerHTML = comparisonsToRender.map(createComparisonCard).join('');
    }
}

function renderPopularComparisons() {
    const container = document.getElementById('popular-comparisons-grid');
    if (container) {
        const popularComparisons = comparisons.slice(0, 6);
        renderComparisonGrid(container, popularComparisons);
    }
}

function renderAllComparisons() {
    const container = document.getElementById('comparisons-grid');
    renderComparisonGrid(container, filteredComparisons);
}

function setupCategoryFilter() {
    const categoryFilter = document.getElementById('category-filter');
    if (categoryFilter) {
        const categories = [...new Set(comparisons.map(c => c.category))];
        categories.forEach(category => {
            const option = document.createElement('option');
            option.value = category;
            option.textContent = category;
            categoryFilter.appendChild(option);
        });

        categoryFilter.addEventListener('change', filterComparisons);
    }
}

function setupSearch() {
    const searchInput = document.getElementById('search-input');
    if (searchInput) {
        searchInput.addEventListener('input', filterComparisons);
    }
}

function filterComparisons() {
    const searchTerm = document.getElementById('search-input')?.value.toLowerCase() || '';
    const selectedCategory = document.getElementById('category-filter')?.value || '';

    filteredComparisons = comparisons.filter(comparison => {
        const matchesSearch = comparison.title.toLowerCase().includes(searchTerm) ||
                            comparison.overview.toLowerCase().includes(searchTerm) ||
                            comparison.category.toLowerCase().includes(searchTerm);
        
        const matchesCategory = !selectedCategory || comparison.category === selectedCategory;
        
        return matchesSearch && matchesCategory;
    });

    renderAllComparisons();
}

function renderComparisonDetail() {
    const { id } = getUrlParams();
    const comparison = comparisons.find(c => c.id === parseInt(id));
    
    const detailContainer = document.getElementById('comparison-detail');
    const notFoundContainer = document.getElementById('comparison-not-found');

    if (comparison && detailContainer) {
        document.getElementById('page-title').textContent = `${comparison.title} - Professional Compare Guide`;
        document.getElementById('page-description').setAttribute('content', comparison.overview);

        detailContainer.innerHTML = `
            <div class="container">
                <div class="comparison-header">
                    <img src="${comparison.image}" alt="${comparison.title}" width="80" height="80">
                    <h1>${comparison.title}</h1>
                    <div class="category">${comparison.category}</div>
                </div>

                <div class="comparison-content">
                    <div class="comparison-section">
                        <h2>Overview</h2>
                        <p>${comparison.overview}</p>
                        <p><strong>Educational Disclaimer:</strong> This comparison is for educational purposes only and based on publicly available information. Individual experiences may vary.</p>
                    </div>

                    <div class="comparison-section">
                        <h2>Key Features</h2>
                        <ul>
                            ${comparison.features.map(feature => `<li>${feature}</li>`).join('')}
                        </ul>
                    </div>

                    <div class="pros-cons">
                        <div class="pros">
                            <h2>Advantages</h2>
                            <ul>
                                ${comparison.pros.map(pro => `<li>${pro}</li>`).join('')}
                            </ul>
                        </div>
                        <div class="cons">
                            <h2>Considerations</h2>
                            <ul>
                                ${comparison.cons.map(con => `<li>${con}</li>`).join('')}
                            </ul>
                        </div>
                    </div>

                    <div class="comparison-section">
                        <h2>Best Suited For</h2>
                        <p>${comparison.bestFor}</p>
                    </div>

                    <div class="comparison-section">
                        <h2>May Not Be Ideal For</h2>
                        <p>${comparison.notIdealFor}</p>
                    </div>

                    <div class="comparison-section">
                        <h2>Pricing Information</h2>
                        <p>${comparison.pricingNote}</p>
                        <p><em>Note: Pricing information is based on publicly available data and may change. Please verify current pricing directly with service providers.</em></p>
                    </div>

                    <div class="comparison-section">
                        <h2>Learn More</h2>
                        <p>For the most current information, features, and pricing, visit the official websites:</p>
                        <div class="external-links">
                            ${comparison.externalLinks.map(link => 
                                `<a href="${link.url}" target="_blank" rel="noopener noreferrer">${link.name}</a>`
                            ).join('')}
                        </div>
                    </div>

                    <div class="comparison-section">
                        <h2>Research Methodology</h2>
                        <p>This comparison is based on publicly available information including official websites, documentation, and user feedback. We strive to provide accurate information, but recommend verifying details directly with service providers. <a href="/methodology/">Learn more about our methodology</a>.</p>
                    </div>
                </div>
            </div>
        `;
        
        detailContainer.style.display = 'block';
        if (notFoundContainer) notFoundContainer.style.display = 'none';
    } else {
        if (detailContainer) detailContainer.style.display = 'none';
        if (notFoundContainer) notFoundContainer.style.display = 'block';
    }
}

function setupContactForm() {
    const contactForm = document.getElementById('contact-form');
    const successMessage = document.getElementById('form-success');

    if (contactForm && successMessage) {
        contactForm.addEventListener('submit', function(e) {
            e.preventDefault();
            
            // Simulate form submission
            contactForm.style.display = 'none';
            successMessage.style.display = 'block';
            
            // Reset form after delay
            setTimeout(() => {
                contactForm.reset();
                contactForm.style.display = 'block';
                successMessage.style.display = 'none';
            }, 5000);
        });
    }
}

function setupCookieBanner() {
    const banner = document.getElementById('cookie-banner');
    const acceptBtn = document.getElementById('cookie-accept');
    
    if (banner && acceptBtn) {
        // Check if user already accepted cookies
        const cookiesAccepted = localStorage.getItem('cookies-accepted');
        
        if (!cookiesAccepted) {
            banner.style.display = 'block';
        }
        
        acceptBtn.addEventListener('click', function() {
            localStorage.setItem('cookies-accepted', 'true');
            banner.style.display = 'none';
        });
    }
}

// Initialize app based on current page
function initApp() {
    setupCookieBanner();
    
    // Home page
    if (document.getElementById('popular-comparisons-grid')) {
        renderPopularComparisons();
    }
    
    // Comparisons directory page
    if (document.getElementById('comparisons-grid')) {
        setupCategoryFilter();
        setupSearch();
        renderAllComparisons();
    }
    
    // Comparison detail page
    if (document.getElementById('comparison-detail')) {
        renderComparisonDetail();
    }
    
    // Contact page
    if (document.getElementById('contact-form')) {
        setupContactForm();
    }
}

// Initialize when DOM is ready
document.addEventListener('DOMContentLoaded', initApp);