It's okay to have a friend of the opposite sex, but it would be awkward if you'd be texting each other first thing in the morning and before going to bed. It should be your spouse that you should be talking to and thinking of when you wake up and before going to sleep, right?