Implement: (1) Singleton pattern — thread-safe logger class that ensures only one instance exists. Show eager vs lazy initialization. (2) Factory Method — create different types of documents (PDF, Word, HTML) without specifying concrete classes. (3) Abstract Factory — create UI components (Button, Checkbox) for different OS themes (Windows, Mac). Explain when to use each.