/**
 * PrivacyPolicyPage — Privacy Policy & Terms of Service.
 * Route: /privacy
 * Content migrated from reference/privacy_policy/code.html.
 * Editorial legal layout with numbered sections and callout cards.
 */
var PrivacyPolicyPage = function () {

    var SECTIONS = [
        {
            num: '01',
            title: 'Scope',
            body: `
            The team at Mould Detect value the trust you place in us when sharing your data. We are committed to securing your information and ensuring you have full transparency and oversight of how it’s used. 
            The following outlines the legal scope of our digital ecosystem, specifically concerning our AI-driven environmental analysis tools. By utilising this application, you acknowledge the sophisticated nature of our identification algorithms designed to analyse and improve Human Health outcomes through environmental monitoring.`,
        },
        {
            num: '02',
            title: 'Data Privacy & CNN Processing',
            body: 'Our AI Vision technology leverages Convolutional Neural Networks (CNN / RNN / Transformers) to analyze visual data. When you upload photos of your property, these assets are processed to identify microbial patterns.',
            callout: {
                label: 'Meta Data',
                text: 'All metadata-tagged for longitudinal spatial tracking within your local private library is anonymised for your safety and security.',
            },
        },
        {
            num: '03',
            title: 'User Recommendations for Optimal AI Performance',
            body: 'To ensure the reliability of AI Anaylsis, Predictive Modelling and Reports, users are recommended to provide accurate property details including:',
            bullets: [
                'Location and room type (e.g., bathroom, basement, bedroom)',
                'Surface type (e.g., painted wall, ceiling, wood)',
                "Smell observations (e.g., musty, earthy)",
                'Lighting conditions at time of capture (e.g. natural light, dimly lit)',
            ],
        },
        {
            num: '04',
            title: 'Natural Remediation Liability',
            bodyHtml: function () {
                return (
                    <p className="text-sm font-medium text-forest leading-relaxed">
                        {'Advice provided by the Mycology AI regarding natural remediation (e.g., vinegar or tree oil solutions, ventilation techniques) is strictly for '}
                        <span className="italic">educational purposes</span>
                        {'. We do not guarantee the efficacy of these methods for structural decontamination.'}
                    </p>
                );
            },
        },
        {
            num: '05',
            title: 'Limitation of Liability',
            body: 'Mould Detect, its parent entities and subsidiaries shall not be held liable for property damage, health deterioration, or financial loss resulting from the use or misuse of the data provided by the Mould Detect platform. Users operate this tool at their own discretion and risk.',
        },
    ];

    // --- Render: Numbered section ---
    var renderSection = function (section) {
        return (
            <section key={section.num} className="mb-8">
                <div className="flex items-start gap-3 mb-3">
                    <span className="text-[10px] font-black text-sage py-1 px-2.5 bg-background-light rounded-full shrink-0">{section.num}</span>
                    <h3 className="text-lg font-extrabold text-forest tracking-tight">{section.title}</h3>
                </div>
                <div className="pl-10">
                    {section.bodyHtml ? section.bodyHtml() : (
                        <p className="text-sm font-medium text-forest leading-relaxed">{section.body}</p>
                    )}

                    {section.callout && (
                        <div className="mt-4 bg-background-light p-4 rounded-xl border-l-4 border-primary/20">
                            <p className="text-sm font-medium text-forest leading-relaxed">
                                <span className="font-extrabold text-forest">{section.callout.label}:</span>
                                {' ' + section.callout.text}
                            </p>
                        </div>
                    )}

                    {section.bullets && (
                        <ul className="space-y-2.5 mt-4">
                            {section.bullets.map(function (item) {
                                return (
                                    <li key={item} className="flex items-center gap-3 text-sm font-semibold text-forest">
                                        <span className="w-1.5 h-1.5 rounded-full bg-white shrink-0"></span>
                                        {item}
                                    </li>
                                );
                            })}
                        </ul>
                    )}
                </div>
            </section>
        );
    };

    return (
        <Layout>
            <main className="flex-1 overflow-y-auto overflow-x-hidden pb-36">
                <PageHeader title="Privacy & Terms" showMenu={true} />
                <div className="px-6 pt-2">

                    {/* Section 01: Scope */}
                    {renderSection(SECTIONS[0])}

                    {/* Editorial image */}
                    <div className="ml-10 mb-8 rounded-xl overflow-hidden shadow-soft">
                        <img
                            className="w-full h-48 object-cover grayscale-[20%] hover:grayscale-0 transition-all duration-700"
                            src="mould-spores.jpg"
                            alt="Moss and lichen textures"
                        />
                    </div>

                    {/* Section 02: Data Privacy */}
                    {renderSection(SECTIONS[1])}

                    {/* Sections 03-05 */}
                    {SECTIONS.slice(2).map(function (s) { return renderSection(s); })}

                    {/* Health Disclaimer — special card */}
                    <section className="mb-2">
                        <div className="p-6 rounded-xl bg-warning-light border border-warning/10 relative overflow-hidden">
                            <div className="absolute top-0 right-0 p-3 opacity-10">
                                <span className="material-symbols-outlined text-[56px]">health_and_safety</span>
                            </div>
                            <div className="relative z-10">
                                <div className="flex items-start gap-3 mb-3">
                                    <span className="text-[10px] font-black text-warning py-1 px-2.5 bg-warning/10 rounded-full shrink-0">NOTE</span>
                                    <h3 className="text-lg font-extrabold text-forest tracking-tight">Health Disclaimer</h3>
                                </div>
                                <p className="text-sm font-bold text-forest mb-3">Mould Detect provides AI-based identification for decision support and educational purposes only.</p>
                                <p className="text-xs font-medium text-forest leading-relaxed">This application is NOT a substitute for professional health advice, medical diagnosis, or certified building inspection services. AI predictions may have margins of error based on image quality, lighting, resolution, and surface complexity. Always consult a certified health care professional, toxicologist or environmental specialist for health concerns.</p>
                            </div>
                        </div>
                    </section>

                </div>
            </main>
        </Layout>
    );
};

window.PrivacyPolicyPage = PrivacyPolicyPage;
