import 'package:flutter/material.dart';
import 'package:sigap/src/features/personalization/presentasion/pages/settings/widgets/base_detail_screen.dart';

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

  @override
  Widget build(BuildContext context) {
    return BaseDetailScreen(
      title: 'Contact',
      content: ListView(
        padding: const EdgeInsets.all(20),
        children: [
          _buildContactItem(
            context,
            icon: Icons.email_outlined,
            title: 'Email',
            value: 'support@sigap.com',
          ),
          _buildContactItem(
            context,
            icon: Icons.phone_outlined,
            title: 'Phone',
            value: '+62 21 1234 5678',
          ),
          _buildContactItem(
            context,
            icon: Icons.location_on_outlined,
            title: 'Address',
            value: 'Jl. Sudirman No. 123, Jakarta 12190, Indonesia',
          ),
          const SizedBox(height: 40),
          _buildSupportSection(context),
        ],
      ),
    );
  }

  Widget _buildContactItem(
    BuildContext context, {
    required IconData icon,
    required String title,
    required String value,
  }) {
    final theme = Theme.of(context);

    return Container(
      margin: const EdgeInsets.only(bottom: 20),
      padding: const EdgeInsets.all(15),
      decoration: BoxDecoration(
        border: Border.all(color: theme.dividerColor),
        borderRadius: BorderRadius.circular(8),
      ),
      child: Row(
        children: [
          Container(
            padding: const EdgeInsets.all(10),
            decoration: BoxDecoration(
              color: theme.primaryColor.withOpacity(0.1),
              borderRadius: BorderRadius.circular(8),
            ),
            child: Icon(icon, size: 24, color: theme.primaryColor),
          ),
          const SizedBox(width: 15),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  title,
                  style: theme.textTheme.bodySmall?.copyWith(
                    color: theme.hintColor,
                  ),
                ),
                const SizedBox(height: 4),
                Text(value, style: theme.textTheme.bodyLarge),
              ],
            ),
          ),
        ],
      ),
    );
  }

  Widget _buildSupportSection(BuildContext context) {
    final theme = Theme.of(context);

    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text('Need Help?', style: theme.textTheme.titleLarge),
        const SizedBox(height: 15),
        Container(
          padding: const EdgeInsets.all(20),
          decoration: BoxDecoration(
            color: theme.cardColor,
            borderRadius: BorderRadius.circular(8),
          ),
          child: Column(
            children: [
              Text(
                'Our support team is available Monday through Friday, 9:00 AM to 5:00 PM (GMT+7).',
                style: theme.textTheme.bodyMedium?.copyWith(height: 1.5),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: () {},
                style: theme.elevatedButtonTheme.style,
                child: const Text('Contact Support'),
              ),
            ],
          ),
        ),
      ],
    );
  }
}
