Question to Brazils economy

Why was Brazil so rich between 2010 and 2014? In 2011, it had a GDP per capita of about 13000 US dollars per capita (2700 above the world average). In 2020 it was only at 7000 US dollars per capita (4700 below the world average). Furthermore in 2011 it had a GDP of 2.6 trillion, now in 2022 it has a GDP of 1.9 trillion. I was really wondering how this could happen and couldn't find any clear answers by researching, so I thought someone here might know something specific.

I hope this is not a stupid question. I'm from Germany and I'm just curious😅