import React, { useState } from "react";
import { View, Text, StyleSheet, TextInput, Pressable } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import Header from "../components/Header";

export default function PasswordResetScreen({ navigation }) {
  const [email, setEmail] = useState("");
  const [message, setMessage] = useState("");

  const onResetButtonPress = () => {
    if (!email.trim()) return;
    setMessage("This feature is not implemented yet.");
  };

  return (
    <SafeAreaView style={styles.container}>
      <Pressable onPress={() => navigation.goBack()} style={styles.backBtn}>
        <Text style={styles.backText}>← Back</Text>
      </Pressable>

      <Header title="Password Reset" showIcons={false} />

      <TextInput
        value={email}
        onChangeText={setEmail}
        placeholder="Email"
        placeholderTextColor="#9ca3af"
        style={styles.input}
        autoCapitalize="none"
        keyboardType="email-address"
      />

      <Pressable style={styles.primaryBtn} onPress={onResetButtonPress}>
        <Text style={styles.primaryBtnText}>Send email</Text>
      </Pressable>

      {message ? <Text style={styles.message}>{message}</Text> : null}
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#000",
    paddingTop: 24,
    paddingHorizontal: 16,
  },
  backBtn: {
    marginBottom: 10,
    alignSelf: "flex-start",
  },
  backText: {
    color: "#fff",
    fontSize: 16,
    fontWeight: "600",
  },
  input: {
    backgroundColor: "#1f2937",
    color: "#fff",
    borderRadius: 10,
    paddingHorizontal: 12,
    paddingVertical: 12,
    fontSize: 16,
    marginBottom: 12,
  },
  primaryBtn: {
    backgroundColor: "#dbdbdb",
    borderRadius: 10,
    paddingVertical: 12,
    alignItems: "center",
    marginTop: 4,
    marginBottom: 6,
  },
  primaryBtnText: {
    color: "#000",
    fontWeight: "700",
    fontSize: 16,
  },
  message: {
    color: "#9ca3af",
    fontSize: 14,
    marginTop: 12,
    textAlign: "center",
  },
});
