import '../../../../core/constants/asset_paths.dart';

enum ItemCategory { background, badge }

class UnlockableItem {
  final String id;
  final String name;
  final String description;
  final String assetPath;
  final ItemCategory category;
  final int unlockLevel; // 0 = Start
  final String? unlockQuestId; // Optional für später

  const UnlockableItem({
    required this.id,
    required this.name,
    required this.description,
    required this.assetPath,
    required this.category,
    this.unlockLevel = 0,
    this.unlockQuestId,
  });
}

class ItemCatalog {
  // Alle verfügbaren Hintergründe
  static const List<UnlockableItem> backgrounds = [
    UnlockableItem(
      id: 'bg_street_day',
      name: 'Street Park (Day)',
      description: 'Where every journey begins.',
      assetPath: AssetPaths.bgStreetParkDay,
      category: ItemCategory.background,
      unlockLevel: 0, // Start
    ),
    UnlockableItem(
      id: 'bg_street_night',
      name: 'Street Park (Night)',
      description: 'For those who grind while others sleep.',
      assetPath: AssetPaths.bgStreetParkNight,
      category: ItemCategory.background,
      unlockLevel: 5,
    ),
    UnlockableItem(
      id: 'bg_commercial',
      name: 'Commercial Gym',
      description: 'Clean equipment, AC, and mirrors everywhere.',
      assetPath: AssetPaths.bgCommercialGym,
      category: ItemCategory.background,
      unlockLevel: 10,
    ),
    UnlockableItem(
      id: 'bg_underground',
      name: 'Underground Dojo',
      description: 'No rules. Just heavy iron and concrete.',
      assetPath: AssetPaths.bgUndergroundGym,
      category: ItemCategory.background,
      unlockLevel: 20,
    ),
  ];

  static UnlockableItem getBackground(String id) {
    return backgrounds.firstWhere(
      (b) => b.id == id,
      orElse: () => backgrounds.first, // Fallback auf Start
    );
  }
}
