#include <QApplication>
#include <QMainWindow>
#include <QDebug>

#include "core/translator.h"
#include "db/databasemanager.h"
#include "core/eventbus.h"
#include "utils/notificationmanager.h"
#include "syncscheduler.h"
#include "ui/mainmainwindow.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    app.setApplicationName("Wino Mail");
    app.setApplicationVersion("1.0.0");
    app.setOrganizationName("Wino");

    // Initialize subsystems
    DatabaseManager::instance().initialize();
    
    EventBus &bus = EventBus::instance();
    NotificationManager notificationManager(&bus);
    
    // Start background sync
    SyncScheduler syncScheduler(&bus);
    syncScheduler.start();

    // Create main window
    MainMainWindow window;
    window.show();

    qDebug() << "Wino Mail started successfully";

    return app.exec();
}
