Jennifer Lopez. (Vanity Fair,)

Jennifer Lopez gave her first interview since splitting from husband Marc Anthony to Vanity Fair. While we know that the diva is “happy” enough to work, she’s still feeling a little blue about the breakup.

“Sometimes it doesn’t work—and that’s sad,” Lopez said of her latest divorce. “But I remain an eternal optimist about love.” In fact, the “American Idol” judge still considers herself “a hopeless romantic” after three dissolved marriages and other high-profile breakups.

Lopez explained that she didn’t realize she was compromising herself by staying in unhappy relationships in the past. “If I stay, then I am not doing the right thing for me. I love myself enough to walk away from that now,” she said.

The 42-year-old singer and actress had only kind words for the father of her twins, Emme and Max. “We actually work great together, and he was always very supportive,” she said. “Together we could make magic—and we did. He will always be in our lives. He will always hold a special place in my heart as the father of my children.”

The full interview hits newsstands Wednesday.