"""CLI entry point for PyQt6-based EuBI-Bridge GUI."""

import sys
import logging
from pathlib import Path

# Configure logging
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)


def main():
    """Main entry point for PyQt6 GUI."""
    try:
        from PyQt6.QtWidgets import QApplication
        from eubi_bridge.gui.main_window import create_main_window
        
        # Create application
        app = QApplication(sys.argv)
        
        # Create and show main window
        window = create_main_window()
        window.show()
        
        # Run event loop
        sys.exit(app.exec())
    
    except ImportError as e:
        logger.error(
            f"Failed to import PyQt6: {e}\n"
            "Please install PyQt6 using: pip install PyQt6 PyQt6-sip"
        )
        sys.exit(1)
    
    except Exception as e:
        logger.error(f"Fatal error: {e}", exc_info=True)
        sys.exit(1)


if __name__ == "__main__":
    main()
