// ===========================================================================
// FILE: lib/core/app_colors.dart
// ===========================================================================

import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';

enum AppThemeType { minimal, doodle, cyberpunk, wood, arcade, grimorio }

class ThemeColors {
  final Color background;
  final Color gridLine;
  final Color playerRed;
  final Color playerBlue;
  final Color text;

  const ThemeColors({
    required this.background,
    required this.gridLine,
    required this.playerRed,
    required this.playerBlue,
    required this.text,
  });
}

class AppColors {
  static const ThemeColors minimal = ThemeColors(
    background: Color(0xFFF5F7FA), gridLine: Color(0xFFCFD8DC),
    playerRed: Color(0xFFE53935), playerBlue: Color(0xFF1E88E5), text: Color(0xFF263238),
  );

  static const ThemeColors doodle = ThemeColors(
    background: Color(0xFFFFF9E6), gridLine: Color(0xFFB0BEC5),
    playerRed: Color(0xFFD32F2F), playerBlue: Color(0xFF1565C0), text: Color(0xFF37474F),
  );

  static const ThemeColors cyberpunk = ThemeColors(
    background: Color(0xFF0A001A), gridLine: Color(0xFF6200EA),
    playerRed: Color(0xFFFF007F), playerBlue: Color(0xFF69F0AE), text: Color(0xFFFFFFFF),
  );

  static const ThemeColors wood = ThemeColors(
    background: Color(0xFF905D3B), gridLine: Color(0xFF4A301E),
    playerRed: Color(0xFFE53935), playerBlue: Color(0xFF29B6F6), text: Color(0xFFFBE9E7),
  );

  static const ThemeColors arcade = ThemeColors(
    background: Color(0xFF111111), gridLine: Color(0xFF00FF00),
    playerRed: Color(0xFFFF004D), playerBlue: Color(0xFF00E5FF), text: Color(0xFFFFFFFF),
  );

  static const ThemeColors grimorio = ThemeColors(
    background: Color(0xFF1E112A), gridLine: Color(0xFF8D6E63),
    playerRed: Color(0xFFE91E63), playerBlue: Color(0xFF4FC3F7), text: Color(0xFFFFF3E0),
  );

  static ThemeColors getTheme(AppThemeType type) {
    switch (type) {
      case AppThemeType.minimal: return minimal;
      case AppThemeType.doodle: return doodle;
      case AppThemeType.cyberpunk: return cyberpunk;
      case AppThemeType.wood: return wood;
      case AppThemeType.arcade: return arcade;
      case AppThemeType.grimorio: return grimorio;
    }
  }
}

class ThemeIcons {
  static IconData gold(AppThemeType type) {
    switch (type) {
      case AppThemeType.minimal: return Icons.star_rounded;
      case AppThemeType.doodle: return FontAwesomeIcons.star;
      case AppThemeType.wood: return FontAwesomeIcons.gem;
      case AppThemeType.cyberpunk: return FontAwesomeIcons.microchip;
      case AppThemeType.arcade: return FontAwesomeIcons.coins;
      case AppThemeType.grimorio: return FontAwesomeIcons.crown;
    }
  }

  static IconData bomb(AppThemeType type) {
    switch (type) {
      case AppThemeType.minimal: return Icons.mood_bad_rounded;
      case AppThemeType.doodle: return FontAwesomeIcons.virus;
      case AppThemeType.wood: return FontAwesomeIcons.fire;
      case AppThemeType.cyberpunk: return FontAwesomeIcons.bug;
      case AppThemeType.arcade: return FontAwesomeIcons.ghost;
      case AppThemeType.grimorio: return FontAwesomeIcons.hatWizard;
    }
  }

  static IconData swap(AppThemeType type) {
    switch (type) {
      case AppThemeType.minimal: return Icons.sync_rounded;
      case AppThemeType.doodle: return FontAwesomeIcons.arrowsRotate;
      case AppThemeType.wood: return FontAwesomeIcons.rightLeft;
      case AppThemeType.cyberpunk: return FontAwesomeIcons.networkWired;
      case AppThemeType.arcade: return FontAwesomeIcons.shuffle;
      case AppThemeType.grimorio: return FontAwesomeIcons.hurricane;
    }
  }

  static IconData joker(AppThemeType type) {
    switch (type) {
      case AppThemeType.minimal: return Icons.sentiment_satisfied_alt;
      case AppThemeType.doodle: return FontAwesomeIcons.faceSmileBeam;
      case AppThemeType.wood: return FontAwesomeIcons.key;
      case AppThemeType.cyberpunk: return FontAwesomeIcons.robot;
      case AppThemeType.arcade: return FontAwesomeIcons.gamepad;
      case AppThemeType.grimorio: return FontAwesomeIcons.masksTheater;
    }
  }

  static IconData block(AppThemeType type) {
    switch (type) {
      case AppThemeType.minimal: return Icons.block;
      case AppThemeType.doodle: return FontAwesomeIcons.squareXmark;
      case AppThemeType.wood: return FontAwesomeIcons.ban;
      case AppThemeType.cyberpunk: return FontAwesomeIcons.shieldHalved;
      case AppThemeType.arcade: return FontAwesomeIcons.powerOff;
      case AppThemeType.grimorio: return FontAwesomeIcons.meteor;
    }
  }

  // --- NUOVE ICONE ---
  static IconData ice(AppThemeType type) {
    return FontAwesomeIcons.snowflake;
  }

  static IconData multiplier(AppThemeType type) {
    return FontAwesomeIcons.bolt;
  }
}