import { View, Text, StyleSheet, ScrollView, Pressable, Platform } from 'react-native'
import { StatusBar } from 'expo-status-bar'
import { SafeAreaView } from 'react-native-safe-area-context'
import { useRouter } from 'expo-router'
import { StatusBar as RNStatusBar } from 'react-native'
import { useTranslation } from 'react-i18next'
import { LeftArrowIcon } from '@/components/icon'

export default function PrivacyScreen() {
    const router = useRouter()    
    const { t } = useTranslation()    
    return (
        <SafeAreaView style={styles.container} edges={['top']}>
            <StatusBar style="light" />
            <RNStatusBar 
                barStyle="light-content" 
                backgroundColor="#090A0B"
                translucent={Platform.OS === 'android'}
            />
            <View style={styles.header}>
                <Pressable
                    style={styles.backButton}
                    onPress={() => {
                        router.back()
                    }}
                    hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
                >
                    <LeftArrowIcon className="w-4 h-4" />
                </Pressable>
                <Text style={styles.headerTitle}>{t('privacy.title')}</Text>
                <View style={styles.headerSpacer} />
            </View>
            <ScrollView
                style={styles.scrollView}
                contentContainerStyle={styles.scrollContent}
                showsVerticalScrollIndicator={false}
            >
                <Text style={styles.title}>隐私协议 / Privacy Policy</Text>
                
                <Text style={styles.sectionTitle}>1. 引言 / Introduction</Text>
                <Text style={styles.paragraph}>
                    BOWONG AI (HK) LIMITED（以下简称"我们"）非常重视您的隐私。本隐私政策说明了我们在您使用服务时如何处理您的信息。
                </Text>
                <Text style={styles.paragraph}>
                    BOWONG AI (HK) LIMITED (hereinafter referred to as "we") values your privacy highly. This Privacy Policy explains how we handle your information when you use our services.
                </Text>

                <Text style={styles.sectionTitle}>2. 信息收集最小化声明 / Data Minimization Statement</Text>
                
                <Text style={styles.subsectionTitle}>2.1 我们收集的信息 / Information We Collect</Text>
                <Text style={styles.paragraph}>
                    我们遵循数据最小化原则。为了提供服务及进行登录认证，我们仅收集和存储您注册时提供的电子邮箱地址（Email）。
                </Text>
                <Text style={styles.paragraph}>
                    We adhere to the principle of data minimization. To provide our services and facilitate login authentication, we only collect and store the email address provided by you during registration.
                </Text>

                <Text style={styles.subsectionTitle}>2.2 我们不收集的信息 / Information We Do NOT Collect</Text>
                <Text style={styles.paragraph}>
                    我们不存储您的姓名、电话号码、物理地址或任何其他个人身份信息。
                </Text>
                <Text style={styles.paragraph}>
                    We do not store your name, phone number, physical address, or any other personally identifiable information.
                </Text>

                <Text style={styles.sectionTitle}>3. 支付信息安全 / Payment Information Security</Text>
                
                <Text style={styles.subsectionTitle}>3.1 支付数据处理 / Payment Data Processing</Text>
                <Text style={styles.paragraph}>
                    所有的支付交易均由第三方支付处理商 Stripe 安全处理。我们不会在其服务器上存储或处理您的信用卡号、银行账户详情或任何敏感的支付信息。
                </Text>
                <Text style={styles.paragraph}>
                    All payment transactions are securely processed by our third-party payment processor, Stripe. We do not store or process your credit card numbers, bank account details, or any sensitive payment information on our servers.
                </Text>

                <Text style={styles.subsectionTitle}>3.2 Stripe 隐私政策 / Stripe Privacy Policy</Text>
                <Text style={styles.paragraph}>
                    您提供的支付信息受 Stripe 隐私政策的约束。我们建议您阅读 Stripe 的隐私政策以了解其数据处理惯例。
                </Text>
                <Text style={styles.paragraph}>
                    The payment information you provide is subject to Stripe's Privacy Policy. We recommend that you review Stripe's Privacy Policy to understand their data processing practices.
                </Text>

                <Text style={styles.sectionTitle}>4. 信息的使用 / Use of Information</Text>
                <Text style={styles.paragraph}>
                    您提供的电子邮件地址仅用于以下用途：
                </Text>
                <Text style={styles.paragraph}>
                    Your email address is used solely for the following purposes:
                </Text>
                <Text style={styles.listItem}>1. 作为您登录系统的唯一凭证 / As your unique credential for logging into the system</Text>
                <Text style={styles.listItem}>2. 接收关于订阅状态、发票和系统更新的通知 / Receiving notifications regarding subscription status, invoices, and system updates</Text>
                <Text style={styles.listItem}>3. 处理客户支持和退款请求 / Processing customer support and refund requests</Text>

                <Text style={styles.sectionTitle}>5. 数据共享与披露 / Data Sharing and Disclosure</Text>
                <Text style={styles.paragraph}>
                    除法律要求或为了执行我们的服务条款（例如通过 Stripe 处理付款）外，我们不会向任何第三方出售、出租或共享您的电子邮件地址。
                </Text>
                <Text style={styles.paragraph}>
                    We will not sell, rent, or share your email address with any third parties, except as required by law or to enforce our terms of service (e.g., processing payments via Stripe).
                </Text>

                <Text style={styles.sectionTitle}>6. 联系我们 / Contact Us</Text>
                <Text style={styles.paragraph}>
                    如果您对本隐私政策有任何疑问，请通过以下方式联系我们：
                </Text>
                <Text style={styles.paragraph}>
                    If you have any questions regarding this Privacy Policy, please contact us at:
                </Text>
                <Text style={styles.listItem}>• 公司名称 / Company Name: BOWONG AI (HK) LIMITED</Text>
                <Text style={styles.listItem}>• 客服邮箱 / Support Email: support@bowong.ai</Text>
            </ScrollView>
        </SafeAreaView>
    )
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#090A0B',
    },
    header: {
        flexDirection: 'row',
        alignItems: 'center',
        paddingHorizontal: 12,
        paddingTop: 7,
        paddingBottom: 7,
        backgroundColor: '#090A0B',
    },
    backButton: {
        width: 32,
        height: 32,
        alignItems: 'center',
        justifyContent: 'center',
        borderRadius: 100,
        zIndex: 10,
    },
    headerTitle: {
        flex: 1,
        color: '#F5F5F5',
        fontSize: 18,
        fontWeight: '600',
        textAlign: 'center',
        marginLeft: -32,
    },
    headerSpacer: {
        width: 32,
    },
    scrollView: {
        flex: 1,
    },
    scrollContent: {
        paddingHorizontal: 16,
        paddingTop: 16,
        paddingBottom: 32,
    },
    title: {
        color: '#F5F5F5',
        fontSize: 24,
        fontWeight: '900',
        marginBottom: 24,
        textAlign: 'center',
    },
    sectionTitle: {
        color: '#F5F5F5',
        fontSize: 18,
        fontWeight: '700',
        marginTop: 24,
        marginBottom: 12,
    },
    subsectionTitle: {
        color: '#F5F5F5',
        fontSize: 16,
        fontWeight: '600',
        marginTop: 16,
        marginBottom: 8,
    },
    paragraph: {
        color: '#CCCCCC',
        fontSize: 14,
        lineHeight: 22,
        marginBottom: 12,
    },
    listItem: {
        color: '#CCCCCC',
        fontSize: 14,
        lineHeight: 22,
        marginBottom: 8,
        marginLeft: 8,
    },
    footer: {
        color: '#CCCCCC',
        fontSize: 14,
        lineHeight: 22,
        marginTop: 24,
        textAlign: 'center',
        fontStyle: 'italic',
    },
})

