import React from "react";
import { ScrollView, StyleSheet, Text, View, Platform } from "react-native";
import { Stack } from "expo-router";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import Colors from "@/constants/colors";
import { AppSiteFooter } from "@/components/AppSiteFooter";

export default function TermsAndConditionsScreen() {
  const insets = useSafeAreaInsets();

  return (
    <View style={[styles.container, { paddingTop: insets.top }]}>
      <Stack.Screen options={{ title: "Terms & Conditions", headerBackTitle: "Back" }} />

      <ScrollView
        style={styles.scrollView}
        contentContainerStyle={styles.scrollContent}
        showsVerticalScrollIndicator={Platform.OS === "web"}
        nestedScrollEnabled
      >
        <Text style={styles.title}>Terms & Conditions</Text>
        <Text style={styles.lastUpdated}>Last Updated: June 24, 2026</Text>

        <View style={styles.section}>
          <Text style={styles.sectionTitle}>1. Acceptance of Terms</Text>
          <Text style={styles.paragraph}>
            By using Zendo, you agree to these Terms & Conditions. If you do not agree, please do
            not use our services.
          </Text>
        </View>

        <View style={styles.section}>
          <Text style={styles.sectionTitle}>2. Account Responsibility</Text>
          <Text style={styles.paragraph}>
            You are responsible for maintaining the confidentiality of your account credentials and
            for all activity under your account.
          </Text>
        </View>

        <View style={styles.section}>
          <Text style={styles.sectionTitle}>3. Transactions and Usage</Text>
          <Text style={styles.paragraph}>
            Transaction availability, limits, and fees may vary by region, verification status,
            and payment rail. You must use the platform lawfully and avoid fraudulent activity.
          </Text>
        </View>

        <View style={styles.section}>
          <Text style={styles.sectionTitle}>4. Service Availability</Text>
          <Text style={styles.paragraph}>
            We aim to provide reliable service, but downtime or interruptions can occur for
            maintenance, upgrades, or external provider issues.
          </Text>
        </View>

        <View style={styles.section}>
          <Text style={styles.sectionTitle}>5. Changes and Termination</Text>
          <Text style={styles.paragraph}>
            We may update these terms periodically and may suspend or terminate accounts for policy
            violations, legal requirements, or security reasons.
          </Text>
        </View>

        <View style={styles.section}>
          <Text style={styles.sectionTitle}>6. Disputes & Support</Text>
          <Text style={styles.paragraph}>
            File support tickets in the app for disputes and account issues. Zendo will respond and
            work to resolve disputes within up to 7 business days.
          </Text>
        </View>

        <View style={styles.section}>
          <Text style={styles.sectionTitle}>7. Contact</Text>
          <Text style={styles.paragraph}>
            Questions about these terms can be sent to support@zendo.com.
          </Text>
        </View>
        <AppSiteFooter />
      </ScrollView>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: Colors.dark.background,
  },
  scrollView: {
    flex: 1,
  },
  scrollContent: {
    padding: 24,
    paddingBottom: 40,
  },
  title: {
    fontSize: 28,
    fontWeight: "700",
    color: Colors.dark.text,
    marginBottom: 8,
  },
  lastUpdated: {
    fontSize: 14,
    color: Colors.dark.textTertiary,
    marginBottom: 28,
  },
  section: {
    marginBottom: 24,
  },
  sectionTitle: {
    fontSize: 18,
    fontWeight: "700",
    color: Colors.dark.text,
    marginBottom: 10,
  },
  paragraph: {
    fontSize: 16,
    color: Colors.dark.textSecondary,
    lineHeight: 24,
  },
});
