{% extends "base.html" %}

{% block title %}Privacy Policy - SmartTools{% endblock %}

{% block meta_description %}SmartTools privacy policy. Learn how we collect, use, and protect your data.{% endblock %}

{% block content %}
<div class="bg-white py-16">
    <div class="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8">
        <h1 class="text-3xl font-bold text-gray-900 mb-2">Privacy Policy</h1>
        <p class="text-gray-500 mb-8">Last updated: January 2025</p>

        <div class="prose prose-lg prose-indigo max-w-none">
            <h2>Introduction</h2>
            <p>
                SmartTools ("we", "our", or "us") respects your privacy and is committed to protecting
                your personal data. This privacy policy explains how we collect, use, and safeguard
                your information when you use our website and services.
            </p>

            <h2>Information We Collect</h2>

            <h3>Account Information</h3>
            <p>When you create an account, we collect:</p>
            <ul>
                <li>Email address</li>
                <li>Username (slug)</li>
                <li>Display name</li>
                <li>Password (stored securely hashed)</li>
                <li>Optional: bio and website URL</li>
            </ul>

            <h3>Usage Data</h3>
            <p>We automatically collect certain information when you use our services:</p>
            <ul>
                <li>Tool download counts (anonymized)</li>
                <li>Page views and navigation patterns (if analytics consent given)</li>
                <li>Browser type and version</li>
                <li>IP address (for security and rate limiting)</li>
            </ul>

            <h3>Cookies</h3>
            <p>We use cookies for:</p>
            <ul>
                <li><strong>Essential cookies:</strong> Required for the website to function (session management, CSRF protection)</li>
                <li><strong>Analytics cookies:</strong> Help us understand how visitors use our site (optional, requires consent)</li>
                <li><strong>Advertising cookies:</strong> Used to show relevant ads (optional, requires consent)</li>
            </ul>
            <p>
                You can manage your cookie preferences at any time through our cookie consent banner
                or by contacting us.
            </p>

            <h2>How We Use Your Information</h2>
            <p>We use your information to:</p>
            <ul>
                <li>Provide and maintain our services</li>
                <li>Authenticate your identity and secure your account</li>
                <li>Display your public profile and published tools</li>
                <li>Send important service notifications</li>
                <li>Improve our services based on usage patterns</li>
                <li>Prevent abuse and enforce our terms of service</li>
            </ul>

            <h2>Information Sharing</h2>
            <p>We do not sell your personal information. We may share data with:</p>
            <ul>
                <li><strong>Service providers:</strong> Hosting, analytics, and email services that help us operate</li>
                <li><strong>Legal requirements:</strong> When required by law or to protect our rights</li>
                <li><strong>Public information:</strong> Your username, display name, bio, and published tools are publicly visible</li>
            </ul>

            <h2>Data Security</h2>
            <p>
                We implement appropriate security measures to protect your personal information,
                including:
            </p>
            <ul>
                <li>Encryption of data in transit (HTTPS)</li>
                <li>Secure password hashing (bcrypt)</li>
                <li>Regular security audits</li>
                <li>Limited access to personal data</li>
            </ul>

            <h2>Your Rights</h2>
            <p>You have the right to:</p>
            <ul>
                <li><strong>Access:</strong> Request a copy of your personal data</li>
                <li><strong>Correction:</strong> Update inaccurate information in your account settings</li>
                <li><strong>Deletion:</strong> Delete your account and associated data</li>
                <li><strong>Portability:</strong> Export your data in a machine-readable format</li>
                <li><strong>Withdraw consent:</strong> Opt out of analytics and advertising cookies</li>
            </ul>

            <h2>Data Retention</h2>
            <p>
                We retain your account data for as long as your account is active. If you delete
                your account, we will remove your personal data within 30 days, except where we
                are required to retain it for legal purposes.
            </p>
            <p>
                Published tools may remain in the registry after account deletion for continuity,
                but will be disassociated from your personal information.
            </p>

            <h2>Children's Privacy</h2>
            <p>
                Our services are not intended for children under 13. We do not knowingly collect
                personal information from children under 13.
            </p>

            <h2>Changes to This Policy</h2>
            <p>
                We may update this privacy policy from time to time. We will notify you of any
                significant changes by posting a notice on our website or sending you an email.
            </p>

            <h2>Contact Us</h2>
            <p>
                If you have questions about this privacy policy or your personal data, please
                contact us at:
            </p>
            <ul>
                <li>Email: privacy@smarttools.dev</li>
                <li>GitHub: <a href="https://github.com/your-org/smarttools/issues">Open an issue</a></li>
            </ul>
        </div>
    </div>
</div>
{% endblock %}
