from fastapi import APIRouter

router = APIRouter(tags=["legal"])


@router.get("/privacy-policy")
def get_privacy_policy():
    return {
        "title": "Privacy Policy",
        "lastUpdated": "2025-03-26",
        "sections": [
            {
                "heading": "Introduction",
                "body": "Maya AI (\"we\", \"our\", or \"us\") operates the Maya mobile application. This Privacy Policy explains how we collect, use, and protect your personal information when you use our app.",
            },
            {
                "heading": "Information We Collect",
                "body": "We collect the following types of information:\n\n- **Account Information**: When you sign in with Google, we receive your name, email address, and profile photo.\n- **Usage Data**: We collect information about how you use the app, including your interactions with AI personas, generated images, and videos.\n- **Voice Data**: When you use voice features, your speech is processed in real-time for AI conversation. We do not store raw audio recordings.\n- **Device Information**: We collect device identifiers and technical information to provide and improve our services.",
            },
            {
                "heading": "How We Use Your Information",
                "body": "We use your information to:\n\n- Provide and maintain the Maya AI service\n- Process your AI conversations and generate content\n- Manage your account and subscription\n- Track usage limits and credits\n- Improve our AI models and user experience\n- Send important service updates",
            },
            {
                "heading": "Data Storage & Security",
                "body": "Your data is stored securely on cloud servers. We use encryption in transit and at rest to protect your information. Generated images and videos are stored temporarily and may be deleted after a period of inactivity.",
            },
            {
                "heading": "Third-Party Services",
                "body": "We use the following third-party services:\n\n- **Google Sign-In**: For authentication\n- **Google Play Billing**: For subscription and purchase processing\n- **Daily.co**: For real-time voice communication\n- **Deepgram**: For speech-to-text and text-to-speech processing\n- **Google Vertex AI**: For AI conversation processing\n\nEach of these services has their own privacy policies governing the use of your information.",
            },
            {
                "heading": "Your Rights",
                "body": "You have the right to:\n\n- Access your personal data\n- Request deletion of your account and data\n- Opt out of non-essential data collection\n- Export your data\n\nTo exercise these rights, contact us at support@mayaresearch.ai.",
            },
            {
                "heading": "Children's Privacy",
                "body": "Maya AI is not intended for children under 13 years of age. We do not knowingly collect personal information from children under 13.",
            },
            {
                "heading": "Changes to This Policy",
                "body": "We may update this Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy in the app and updating the \"Last Updated\" date.",
            },
            {
                "heading": "Contact Us",
                "body": "If you have any questions about this Privacy Policy, please contact us at:\n\nEmail: support@mayaresearch.ai",
            },
        ],
    }


@router.get("/terms-of-service")
def get_terms_of_service():
    return {
        "title": "Terms of Service",
        "lastUpdated": "2025-03-26",
        "sections": [
            {
                "heading": "Acceptance of Terms",
                "body": "By downloading, installing, or using Maya AI (\"the App\"), you agree to be bound by these Terms of Service. If you do not agree to these terms, do not use the App.",
            },
            {
                "heading": "Description of Service",
                "body": "Maya AI is an AI-powered creative assistant that provides:\n\n- Real-time voice conversations with AI personas\n- AI image generation and editing\n- AI video generation\n- AI presentation creation\n\nFeatures may vary based on your subscription plan.",
            },
            {
                "heading": "Account & Authentication",
                "body": "You must sign in with a valid Google account to use Maya AI. You are responsible for maintaining the security of your account. You must not share your account credentials or allow others to access your account.",
            },
            {
                "heading": "Subscription & Payments",
                "body": "Maya AI offers free and premium subscription plans:\n\n- **Free Plan**: Limited usage credits for image and video generation.\n- **Maya Pro**: Monthly subscription with increased limits and priority processing.\n- **Top-up Packs**: One-time purchases to add extra credits.\n\nAll purchases are processed through Google Play Billing. Subscriptions auto-renew unless cancelled at least 24 hours before the end of the current billing period. You can manage or cancel your subscription through the Google Play Store.",
            },
            {
                "heading": "Usage Limits",
                "body": "Each plan has specific usage limits for image generations, video creations, and other features. When limits are reached, you will need to upgrade your plan or purchase a top-up pack to continue using those features.",
            },
            {
                "heading": "Content & Intellectual Property",
                "body": "- Content you generate using Maya AI belongs to you, subject to the limitations below.\n- You may not use generated content for illegal, harmful, or deceptive purposes.\n- We reserve the right to remove content that violates our guidelines.\n- You grant us a limited license to process your inputs (voice, text, images) for the purpose of providing the service.",
            },
            {
                "heading": "Prohibited Uses",
                "body": "You agree not to:\n\n- Use the App to generate illegal, harmful, or explicit content\n- Attempt to reverse-engineer or extract AI models\n- Use automated systems to abuse the service\n- Circumvent usage limits or security measures\n- Impersonate others or misrepresent AI-generated content as human-created\n- Use the service to spam, harass, or harm others",
            },
            {
                "heading": "Disclaimer of Warranties",
                "body": "Maya AI is provided \"as is\" without warranties of any kind. We do not guarantee that:\n\n- The service will be uninterrupted or error-free\n- AI-generated content will be accurate or suitable for any purpose\n- Generated content will not infringe third-party rights\n\nUse AI-generated content at your own risk.",
            },
            {
                "heading": "Limitation of Liability",
                "body": "To the maximum extent permitted by law, Maya AI and its operators shall not be liable for any indirect, incidental, special, or consequential damages arising from your use of the App, including but not limited to loss of data, revenue, or profits.",
            },
            {
                "heading": "Termination",
                "body": "We reserve the right to suspend or terminate your account if you violate these Terms of Service. Upon termination, your right to use the App ceases immediately. Any unused credits or subscription time will not be refunded upon termination for cause.",
            },
            {
                "heading": "Changes to Terms",
                "body": "We may modify these Terms of Service at any time. Continued use of the App after changes constitutes acceptance of the new terms. We will notify users of significant changes through the App.",
            },
            {
                "heading": "Contact",
                "body": "For questions about these Terms of Service, contact us at:\n\nEmail: support@mayaresearch.ai",
            },
        ],
    }
