import React from 'react';
import {
  View,
  Text,
  TouchableOpacity,
  ScrollView,
} from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { useRouter } from 'expo-router';
import { useTheme } from '@/constants/ThemeContext';
import { ArrowLeft, MapPin, Search } from 'lucide-react-native';
import SecurityIllustration from '@/components/SecurityIllustration';
import styles from '@/styles/auth/password-updated.styles';

export default function PasswordUpdatedScreen() {
  const router = useRouter();
  const { isDark } = useTheme();

  const handleBackToLogin = () => {
    router.replace('/(auth)/login' as any);
  };

  return (
    <SafeAreaView style={[styles.safeArea, { backgroundColor: isDark ? '#050E24' : '#FFFFFF' }]}>
      <ScrollView
        contentContainerStyle={styles.scrollContent}
        showsVerticalScrollIndicator={false}
      >
        {/* Top Back Navigation Header */}
        <TouchableOpacity
          onPress={() => router.back()}
          style={styles.backButton}
          activeOpacity={0.7}
        >
          <ArrowLeft size={20} color={isDark ? '#FFFFFF' : '#0C1C3E'} />
          <Text style={[styles.backText, { color: isDark ? '#FFFFFF' : '#0C1C3E' }]}>
            Back
          </Text>
        </TouchableOpacity>

        {/* Decorative subtle icons at top */}
        <View style={styles.decorativeIconsContainer}>
          <MapPin size={24} color={isDark ? '#475569' : '#1E293B'} />
          <Search size={16} color={isDark ? '#475569' : '#64748B'} style={{ marginTop: 24 }} />
        </View>

        {/* Security Shield Hero Icon */}
        <View style={styles.heroContainer}>
          <SecurityIllustration size={170} />
        </View>

        {/* Header Title & Subtitle */}
        <View style={styles.headerContainer}>
          <Text style={[styles.title, { color: isDark ? '#FFFFFF' : '#0C1C3E' }]}>
            Password updated
          </Text>
          <Text style={[styles.subtitle, { color: isDark ? '#94A3B8' : '#64748B' }]}>
            Your password has been succesfully updated you can now login with your new password
          </Text>
        </View>

        {/* Action Button & Footer Info */}
        <View style={styles.actionContainer}>
          <TouchableOpacity
            style={styles.loginButton}
            onPress={handleBackToLogin}
            activeOpacity={0.88}
          >
            <Text style={styles.loginButtonText}>Back to Login</Text>
          </TouchableOpacity>

          <Text style={[styles.footerText, { color: isDark ? '#94A3B8' : '#475569' }]}>
            You can now securely access your account
          </Text>
        </View>
      </ScrollView>
    </SafeAreaView>
  );
}
