Turning an LTR interface RTL with direction: rtl usually works until the first complex form. After that, spacing, icons, numbers and line breaks fail one by one. The fix is not a series of patches; direction needs to be part of the structure from the start.
Use logical properties
Instead of margin-left and padding-right, use margin-inline-start and padding-inline-end. When the document direction changes, the values keep their meaning.
Mixing Persian and Latin
Technology names, URLs and code are unavoidable. Isolate short Latin phrases with dir="ltr" on the element, not the whole paragraph. Put URLs and email addresses in an element with dir="ltr" and unicode-bidi: isolate. For mixed text, use text-align: start instead of right.
Typography and testing
Persian readability depends on line height, letter spacing and half-spaces. Keep the text width bounded and test the page with a long paragraph, a URL and a complete form at the narrowest mobile width. If horizontal scrolling appears, the problem is structural, not cosmetic.