Add dark/light mode with system preference detection and persistence
Implement dark mode for {{APPLICATION}}:
Requirements:
1. Toggle between dark/light/system modes
2. Detect system preference with prefers-color-scheme
3. Persist user preference in localStorage
4. Smooth transition between modes
5. Support for component-level theme overrides
6. SEO-friendly (no flash of wrong theme)
Implementation:
1. Create ThemeContext with theme state
2. Add CSS variables for both themes
3. Implement toggle component
4. Add system preference detection
5. Persist to localStorage
6. Add transition CSS
7. SSR-safe initial render
Provide:
- ThemeProvider component
- useTheme hook
- Theme toggle component
- CSS variable definitions
- Transition styles
- SSR-safe hydration
- Test for theme persistenceAdding dark mode to applications