<?php
/**
 * Privacy Policy Page
 * Required for Google Play Store compliance
 */
define('APP_RUNNING', true);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Privacy Policy - Land Scanner</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
        }

        body {
            background: #f8fafc;
            color: #334155;
            line-height: 1.7;
        }

        .header {
            background: linear-gradient(135deg, #1e3a5f 0%, #0d1b2a 100%);
            padding: 40px 20px;
            color: white;
            text-align: center;
        }

        .header h1 {
            font-size: 2rem;
            margin-bottom: 10px;
        }

        .header p {
            color: rgba(255,255,255,0.7);
            font-size: 14px;
        }

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

        .policy-card {
            background: white;
            border-radius: 16px;
            padding: 40px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.08);
            margin-bottom: 30px;
        }

        .last-updated {
            background: #e0f2fe;
            color: #0369a1;
            padding: 12px 20px;
            border-radius: 10px;
            font-size: 14px;
            margin-bottom: 30px;
            display: inline-block;
        }

        h2 {
            color: #1e3a5f;
            font-size: 1.4rem;
            margin: 30px 0 15px 0;
            padding-bottom: 10px;
            border-bottom: 2px solid #e2e8f0;
        }

        h2:first-of-type {
            margin-top: 0;
        }

        h3 {
            color: #334155;
            font-size: 1.1rem;
            margin: 20px 0 10px 0;
        }

        p {
            margin-bottom: 15px;
        }

        ul {
            margin: 15px 0 15px 25px;
        }

        li {
            margin-bottom: 10px;
        }

        .highlight-box {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.1) 100%);
            border-left: 4px solid #22c55e;
            padding: 20px;
            border-radius: 0 10px 10px 0;
            margin: 20px 0;
        }

        .warning-box {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(234, 179, 8, 0.1) 100%);
            border-left: 4px solid #f59e0b;
            padding: 20px;
            border-radius: 0 10px 10px 0;
            margin: 20px 0;
        }

        .contact-section {
            background: linear-gradient(135deg, #1e3a5f 0%, #0d1b2a 100%);
            color: white;
            padding: 30px;
            border-radius: 16px;
            text-align: center;
            margin-top: 30px;
        }

        .contact-section h3 {
            color: white;
            margin-bottom: 15px;
        }

        .contact-section a {
            color: #22c55e;
            text-decoration: none;
        }

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

        .back-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: #1e3a5f;
            text-decoration: none;
            font-weight: 500;
            margin-bottom: 20px;
        }

        .back-link:hover {
            color: #22c55e;
        }

        .data-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }

        .data-table th, .data-table td {
            padding: 12px 15px;
            text-align: left;
            border-bottom: 1px solid #e2e8f0;
        }

        .data-table th {
            background: #f1f5f9;
            font-weight: 600;
            color: #1e3a5f;
        }

        .data-table tr:hover {
            background: #f8fafc;
        }

        @media (max-width: 600px) {
            .policy-card {
                padding: 25px 20px;
            }

            h2 {
                font-size: 1.2rem;
            }

            .data-table {
                font-size: 14px;
            }

            .data-table th, .data-table td {
                padding: 10px 8px;
            }
        }
    </style>
</head>
<body>
    <div class="header">
        <h1><i class="fas fa-shield-alt"></i> Privacy Policy</h1>
        <p>Land Scanner Mobile Application</p>
    </div>

    <div class="container">
        <a href="/" class="back-link">
            <i class="fas fa-arrow-left"></i> Back to Home
        </a>

        <div class="policy-card">
            <span class="last-updated">
                <i class="fas fa-calendar-alt"></i> Last Updated: <?php echo date('F d, Y'); ?>
            </span>

            <h2>1. Introduction</h2>
            <p>Welcome to <strong>Land Scanner</strong> ("we," "our," or "us"). We are committed to protecting your privacy and ensuring the security of your personal information. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our mobile application.</p>

            <div class="highlight-box">
                <strong><i class="fas fa-info-circle"></i> Summary:</strong> We only collect data necessary to provide our land verification services. Your data is secure and never sold to third parties.
            </div>

            <h2>2. Information We Collect</h2>

            <h3>2.1 Location Data (GPS)</h3>
            <p>Our app requires access to your device's GPS location to:</p>
            <ul>
                <li>Verify land boundaries and ownership</li>
                <li>Display your current position on the map</li>
                <li>Check if you are within registered land boundaries</li>
                <li>Provide accurate land scanning services</li>
            </ul>

            <div class="warning-box">
                <strong><i class="fas fa-map-marker-alt"></i> Important:</strong> Location data is only collected when you actively use the scanning feature. We do not track your location in the background.
            </div>

            <h3>2.2 Account Information</h3>
            <p>When you create an account, we collect:</p>
            <ul>
                <li>Full name</li>
                <li>Email address</li>
                <li>Phone number</li>
                <li>Password (encrypted)</li>
            </ul>

            <h3>2.3 Land Registration Data</h3>
            <p>When you register land, we collect:</p>
            <ul>
                <li>Land coordinates (GPS points)</li>
                <li>Land name and description</li>
                <li>Village, district, and region information</li>
                <li>Uploaded documents (title deeds, certificates)</li>
            </ul>

            <h3>2.4 Device Information</h3>
            <p>We automatically collect certain device information:</p>
            <ul>
                <li>Device type and model</li>
                <li>Operating system version</li>
                <li>IP address</li>
                <li>Browser type (for web access)</li>
            </ul>

            <table class="data-table">
                <tr>
                    <th>Data Type</th>
                    <th>Purpose</th>
                    <th>Retention</th>
                </tr>
                <tr>
                    <td>GPS Location</td>
                    <td>Land verification</td>
                    <td>Session only</td>
                </tr>
                <tr>
                    <td>Account Info</td>
                    <td>User authentication</td>
                    <td>Until account deletion</td>
                </tr>
                <tr>
                    <td>Land Data</td>
                    <td>Land registration</td>
                    <td>Permanent (legal records)</td>
                </tr>
                <tr>
                    <td>Device Info</td>
                    <td>Security & analytics</td>
                    <td>12 months</td>
                </tr>
            </table>

            <h2>3. How We Use Your Information</h2>
            <p>We use the collected information to:</p>
            <ul>
                <li>Provide land verification and scanning services</li>
                <li>Create and manage your user account</li>
                <li>Process land registrations and generate certificates</li>
                <li>Send important notifications about your lands</li>
                <li>Improve our services and user experience</li>
                <li>Comply with legal obligations</li>
                <li>Prevent fraud and ensure security</li>
            </ul>

            <h2>4. Data Security</h2>
            <p>We implement industry-standard security measures to protect your data:</p>
            <ul>
                <li><strong>SSL/TLS Encryption:</strong> All data transmitted is encrypted</li>
                <li><strong>Secure Servers:</strong> Data stored on protected servers</li>
                <li><strong>Password Hashing:</strong> Passwords are never stored in plain text</li>
                <li><strong>Access Controls:</strong> Limited employee access to personal data</li>
                <li><strong>Regular Audits:</strong> Security assessments and updates</li>
            </ul>

            <h2>5. Data Sharing</h2>
            <p>We <strong>DO NOT</strong> sell your personal information. We may share data only in these cases:</p>
            <ul>
                <li><strong>With Your Consent:</strong> When you explicitly authorize sharing</li>
                <li><strong>Land Sharing:</strong> When you share land information with others</li>
                <li><strong>Legal Requirements:</strong> When required by law or court order</li>
                <li><strong>Service Providers:</strong> Trusted partners who help operate our services (bound by confidentiality)</li>
            </ul>

            <h2>6. 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 or correct your information</li>
                <li><strong>Deletion:</strong> Request deletion of your account and data</li>
                <li><strong>Portability:</strong> Receive your data in a portable format</li>
                <li><strong>Withdraw Consent:</strong> Revoke permissions at any time</li>
            </ul>

            <h2>7. Children's Privacy</h2>
            <p>Our services are not intended for children under 18 years of age. We do not knowingly collect personal information from children. If you believe we have collected data from a child, please contact us immediately.</p>

            <h2>8. Third-Party Services</h2>
            <p>Our app uses the following third-party services:</p>
            <ul>
                <li><strong>Google Maps:</strong> For map display and location services</li>
                <li><strong>Leaflet Maps:</strong> For interactive map features</li>
            </ul>
            <p>These services have their own privacy policies which we encourage you to review.</p>

            <h2>9. 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:</p>
            <ul>
                <li>Posting the new policy on this page</li>
                <li>Updating the "Last Updated" date</li>
                <li>Sending an email notification (for major changes)</li>
            </ul>

            <h2>10. Contact Us</h2>
            <p>If you have any questions about this Privacy Policy or our data practices, please contact us:</p>

            <div class="contact-section">
                <h3><i class="fas fa-envelope"></i> Get in Touch</h3>
                <p>
                    <strong>Email:</strong> <a href="mailto:privacy@landsecure.co.tz">privacy@landsecure.co.tz</a><br>
                    <strong>Phone:</strong> <a href="tel:+255781115402">+255 781 115 402</a><br>
                    <strong>Website:</strong> <a href="https://landsecure.co.tz">https://landsecure.co.tz</a>
                </p>
                <p style="margin-top: 15px; font-size: 14px; color: rgba(255,255,255,0.7);">
                    Land Scanner - Protecting Your Land Rights
                </p>
            </div>
        </div>
    </div>
</body>
</html>
