function EditPatientModal({ editingPatient, handleEditPatientSubmit, lang, setEditingPatient, setShowEditPatient, strings }) {
    return (
        <>
        <div className="fixed inset-0 bg-brand-harbor/60 backdrop-blur-md z-50 flex items-center justify-center p-4">
            <div className="bg-white border border-brand-dune/80 rounded-3xl max-w-lg w-full p-8 shadow-2xl text-brand-harbor">
                <div className="flex items-center justify-between mb-6">
                    <h3 className="text-xl font-bold text-brand-harbor">{strings.editPatient}</h3>
                    <button onClick={() => setShowEditPatient(false)} className="w-8 h-8 rounded-full bg-brand-linen hover:bg-brand-dune/40 flex items-center justify-center text-brand-steel">✕</button>
                </div>
                <form onSubmit={handleEditPatientSubmit} className="space-y-4">
                    <div>
                        <label className="block text-xs font-bold uppercase text-brand-steel mb-1.5">{strings.patientName}</label>
                        <input type="text" required value={editingPatient.name} onChange={e => setEditingPatient({...editingPatient, name: e.target.value})} className="w-full px-4 py-3 rounded-2xl bg-brand-linen/50 border border-brand-dune text-brand-harbor text-sm font-medium focus:outline-none focus:ring-2 focus:ring-brand-sky focus:bg-white" />
                    </div>
                    <div className="grid grid-cols-3 gap-4">
                        <div>
                            <label className="block text-xs font-bold uppercase text-brand-steel mb-1.5">{lang === 'ar' ? 'العمر' : 'Age'}</label>
                            <input type="number" required value={editingPatient.age} onChange={e => setEditingPatient({...editingPatient, age: e.target.value})} className="w-full px-4 py-3 rounded-2xl bg-brand-linen/50 border border-brand-dune text-brand-harbor text-sm font-medium focus:outline-none focus:ring-2 focus:ring-brand-sky focus:bg-white" />
                        </div>
                        <div>
                            <label className="block text-xs font-bold uppercase text-brand-steel mb-1.5">{lang === 'ar' ? 'الجنس' : 'Gender'}</label>
                            <select value={editingPatient.gender} onChange={e => setEditingPatient({...editingPatient, gender: e.target.value})} className="w-full px-4 py-3 rounded-2xl bg-brand-linen/50 border border-brand-dune text-brand-harbor text-sm font-medium focus:outline-none focus:ring-2 focus:ring-brand-sky focus:bg-white">
                                <option value="Female">{lang === 'ar' ? 'أنثى' : 'Female'}</option>
                                <option value="Male">{lang === 'ar' ? 'ذكر' : 'Male'}</option>
                            </select>
                        </div>
                        <div>
                            <label className="block text-xs font-bold uppercase text-brand-steel mb-1.5">{strings.triageLevel}</label>
                            <select value={editingPatient.triage || 'Routine'} onChange={e => setEditingPatient({...editingPatient, triage: e.target.value})} className="w-full px-4 py-3 rounded-2xl bg-brand-linen/50 border border-brand-dune text-brand-harbor text-sm font-medium focus:outline-none focus:ring-2 focus:ring-brand-sky focus:bg-white">
                                <option value="Routine">Routine</option>
                                <option value="Urgent">Urgent</option>
                                <option value="Emergency">Emergency</option>
                            </select>
                        </div>
                    </div>
                    <div>
                        <label className="block text-xs font-bold uppercase text-brand-steel mb-1.5">{strings.phone}</label>
                        <input type="text" required value={editingPatient.phone} onChange={e => setEditingPatient({...editingPatient, phone: e.target.value})} className="w-full px-4 py-3 rounded-2xl bg-brand-linen/50 border border-brand-dune text-brand-harbor text-sm font-medium focus:outline-none focus:ring-2 focus:ring-brand-sky focus:bg-white" />
                    </div>
                    <div>
                        <label className="block text-xs font-bold uppercase text-brand-steel mb-1.5">{strings.diagnosis}</label>
                        <input type="text" required value={editingPatient.diagnosis} onChange={e => setEditingPatient({...editingPatient, diagnosis: e.target.value})} className="w-full px-4 py-3 rounded-2xl bg-brand-linen/50 border border-brand-dune text-brand-harbor text-sm font-medium focus:outline-none focus:ring-2 focus:ring-brand-sky focus:bg-white" />
                    </div>
                    <div>
                        <label className="block text-xs font-bold uppercase text-brand-steel mb-1.5">{lang === 'ar' ? 'ملاحظات / حساسية الأدوية' : 'Clinical Notes / Allergies'}</label>
                        <textarea value={editingPatient.notes || ''} onChange={e => setEditingPatient({...editingPatient, notes: e.target.value})} className="w-full px-4 py-3 rounded-2xl bg-brand-linen/50 border border-brand-dune text-brand-harbor text-sm font-medium focus:outline-none focus:ring-2 focus:ring-brand-sky focus:bg-white"></textarea>
                    </div>
                    <div className="flex justify-end space-x-3 rtl:space-x-reverse pt-4 border-t border-brand-dune/30">
                        <button type="button" onClick={() => setShowEditPatient(false)} className="px-5 py-2.5 rounded-2xl text-sm font-semibold text-brand-steel hover:bg-brand-linen">{strings.cancel}</button>
                        <button type="submit" className="px-5 py-2.5 rounded-2xl text-sm font-bold bg-brand-harbor hover:bg-brand-sky text-white shadow-md">{strings.update}</button>
                    </div>
                </form>
            </div>
        </div>
        </>
    );
}
