Director Sam Esmail has said it was "surreal" working with former US President Barack Obama on his latest project, the Julia Roberts-starring apocalyptic thriller Leave the World Behind.
The Netflix film, which launched globally on the streaming platform on 8 December, was produced by Esmail Corp and Red Om Films and executive produced by Barack and Michelle Obama's production company Higher Ground.
In the bleak and gripping film, which Esmail adapted for the screen from Rumaan Alam's acclaimed 2020 novel of the same name, two families are forced to seek refuge together from a mysterious cyberattack that has taken out communications and caused untold mayhem across the United States. The former President was heavily involved in the making of the film, which Esmail said was "surreal".

Speaking to RTÉ Entertainment, the filmmaker said: "I'm such an admirer of his and I consider him to be one of the most brilliant minds on the planet. The great thing is he's also a huge movie lover and he was a huge fan of the book and he was so committed to making sure we turned this into a good film.
"He gave notes on everything from character to theme to the disaster elements, he was involved from the script to post [production], I can’t speak highly enough, it was such a highlight of my career, it was a wonderful collaboration."
Movie Review: Leave the World Behind
Esmail, probably best known for creating and directing the award-winning Rami Malek-starring series Mr Robot, said Obama was focused on the idea that the film is a "cautionary tale about mistrust".
"We didn’t want to pull punches with it," he said. "I know that that was really important for the both of us, that the film really explores what happens when we lose sight of our common humanity in the face of a crisis. We stayed committed to that as much as possible."

Esmail, who previously worked with Hollywood icon Roberts on the TV shows Homecoming and Gaslit, said he knew she would be perfect to take on the leading role as Amanda Sandford, a snippy New York-based advertising executive who decamps to a luxurious Long Island holiday home for the weekend along with her husband Clay (Ethan Hawke) and children Archie (Charlie Evans) and Rose (Farrah Mackenzie).
He explained: "After reading the book I found Amanda so compelling and interesting as a character, but she's so thorny and flawed, and I knew if an audience needed to hang with a person like that I needed to find someone who not only had the talent to channel the humanity out of a person like that but had that sort of undefinable charisma. You can't ask for someone better than Julia Roberts to tackle a role like that."
Read more: Julia Roberts says her kindness on set is 'intentional'

Despite its often bleak outlook of what the breakdown of civilisation might look like, there are some moments that highlight the importance of sticking together. When asked about the message behind the line of dialogue, "As awful as we may be, we are all we've got", Esmail replied: "In a weird way, it feels simplistic, I don’t think on the face of it it’s profound, but at the same time I think it’s an important reminder.
"Oftentimes we want to retreat to our corners and we want to point the finger at the other side and during a crisis we need to be doing the exact opposite and coming together and figuring it out.
"And I find the fact that we do this instinct that drives us into these silos, into these echo chambers, is uniquely a modern dilemma. I thought that was such a rich subtext to explore in a film like this."

Another aspect that the director explored in Leave the World Behind was how utterly dependent on technology we have become.
"Technology is growing exponentially and our reliance on it is growing alongside with that. We’ve never stopped to think – what happens when that’s been taken away? How do we pick up the pieces and move forward? I just think that’s such a relatable idea right now.
Watch: Julia Roberts - "I want people to be kind to me at work"
"There’s a line in the book that’s also in the movie where Clay says: 'I’m a useless man I can barely do anything without my phone and my GPS' and I completely relate to that like I think a lot of people would. I found that a fascinating problem that can only exist today."
So does he start panicking if his phone battery is at 10%?
"A thousand per cent. I am the worst offender at being overly reliant on tech!"
Leave the World Behind is available to watch on Netflix now.