Bathroom doors differ quite a bit; a picture of the gap might be helpful. I don't have any gap above mine when it's closed, though there is a space of several inches between it and the ceiling when it's open. (It has a catch on the other side of the hall to hold it open and form a sort of partition/expanded bathroom and shower area—a quite nice design, I think.) Even that gap doesn't seem to me to compromise privacy at all; there's no way for anybody to accidentally peer over it.
For a curtain like solution, I would think a ceiling-mounted track or similar would be most practical. You would have to screw it into the ceiling in a few places to support it. Ikea sells a fairly decent inexpensive track system ("Kvartal") that with a little bit of ingenuity and drilling appears to me to be flush-mountable to a ceiling.
I'd avoid anything too airtight if you have an exhaust fan in the bathroom; there rather needs to be some way for air that it draws out to be replaced.