Preheat your oven to 375°F (190°C).
In a large frying pan, heat the olive oil over medium heat. Add the chopped onion and garlic, and sauté until softened, about 5 minutes.
Add the spinach to the pan and cook until wilted. Remove from heat and let it cool slightly.
In a large mixing bowl, combine the sautéed spinach mixture, feta cheese, ricotta cheese, eggs, parsley, dill, salt, and pepper. Stir until everything is well mixed.
Brush a baking dish with olive oil. Layer about 5 sheets of filo dough in the dish, brushing each sheet with olive oil before adding the next one. This will help create a crispy, golden crust.
Spread the spinach and cheese filling evenly over the filo dough in the baking dish.
Layer the remaining filo sheets on top of the filling, continuing to brush each sheet with olive oil. Fold any overhanging filo dough into the sides of the dish.
Bake the pie in the preheated oven for 35-40 minutes, or until the top is golden brown and crispy.
Let the pie cool for a few minutes before slicing and serving.