import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:household_keeper/core/theme/app_theme.dart';

void main() {
  group('AppTheme ColorScheme', () {
    test('lightTheme has Brightness.light', () {
      final theme = AppTheme.lightTheme();
      expect(theme.colorScheme.brightness, equals(Brightness.light));
    });

    test('darkTheme has Brightness.dark', () {
      final theme = AppTheme.darkTheme();
      expect(theme.colorScheme.brightness, equals(Brightness.dark));
    });

    test('both themes use sage green seed (primary in green hue range)', () {
      final lightPrimary = HSLColor.fromColor(
        AppTheme.lightTheme().colorScheme.primary,
      );
      final darkPrimary = HSLColor.fromColor(
        AppTheme.darkTheme().colorScheme.primary,
      );

      // Sage green hue is approximately 100-150 degrees
      expect(lightPrimary.hue, inInclusiveRange(80, 160));
      expect(darkPrimary.hue, inInclusiveRange(80, 160));
    });

    test('light surface color is warm stone (0xFFF5F0E8)', () {
      final theme = AppTheme.lightTheme();
      expect(theme.colorScheme.surface, equals(const Color(0xFFF5F0E8)));
    });

    test('dark surface color is warm charcoal (0xFF2A2520), not cold gray', () {
      final theme = AppTheme.darkTheme();
      expect(theme.colorScheme.surface, equals(const Color(0xFF2A2520)));
    });

    test('both themes use Material 3', () {
      expect(AppTheme.lightTheme().useMaterial3, isTrue);
      expect(AppTheme.darkTheme().useMaterial3, isTrue);
    });
  });
}
