Shia LaBeouf, the former teen star who’s best known for co-starring with computer-animated robots in the “Transformers” movies, goes dark and romantic in “Charlie Countryman.” Borrowing ingredients from a few normally unconnected genres, this made-in-Romania film gradually accelerates from a walk to a run, transforming itself into a romantic-comedy-thriller.

“Charlie Countryman” begins like a “Before Sunset” in Bucharest. There’s also a brief sidestep into the broad comedy of the kind seen in 2004’s American-youth-in-Europe comedy, “EuroTrip.”

Before Charlie’s Eastern European adventures start, the Chicago resident witnesses the death of his terminally ill mother (Melissa Leo). Charlie retreats from her dying room to crouch against a hallway wall. His mother’s ghost sits beside him. She tells him he’s floating through his entire life.

“Just this once, tell me what to do,” he says.

“Go to Bucharest,” she says. “I have to go now,” she adds before disappearing.

Charlie heeds his mother’s advice, a choice that leads to him sitting beside Victor, a gregarious Romanian (Ion Caramitru) who happens to die during the transatlantic flight. In what’s becoming a pattern for Charlie, Victor’s ghost also speaks to him.

“Charlie, I ask you a special thing. It is my daughter. Perhaps you’ll give her my gift.”

Evan Rachel Wood co-stars as the suddenly fatherless Gabi. She’s a cellist who performs at the Bucharest Opera House. She has an alluring accent and China doll skin. Obviously, Charlie falls for her.

Despite Gabi’s deep grief over her beloved father’s demise, Charlie and Gabi share “Before Sunset” moments. He is swept away. She’s hesitant but interested. It’s complicated.

Director Fredrik Bond and screenwriter Matt Drake, who based the film on his time as a teacher in Romania, successfully modulate their romantic comedy into thriller territory occupied by Romanian gangsters. The mystified Charlie eventually realizes he’s in serious danger.

The film does well by casting a pair of very effective actors as nasty, scary bad guys. Danish actor Mads Mikkelsen is Gabi’s brutal, cold-blooded ex-husband, Nigel. German actor Til Schweiger co-stars as the threatening nightclub owner, Darko. Schweiger has fewer scenes with LaBeouf than Mikkelsen but he extracts maximum menace from them.

Wood depicts Gabi with a wounded aura that should signal femme fatale-style danger to Charlie. But he’s too in love to let the likely possibility that he and his new friends, including former “Harry Potter” series player Rupert Grint as a crazy Englishman in Romania, will be murdered stop him.

“Charlie Countryman” is not a homerun. As the threats to Charlie grow, for instance, his dogged pursuit of Gabi, credible at first, turns less likely. But this ultimately extremely active movie usually holds one’s interest. Filmed mostly at night in the Romanian locale where the story is set, it’s also colorful and exotic. And LaBeouf never lets his reckless passion fail.