This is a rather complex question. I recommend gleaning what you can from this great article on the subject matter, and discussing this with a good rav. I will, bli neder try to do this with my rav. If possible, edit my answer afterwards. I shall summarize the article's main points.
The source of not allowing Torah thoughts, reciting shema, etc, originates from the verse Deuteronomy 23:15:
כִּי֩ יְהוָ֨ה אֱלֹהֶ֜יךָ מִתְהַלֵּ֣ךְ ׀ בְּקֶ֣רֶב מַחֲנֶ֗ךָ
לְהַצִּֽילְךָ֙ וְלָתֵ֤ת אֹיְבֶ֙יךָ֙ לְפָנֶ֔יךָ וְהָיָ֥ה מַחֲנֶ֖יךָ
קָד֑וֹשׁ וְלֹֽא־יִרְאֶ֤ה בְךָ֙ עֶרְוַ֣ת דָּבָ֔ר וְשָׁ֖ב מֵאַחֲרֶֽיךָ׃
For the LORD thy God walketh in the midst of thy camp, to deliver
thee, and to give up thine enemies before thee; therefore shall thy
camp be holy; that He see no unseemly thing in thee, and turn away
Making the camp "holy", in this case, means distancing oneself from צואה - feces. (See the verses preceding the one that I cited to understand why.)
Thus, the concern is dealing with a permanent bet hakiseh - a room designated for use of relieving oneself. According to most opinions, one may not think Torah thoughts in a permanent bet hakiseh even if there is no excrement present there.
The flip side of the problem is whether today's modern "bathrooms" fit the Talmudic definition of bet hakiseh since excrement is flushed down and is rarely present.
That's the part of the discussion you need to read and discuss further with a rav.