import 'package:flutter/material.dart';

class _Brand {
  static const bg = Color(0xFF0F1114);
  static const surface = Color(0xFF1A1D22);
  static const textPrimary = Color(0xFFF2F2F2);
  static const textMuted = Color(0xFF8A8F99);
  static const amber = Color(0xFFFF9500);
}

class PrivacyScreen extends StatelessWidget {
  const PrivacyScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: _Brand.bg,
      appBar: AppBar(
        backgroundColor: _Brand.surface,
        foregroundColor: _Brand.textPrimary,
        title: const Text('Privacy Policy'),
        elevation: 0,
      ),
      body: SingleChildScrollView(
        padding: const EdgeInsets.all(20),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              'Last updated: February 2025',
              style: TextStyle(color: _Brand.textMuted, fontSize: 12),
            ),
            const SizedBox(height: 24),
            Text(
              'JAMBO respects your privacy. This policy describes how we collect, use, and protect your information when you use our app and services.',
              style: TextStyle(color: _Brand.textPrimary, height: 1.5, fontSize: 14),
            ),
            const SizedBox(height: 20),
            _SectionTitle('Information we collect'),
            Text(
              'We collect your phone number for account creation and login, delivery addresses for orders, and order history to provide and improve our gas, fuel, and rescue services.',
              style: TextStyle(color: _Brand.textPrimary, height: 1.5, fontSize: 14),
            ),
            const SizedBox(height: 20),
            _SectionTitle('How we use it'),
            Text(
              'Your data is used to process orders, communicate with you about deliveries, and improve our service. We do not sell your personal information to third parties.',
              style: TextStyle(color: _Brand.textPrimary, height: 1.5, fontSize: 14),
            ),
            const SizedBox(height: 20),
            _SectionTitle('Security'),
            Text(
              'Your PIN is stored in encrypted form. We use secure connections and follow best practices to protect your data.',
              style: TextStyle(color: _Brand.textPrimary, height: 1.5, fontSize: 14),
            ),
            const SizedBox(height: 20),
            _SectionTitle('Contact'),
            Text(
              'For privacy-related questions, contact us through the app or at the support details provided in Settings.',
              style: TextStyle(color: _Brand.textPrimary, height: 1.5, fontSize: 14),
            ),
            const SizedBox(height: 32),
          ],
        ),
      ),
    );
  }
}

class _SectionTitle extends StatelessWidget {
  final String text;
  const _SectionTitle(this.text);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(bottom: 8),
      child: Text(
        text,
        style: const TextStyle(
          color: _Brand.amber,
          fontSize: 14,
          fontWeight: FontWeight.w700,
          letterSpacing: 0.5,
        ),
      ),
    );
  }
}
