function EditVisitModal({ editingVisit, handleEditVisitSubmit, lang, setEditingVisit, setShowEditVisitModal }) {
    return (
        <>
        <div className="fixed inset-0 bg-brand-harbor/60 backdrop-blur-md z-[60] flex items-center justify-center p-4" dir={lang === 'ar' ? 'rtl' : 'ltr'}>
            <form onSubmit={handleEditVisitSubmit} className="bg-white border border-brand-dune/80 rounded-3xl max-w-lg w-full p-8 shadow-2xl text-brand-harbor max-h-[90vh] overflow-y-auto space-y-4">
                <div className="flex items-center justify-between pb-3 border-b border-brand-dune/40">
                    <h3 className="text-xl font-extrabold text-brand-harbor">{lang === 'ar' ? 'تعديل الزيارة' : 'Edit visit'}</h3>
                    <button type="button" onClick={() => { setShowEditVisitModal(false); setEditingVisit(null); }} className="w-9 h-9 rounded-full bg-brand-linen hover:bg-brand-dune/50 text-brand-harbor font-bold">✕</button>
                </div>
                <div><label className="block text-xs font-bold text-brand-steel mb-1.5">{lang === 'ar' ? 'التاريخ' : 'Date'}</label><input type="date" value={editingVisit.date || ''} onChange={e => setEditingVisit({ ...editingVisit, date: e.target.value })} className="w-full px-4 py-3 bg-brand-linen/60 border border-brand-dune rounded-2xl text-sm font-semibold text-brand-harbor focus:outline-none" /></div>
                <div><label className="block text-xs font-bold text-brand-steel mb-1.5">{lang === 'ar' ? 'التشخيص' : 'Diagnosis'}</label><input type="text" value={editingVisit.diagnosis || ''} onChange={e => setEditingVisit({ ...editingVisit, diagnosis: e.target.value })} className="w-full px-4 py-3 bg-brand-linen/60 border border-brand-dune rounded-2xl text-sm font-semibold text-brand-harbor focus:outline-none" /></div>
                <div><label className="block text-xs font-bold text-brand-steel mb-1.5">{lang === 'ar' ? 'ملاحظات الزيارة' : 'Visit notes'}</label><textarea rows="3" value={editingVisit.notes || ''} onChange={e => setEditingVisit({ ...editingVisit, notes: e.target.value })} className="w-full px-4 py-3 bg-brand-linen/60 border border-brand-dune rounded-2xl text-sm font-semibold text-brand-harbor focus:outline-none"></textarea></div>
                <div className="flex justify-end gap-2 pt-2">
                    <button type="button" onClick={() => { setShowEditVisitModal(false); setEditingVisit(null); }} className="px-5 py-2.5 rounded-2xl text-sm font-semibold text-brand-steel hover:bg-brand-linen">{lang === 'ar' ? 'إلغاء' : '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">{lang === 'ar' ? 'حفظ التعديلات' : 'Save changes'}</button>
                </div>
            </form>
        </div>
        </>
    );
}
