import 'package:flutter/material.dart';
import '../colors/dark_mode.dart';
import '../colors/light_mode.dart';

class AppTheme {
  static ThemeData light() {
    return ThemeData(
      brightness: Brightness.light,
      scaffoldBackgroundColor: LightModeColors.backgroundPrimary,
      colorScheme: const ColorScheme.light(
        primary: LightModeColors.lightPrimary,
        surface: LightModeColors.backgroundPrimary,
      ),
      textTheme: const TextTheme(
        headlineLarge: TextStyle(
          fontSize: 22.0,
          fontWeight: FontWeight.w600,
          color: LightModeColors.textPrimary,
          fontFamily: "Syne",
        ),

        headlineMedium: TextStyle(
          fontSize: 22,
          fontWeight: FontWeight.w600,
          color: Colors.black87,
        ),
        bodyMedium: TextStyle(
          fontFamily: "Inter",
          fontSize: 14,
          fontWeight: FontWeight.normal,
          color: LightModeColors.textPrimary,
        ),
      ),
      useMaterial3: true,
      textButtonTheme: TextButtonThemeData(
        style: TextButton.styleFrom(
          textStyle: TextStyle(
            fontSize: 14,
            fontFamily: "Inter",
            color: LightModeColors.textPrimary,
            fontWeight: FontWeight.normal,
          ),
        ),
      ),
      elevatedButtonTheme: ElevatedButtonThemeData(
        style: ElevatedButton.styleFrom(
          textStyle: TextStyle(
            fontSize: 14,
            fontFamily: "Inter",
            color: LightModeColors.textPrimary,
            fontWeight: FontWeight.w600,
          ),
          foregroundColor: LightModeColors.textPrimary,
          backgroundColor: LightModeColors.buttonPrimary,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(10),
          ),
          elevation: 0.0,
        ),
      ),

      inputDecorationTheme: InputDecorationTheme(
        //        isDense: true,
        contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 10),

        // Optional hard height limits
        //       constraints: BoxConstraints(minHeight: 48, maxHeight: 40),
        focusedBorder: OutlineInputBorder(
          borderRadius: BorderRadius.all(Radius.circular(8.0)),
          borderSide: BorderSide(
            color: LightModeColors.inputFocusedBorder,
            width: 1.0,
          ),
        ),
        hoverColor: LightModeColors.inputBackground,
        enabledBorder: OutlineInputBorder(
          borderRadius: BorderRadius.all(Radius.circular(8.0)),
          borderSide: BorderSide(
            color: LightModeColors.inputHoverBorder,
            width: 1.0,
          ),
        ),
        fillColor: LightModeColors.inputBackground,
        filled: true,
      ),
    );
  }

  static ThemeData dark() {
    return ThemeData(
      brightness: Brightness.dark,
      scaffoldBackgroundColor: DarkModeColors.darkBackground,
      colorScheme: const ColorScheme.dark(
        primary: DarkModeColors.darkPrimary,
        surface: DarkModeColors.darkSurface,
      ),
      textTheme: const TextTheme(
        bodyMedium: TextStyle(color: DarkModeColors.darkText),
      ),
      useMaterial3: true,
      inputDecorationTheme: InputDecorationTheme(
        focusedBorder: OutlineInputBorder(
          borderSide: BorderSide(color: Colors.greenAccent, width: 5.0),
        ),
        enabledBorder: OutlineInputBorder(
          borderSide: BorderSide(color: Colors.red, width: 5.0),
        ),
      ),
    );
  }
}
