import 'package:flutter/material.dart';

class AppColors {
  // Theme mode tracking
  static bool _isDarkMode = false;

  static void setDarkMode(bool isDark) {
    _isDarkMode = isDark;
  }

  static bool get isDarkMode => _isDarkMode;

  // Theme-aware colors
  static Color get primaryTextColor =>
      _isDarkMode ? const Color(0xFFFFFFFF) : const Color(0xFF212529);

  static Color get secondaryTextColor =>
      _isDarkMode ? const Color(0xFFFFFFFF) : const Color(0xFF24848E);

  static Color get backgroundColor =>
      _isDarkMode ? const Color(0xFF222222) : const Color(0xFFFFFFFF);

  static Color get surfaceColor =>
      _isDarkMode ? const Color(0xFF2C2C2C) : const Color(0xFFFFFFFF);

  static Color get cardBackground =>
      _isDarkMode ? const Color(0xFF2B2B2B) : const Color(0xFFFFFFFF);

  static Color get borderColor =>
      _isDarkMode ? const Color(0xFF3C3C3C) : const Color(0xFFE1E1E1);

  static Color get dividerColor =>
      _isDarkMode ? const Color(0xFF3C3C3C) : const Color(0xFFE1E1E1);

  static Color get inputFillColor =>
      _isDarkMode ? const Color(0xFF2C2C2C) : const Color(0xFFF5F5F5);

  // Static colors that don't change with theme
  static const Color mainBlue = Color(0xff0164FF);
  static const Color borderBlue = Color(0xffA1C6FF);
  static const Color primaryColor = Color(0xFF007BFF);
  static const Color accentColor = Color(0xFFE83E8C);

  // Link color
  static const Color linkTextColor = primaryColor;

  // Status Colors (usually don't change with theme)
  static const Color successColor = Color(0xFF28A745);
  static const Color errorColor = Color(0xFFDC3545);
  static const Color warningColor = Color(0xFFFFC107);
  static const Color jellyBean = Color(0xFF34BCCB);
  static const Color grey = Color(0xFF555555);

  static Color get primary0 =>
      _isDarkMode ? const Color(0xFF2B2B2B) : const Color(0xFFFFFFFF);

  static Color get grey10 =>
      _isDarkMode ? const Color(0xFF292929) : const Color(0xFFF4F4F4);

  static Color get grey20 =>
      _isDarkMode ? const Color(0xFF333333) : const Color(0xFFE3E3E3);

  static Color get grey30 =>
      _isDarkMode ? const Color(0xFF494949) : const Color(0xFFE1E1E1);

  static Color get grey40 =>
      _isDarkMode ? const Color(0xFF484848) : const Color(0xFFDADADA);

  static Color get grey50 =>
      _isDarkMode ? const Color(0xFF707070) : const Color(0xFF9E9E9E);

  static Color get grey60 =>
      _isDarkMode ? const Color(0xFF777777) : const Color(0xFF777777);

  static Color get grey70 =>
      _isDarkMode ? const Color(0xFF9E9E9E) : const Color(0xFF444444);

  static Color get grey80 =>
      _isDarkMode ? const Color(0xFFFFFFFF) : const Color(0xFF222222);
  static Color get grey0 =>
      _isDarkMode ? const Color(0xFF262626) : const Color(0xFFFCFCFC);

  static Color get titleColor =>
      _isDarkMode ? const Color(0xFFFCFCFC) : const Color(0xFF222222);

  static Color get green20 =>
      _isDarkMode ? const Color(0xFF4E5D4C) : const Color(0xFFDAF8D6);

  static Color get green30 =>
      _isDarkMode ? const Color(0xFF80C491) : const Color(0xFF289744);

  static Color get textBlue =>
      _isDarkMode ? const Color(0xFF3A87FF) : const Color(0xFF0164FF);

  static Color get iconColor =>
      _isDarkMode ? const Color(0xFF999999) : const Color(0xFF888888);

  static Color get primary10 =>
      _isDarkMode
          ? const Color.fromRGBO(104, 151, 151, 0.2)
          : const Color(0xFFEAF8F9);

  static Color get primary10Light =>
      _isDarkMode
          ? const Color.fromRGBO(104, 151, 151, 0.2)
          : const Color(0xFFF7FAFF);

  static Color get primary20 =>
      _isDarkMode
          ? const Color.fromRGBO(111, 134, 165, 0.2)
          : const Color.fromRGBO(11, 134, 165, 0.2);

  static Color get primary30 =>
      _isDarkMode ? const Color(0xFF06162E) : const Color(0xFFD9E8FF);

  static Color get orange10 =>
      _isDarkMode
          ? const Color.fromRGBO(131, 120, 105, 0.2)
          : const Color(0xFFFFF2DE);

  static Color get orange0 =>
      _isDarkMode
          ? const Color.fromRGBO(50, 48, 48, 0.85)
          : const Color(0xFFFEFBF8);

  static Color get white =>
      _isDarkMode ? const Color(0xFFFFFFFF) : const Color(0xFFFFFFFF);

  static Color get paleOrange =>
      _isDarkMode ? const Color(0xFF260000) : const Color(0xFFfff7ee);

  static Color get veryPaleOrange =>
      _isDarkMode ? const Color(0xFF581010) : const Color(0xFFFFE4C9);

  static Color get green0 =>
      _isDarkMode ? const Color(0xFF2E312D) : const Color(0xFFF9FCF8);

  static Color get green10 =>
      _isDarkMode ? const Color(0xFF50594E) : const Color(0xFFE0F0DC);

  static Color get red10 =>
      _isDarkMode ? const Color(0xFF524545) : const Color(0xFFF8D6D6);

  static Color get red20 =>
      _isDarkMode ? const Color(0xFFFF7979) : const Color(0xFFC02525);

  static Color get blue0 =>
      _isDarkMode ? const Color(0xFF4C6367) : const Color(0xFFD6F4F8);

  static Color get error =>
      _isDarkMode ? const Color(0xFFFF3232) : const Color(0xFFC02525);

  static Color get purple =>
      _isDarkMode ? const Color(0xFF270059) : const Color(0xFF270059);

  static Color get purpleLight =>
      _isDarkMode ? const Color(0xFFEAE6EF) : const Color(0xFFEAE6EF);

  static Color get red0 =>
      _isDarkMode
          ? const Color(0xFF312F2F)
          : const Color(0xFFF8D6D6).withValues(alpha: 0.2);

  // Primary color variations
  static const Color primary2 = Color(0xFFE5EFFF);
  static const Color secondary50 = Color(0xFF34BCCB);

  // Red variations (status colors)
  // static const Color red0 = Color(0xFF312F2F);
  // static const Color red10 = Color(0xFF524545);
  static const Color red = Color(0xFFFF3B30);
  static const Color orange = Color(0xFFE5821E);

  // Other colors
  static const Color lightBlue = Color(0xFFe8ecfc);
  static const Color cyanAqua = Color(0xFFd6f4f8);
  static const Color cyanTeal = Color(0xFF24A6B4);
  static const Color yellow1 = Color(0xFFFFF7EE);
  static const Color yellow2 = Color(0xFFFFE4C9);
  static const Color yellow3 = Color(0xFFF8EAD6);
  static const Color yellow4 = Color(0xFFC07A25);
  static const Color secondaryborder = Color(0xFFCDCDCD);
  static const Color secondaryborder2 = Color(0xFFDADADA);
  static const Color orange20 = Color(0xFFF6D7AB);
}
