import 'package:flutter/material.dart';

class ThemeColors {
  static const timerRed = Color(0xFFCF0000);
  static const successInputSMS = Color(0xFF36B82C);
  static const warningSurface = Color(0xFFFFEFE4);
  static const green173Light = Color(0xFFC7FCF6);
  static const green191Light = Color(0xFFE9FBFF);
  static const warning = Color(0xFFEE5800);
  static const green173text = Color(0xFF02685E);
  static const green191text = Color(0xFF00668F);
}

class LightThemeColors extends ThemeColors {
  static const dividerColor = Color(0x0dFFFFFF);
  static const accentColor = Color(0xFF4275ba); // Neon Yellow
  static const darkBackground = Color(0xFF171717); // Dark Grey
  static const grey = Color(0xFF242424); // Grey
  static const midGrey = Color(0xFF474747); // Mid Grey
  static const lightGrey = Color(0xFF747474); // Light Grey
  static const white = Color(0xFFffffff);
  static const white60Transparent = Color(0x99FFFFFF);
  static const white30Transparent = Color(0x4dFFFFFF);
  static const white10Transparent = Color(0x1aFFFFFF);
  static const white20Transparent = Color(0x33FFFFFF);
  static const white40Transparent = Color(0x66FFFFFF);
  static const errorColor = Color(0xFFCF0000);

  ///shimmer
  static const backgroundGray = Color(0x80FFFFFF);
  static const shimmerHighlight = Color(0xffffffff);
  static const statusNumber = Color(0xff495057);

  ///new colors
  static const primaryColor = Color(0xff0074B0);
  static const textColor = Color(0xFF0C0C0C);
  static const secondaryText = Color(0xFF85938E);
  static const scaffoldBackgroundColor = Color(0xFFffffff);
  static const borderColor = Color(0xFF707479);
  static const edittextBackground = Color(0xFFF8FBFC);
  static const buttonColorText = Color(0xffffffff);
  static const disabledColor = Color(0x331783B2);
  static const iconBackground = Color(0xffE3F3F6);
  static const lightSecondary = Color(0xff858D93);
  static const grayBackground = Color(0xffF8FBFC);
  static const statusBackground = Color(0xffffffff);
  static const lightBorder = Color(0xffE3E3E3);
  static const black40Transparent = Color(0x66000000);
  static const statusIconBackground = Color(0xffF1F3F5);
}

class DarkThemeColors {
  static const dividerColor = Color(0x0dFFFFFF);
  static const accentColor = Color(0xFF4275ba); // Neon Yellow
  static const darkBackground = Color(0xFF171717); // Dark Grey
  static const grey = Color(0xFF242424); // Grey
  static const midGrey = Color(0xFF474747); // Mid Grey
  static const lightGrey = Color(0xFF747474); // Light Grey
  static const white = Colors.white;
  static const white60Transparent = Color(0x99FFFFFF);
  static const white30Transparent = Color(0x4dFFFFFF);
  static const white10Transparent = Color(0x1aFFFFFF);
  static const errorColor = Color(0xFFCF0000);

  ///new colors
  static const primaryColor = Color(0xff1783B2);
  static const textColor = Color(0xFFFFFFFF);
  static const secondaryText = Color(0xFFC7C7C7);
  static const scaffoldBackgroundColor = Color(0xFF171717);
  static const borderColor = Color(0xFF707479);
  static const edittextBackground = Color(0xFF000000);
  static const buttonColorText = Color(0xffffffff);
  static const disabledColor = Color(0x331783B2);
  static const iconBackground = Color(0xff1A272D);
  static const lightSecondary = Color(0xffc7c7c7);
  static const grayBackground = Color(0xff000000);
  static const statusBackground = Color(0xff1A272D);
  static const lightBorder = Color(0xff252525);
  static const statusIconBackground = Color(0xff000000);
}

@immutable
class AppThemeColors extends ThemeExtension<AppThemeColors> {
  final Color scaffoldBackgroundColor;
  final Color textColor;
  final Color dividerColor;
  final Color accentColor;
  final Color darkBackground;
  final Color grey;
  final Color midGrey;
  final Color lightGrey;
  final Color white;
  final Color white60Transparent;
  final Color white30Transparent;
  final Color white10Transparent;
  final Color buttonColorText;

  ///newcolors
  final Color primaryColor;
  final Color secondaryText;
  final Color borderColor;
  final Color edittextBackground;
  final Color iconBackground;
  final Color lightSecondary;
  final Color grayBackground;
  final Color statusBackground;
  final Color lightBorder;
  final Color statusIconBackground;

  const AppThemeColors({
    required this.scaffoldBackgroundColor,
    required this.textColor,
    required this.dividerColor,
    required this.accentColor,
    required this.darkBackground,
    required this.grey,
    required this.midGrey,
    required this.lightGrey,
    required this.white,
    required this.white60Transparent,
    required this.white30Transparent,
    required this.white10Transparent,
    required this.buttonColorText,
    required this.primaryColor,
    required this.secondaryText,
    required this.borderColor,
    required this.edittextBackground,
    required this.iconBackground,
    required this.lightSecondary,
    required this.grayBackground,
    required this.statusBackground,
    required this.lightBorder,
    required this.statusIconBackground,
  });

  @override
  ThemeExtension<AppThemeColors> copyWith({
    Color? scaffoldBackgroundColor,
    Color? textColor,
    Color? dividerColor,
    Color? accentColor,
    Color? darkBackground,
    Color? grey,
    Color? midGrey,
    Color? lightGrey,
    Color? white,
    Color? white60Transparent,
    Color? white30Transparent,
    Color? white10Transparent,
    Color? buttonColorText,
    Color? primaryColor,
    Color? secondaryText,
    Color? borderColor,
    Color? edittextBackground,
    Color? iconBackground,
    Color? lightSecondary,
    Color? grayBackground,
    Color? statusBackground,
    Color? lightBorder,
    Color? statusIconBackground,
  }) {
    return AppThemeColors(
      scaffoldBackgroundColor:
          scaffoldBackgroundColor ?? this.scaffoldBackgroundColor,
      textColor: textColor ?? this.textColor,
      dividerColor: dividerColor ?? this.dividerColor,
      accentColor: accentColor ?? this.accentColor,
      darkBackground: darkBackground ?? this.darkBackground,
      grey: grey ?? this.grey,
      midGrey: midGrey ?? this.midGrey,
      lightGrey: lightGrey ?? this.lightGrey,
      white: white ?? this.white,
      white60Transparent: white60Transparent ?? this.white60Transparent,
      white30Transparent: white30Transparent ?? this.white30Transparent,
      white10Transparent: white10Transparent ?? this.white10Transparent,
      buttonColorText: buttonColorText ?? this.buttonColorText,
      primaryColor: primaryColor ?? this.primaryColor,
      secondaryText: secondaryText ?? this.secondaryText,
      borderColor: borderColor ?? this.borderColor,
      edittextBackground: edittextBackground ?? this.edittextBackground,
      iconBackground: iconBackground ?? this.iconBackground,
      lightSecondary: lightSecondary ?? this.lightSecondary,
      grayBackground: grayBackground ?? this.grayBackground,
      statusBackground: statusBackground ?? this.statusBackground,
      lightBorder: lightBorder ?? this.lightBorder,
      statusIconBackground: statusIconBackground ?? this.statusIconBackground,
    );
  }

  @override
  AppThemeColors lerp(ThemeExtension<AppThemeColors>? other, double t) {
    if (other is! AppThemeColors) return this;

    return AppThemeColors(
      scaffoldBackgroundColor: Color.lerp(scaffoldBackgroundColor, other.scaffoldBackgroundColor, t)!,
      textColor: Color.lerp(textColor, other.textColor, t)!,
      dividerColor: Color.lerp(dividerColor, other.dividerColor, t)!,
      accentColor: Color.lerp(accentColor, other.accentColor, t)!,
      darkBackground: Color.lerp(darkBackground, other.darkBackground, t)!,
      grey: Color.lerp(grey, other.grey, t)!,
      midGrey: Color.lerp(midGrey, other.midGrey, t)!,
      lightGrey: Color.lerp(lightGrey, other.lightGrey, t)!,
      white: Color.lerp(white, other.white, t)!,
      white60Transparent: Color.lerp(white60Transparent, other.white60Transparent, t)!,
      white30Transparent: Color.lerp(white30Transparent, other.white30Transparent, t)!,
      white10Transparent: Color.lerp(white10Transparent, other.white10Transparent, t)!,
      buttonColorText: Color.lerp(buttonColorText, other.buttonColorText, t)!,
      primaryColor: Color.lerp(primaryColor, other.primaryColor, t)!,
      secondaryText: Color.lerp(secondaryText, other.secondaryText, t)!,
      borderColor: Color.lerp(borderColor, other.borderColor, t)!,
      edittextBackground: Color.lerp(edittextBackground, other.edittextBackground, t)!,
      iconBackground: Color.lerp(iconBackground, other.iconBackground, t)!,
      lightSecondary: Color.lerp(lightSecondary, other.lightSecondary, t)!,
      grayBackground: Color.lerp(grayBackground, other.grayBackground, t)!,
      statusBackground: Color.lerp(statusBackground, other.statusBackground, t)!,
      lightBorder: Color.lerp(lightBorder, other.lightBorder, t)!,
      statusIconBackground: Color.lerp(statusIconBackground, other.statusIconBackground, t)!,
    );
  }


  static get light => const AppThemeColors(
    scaffoldBackgroundColor: LightThemeColors.scaffoldBackgroundColor,
    textColor: LightThemeColors.textColor,
    dividerColor: LightThemeColors.dividerColor,
    accentColor: LightThemeColors.accentColor,
    darkBackground: LightThemeColors.darkBackground,
    grey: LightThemeColors.grey,
    midGrey: LightThemeColors.midGrey,
    lightGrey: LightThemeColors.lightGrey,
    white: LightThemeColors.white,
    white60Transparent: LightThemeColors.white60Transparent,
    white30Transparent: LightThemeColors.white30Transparent,
    white10Transparent: LightThemeColors.white10Transparent,
    buttonColorText: LightThemeColors.buttonColorText,
    primaryColor: LightThemeColors.primaryColor,
    secondaryText: LightThemeColors.secondaryText,
    borderColor: LightThemeColors.borderColor,
    edittextBackground: LightThemeColors.edittextBackground,
    iconBackground: LightThemeColors.iconBackground,
    lightSecondary: LightThemeColors.lightSecondary,
    grayBackground: LightThemeColors.grayBackground,
    statusBackground: LightThemeColors.statusBackground,
    lightBorder: LightThemeColors.lightBorder,
    statusIconBackground: LightThemeColors.statusIconBackground,
  );

  static get dark => const AppThemeColors(
    scaffoldBackgroundColor: DarkThemeColors.scaffoldBackgroundColor,
    textColor: DarkThemeColors.textColor,
    dividerColor: DarkThemeColors.dividerColor,
    accentColor: DarkThemeColors.accentColor,
    darkBackground: DarkThemeColors.darkBackground,
    grey: DarkThemeColors.grey,
    midGrey: DarkThemeColors.midGrey,
    lightGrey: DarkThemeColors.lightGrey,
    white: DarkThemeColors.white,
    white60Transparent: DarkThemeColors.white60Transparent,
    white30Transparent: DarkThemeColors.white30Transparent,
    white10Transparent: DarkThemeColors.white10Transparent,
    buttonColorText: DarkThemeColors.buttonColorText,
    primaryColor: DarkThemeColors.primaryColor,
    secondaryText: DarkThemeColors.secondaryText,
    borderColor: DarkThemeColors.borderColor,
    edittextBackground: DarkThemeColors.edittextBackground,
    iconBackground: DarkThemeColors.iconBackground,
    lightSecondary: DarkThemeColors.lightSecondary,
    grayBackground: DarkThemeColors.grayBackground,
    statusBackground: DarkThemeColors.statusBackground,
    lightBorder: DarkThemeColors.lightBorder,
    statusIconBackground: DarkThemeColors.statusIconBackground,
  );
}
