/**
 * Achievements Mock Data
 * 40+ achievements across 4 categories: Progress, Mastery, Social, Hidden
 */

import type { Achievement } from '../types/achievementsTypes';

// Progress Achievements (15 achievements)
export const progressAchievements: Achievement[] = [
  {
    id: 'progress-001',
    title: 'Primeros Pasos',
    description: 'Completa tu primer ejercicio y comienza tu viaje detectivesco',
    category: 'progress',
    rarity: 'common',
    icon: 'footprints',
    mlCoinsReward: 25,
    xpReward: 50,
    isUnlocked: true,
    unlockedAt: new Date('2025-01-15'),
  },
  {
    id: 'progress-002',
    title: 'Comenzando el Camino',
    description: 'Completa 5 ejercicios y demuestra tu dedicación',
    category: 'progress',
    rarity: 'common',
    icon: 'target',
    mlCoinsReward: 50,
    xpReward: 100,
    isUnlocked: true,
    unlockedAt: new Date('2025-01-16'),
    progress: {
      current: 5,
      required: 5,
    },
  },
  {
    id: 'progress-003',
    title: 'Estudiante Dedicado',
    description: 'Completa 25 ejercicios y consolida tu aprendizaje',
    category: 'progress',
    rarity: 'rare',
    icon: 'book-open',
    mlCoinsReward: 75,
    xpReward: 200,
    isUnlocked: false,
    progress: {
      current: 15,
      required: 25,
    },
  },
  {
    id: 'progress-004',
    title: 'Maestro Estudiante',
    description: 'Completa 100 ejercicios y alcanza la maestría',
    category: 'progress',
    rarity: 'epic',
    icon: 'graduation-cap',
    mlCoinsReward: 150,
    xpReward: 500,
    isUnlocked: false,
    progress: {
      current: 15,
      required: 100,
    },
  },
  {
    id: 'progress-005',
    title: 'Explorador de Módulos',
    description: 'Completa todos los ejercicios del Módulo 1',
    category: 'progress',
    rarity: 'rare',
    icon: 'compass',
    mlCoinsReward: 100,
    xpReward: 300,
    isUnlocked: false,
  },
  {
    id: 'progress-006',
    title: 'Viaje Completo',
    description: 'Completa todos los 5 módulos del programa',
    category: 'progress',
    rarity: 'legendary',
    icon: 'trophy',
    mlCoinsReward: 200,
    xpReward: 1000,
    isUnlocked: false,
    requirements: {
      exercisesCompleted: 100,
    },
  },
  {
    id: 'progress-007',
    title: 'Demonio de la Velocidad',
    description: 'Completa un ejercicio en menos de 2 minutos',
    category: 'progress',
    rarity: 'rare',
    icon: 'zap',
    mlCoinsReward: 50,
    xpReward: 150,
    isUnlocked: false,
  },
  {
    id: 'progress-008',
    title: 'Comienzo Perfecto',
    description: 'Obtén 100% en tu primer ejercicio',
    category: 'progress',
    rarity: 'rare',
    icon: 'star',
    mlCoinsReward: 75,
    xpReward: 200,
    isUnlocked: true,
    unlockedAt: new Date('2025-01-15'),
  },
  {
    id: 'progress-009',
    title: 'Rey de la Consistencia',
    description: 'Mantén una racha de 7 días consecutivos',
    category: 'progress',
    rarity: 'epic',
    icon: 'flame',
    mlCoinsReward: 100,
    xpReward: 300,
    isUnlocked: false,
    progress: {
      current: 3,
      required: 7,
    },
  },
  {
    id: 'progress-010',
    title: 'Corredor de Maratón',
    description: 'Mantén una racha de 30 días consecutivos',
    category: 'progress',
    rarity: 'legendary',
    icon: 'award',
    mlCoinsReward: 200,
    xpReward: 800,
    isUnlocked: false,
    progress: {
      current: 3,
      required: 30,
    },
  },
  {
    id: 'progress-011',
    title: 'Pájaro Madrugador',
    description: 'Estudia antes de las 9 AM',
    category: 'progress',
    rarity: 'common',
    icon: 'sunrise',
    mlCoinsReward: 30,
    xpReward: 100,
    isUnlocked: false,
  },
  {
    id: 'progress-012',
    title: 'Búho Nocturno',
    description: 'Estudia después de las 10 PM',
    category: 'progress',
    rarity: 'common',
    icon: 'moon',
    mlCoinsReward: 30,
    xpReward: 100,
    isUnlocked: false,
  },
  {
    id: 'progress-013',
    title: 'Guerrero de Fin de Semana',
    description: 'Estudia durante el fin de semana',
    category: 'progress',
    rarity: 'rare',
    icon: 'calendar',
    mlCoinsReward: 50,
    xpReward: 150,
    isUnlocked: true,
    unlockedAt: new Date('2025-01-13'),
  },
  {
    id: 'progress-014',
    title: 'Nivel 10',
    description: 'Alcanza el nivel 10 en tu progresión',
    category: 'progress',
    rarity: 'rare',
    icon: 'trending-up',
    mlCoinsReward: 75,
    xpReward: 250,
    isUnlocked: false,
    requirements: {
      level: 10,
    },
  },
  {
    id: 'progress-015',
    title: 'Nivel 50',
    description: 'Alcanza el nivel 50 y conviértete en leyenda',
    category: 'progress',
    rarity: 'legendary',
    icon: 'shield',
    mlCoinsReward: 200,
    xpReward: 1000,
    isUnlocked: false,
    requirements: {
      level: 50,
    },
  },
];

// Mastery Achievements (12 achievements)
export const masteryAchievements: Achievement[] = [
  {
    id: 'mastery-001',
    title: 'Puntuación Perfecta',
    description: 'Obtén 100% en cualquier ejercicio',
    category: 'mastery',
    rarity: 'common',
    icon: 'check-circle',
    mlCoinsReward: 40,
    xpReward: 100,
    isUnlocked: true,
    unlockedAt: new Date('2025-01-15'),
  },
  {
    id: 'mastery-002',
    title: 'Perfeccionista',
    description: 'Obtén 100% en 10 ejercicios diferentes',
    category: 'mastery',
    rarity: 'rare',
    icon: 'sparkles',
    mlCoinsReward: 100,
    xpReward: 300,
    isUnlocked: false,
    progress: {
      current: 3,
      required: 10,
    },
    requirements: {
      perfectScores: 10,
    },
  },
  {
    id: 'mastery-003',
    title: 'Detective Maestro',
    description: 'Obtén 100% en todos los ejercicios de Detective Textual',
    category: 'mastery',
    rarity: 'epic',
    icon: 'search',
    mlCoinsReward: 150,
    xpReward: 500,
    isUnlocked: false,
  },
  {
    id: 'mastery-004',
    title: 'Maestro de la Velocidad',
    description: 'Completa 10 ejercicios en menos de 3 minutos cada uno',
    category: 'mastery',
    rarity: 'epic',
    icon: 'timer',
    mlCoinsReward: 120,
    xpReward: 400,
    isUnlocked: false,
    progress: {
      current: 2,
      required: 10,
    },
  },
  {
    id: 'mastery-005',
    title: 'Maestro del Combo',
    description: 'Completa 10 ejercicios perfectos consecutivos',
    category: 'mastery',
    rarity: 'legendary',
    icon: 'link',
    mlCoinsReward: 200,
    xpReward: 800,
    isUnlocked: false,
    progress: {
      current: 0,
      required: 10,
    },
  },
  {
    id: 'mastery-006',
    title: 'Sin Errores',
    description: 'Completa 5 ejercicios sin cometer ningún error',
    category: 'mastery',
    rarity: 'rare',
    icon: 'check',
    mlCoinsReward: 80,
    xpReward: 250,
    isUnlocked: false,
    progress: {
      current: 1,
      required: 5,
    },
  },
  {
    id: 'mastery-007',
    title: 'Triple Corona',
    description: 'Llega al top 3 en 3 tablas de clasificación diferentes',
    category: 'mastery',
    rarity: 'legendary',
    icon: 'crown',
    mlCoinsReward: 200,
    xpReward: 1000,
    isUnlocked: false,
    progress: {
      current: 0,
      required: 3,
    },
  },
  {
    id: 'mastery-008',
    title: 'Modo Einstein',
    description: 'Completa el ejercicio más difícil sin usar pistas',
    category: 'mastery',
    rarity: 'legendary',
    icon: 'brain',
    mlCoinsReward: 200,
    xpReward: 900,
    isUnlocked: false,
  },
  {
    id: 'mastery-009',
    title: 'Un Solo Intento',
    description: 'Completa un ejercicio en el primer intento sin reintentos',
    category: 'mastery',
    rarity: 'rare',
    icon: 'target',
    mlCoinsReward: 70,
    xpReward: 200,
    isUnlocked: false,
  },
  {
    id: 'mastery-010',
    title: 'Todoterreno',
    description: 'Completa al menos 1 ejercicio de cada módulo',
    category: 'mastery',
    rarity: 'epic',
    icon: 'layers',
    mlCoinsReward: 120,
    xpReward: 400,
    isUnlocked: false,
  },
  {
    id: 'mastery-011',
    title: 'Especialista',
    description: 'Domina un tipo específico de mecánica (10 ejercicios perfectos)',
    category: 'mastery',
    rarity: 'epic',
    icon: 'focus',
    mlCoinsReward: 130,
    xpReward: 450,
    isUnlocked: false,
  },
  {
    id: 'mastery-012',
    title: 'Gran Maestro',
    description: 'Desbloquea todos los logros de una categoría',
    category: 'mastery',
    rarity: 'legendary',
    icon: 'award',
    mlCoinsReward: 200,
    xpReward: 1000,
    isUnlocked: false,
  },
];

// Social Achievements (8 achievements)
export const socialAchievements: Achievement[] = [
  {
    id: 'social-001',
    title: 'Mariposa Social',
    description: 'Añade 5 amigos a tu lista',
    category: 'social',
    rarity: 'common',
    icon: 'user-plus',
    mlCoinsReward: 50,
    xpReward: 100,
    isUnlocked: false,
    progress: {
      current: 2,
      required: 5,
    },
    requirements: {
      friendsCount: 5,
    },
  },
  {
    id: 'social-002',
    title: 'Jugador de Equipo',
    description: 'Únete a un gremio',
    category: 'social',
    rarity: 'common',
    icon: 'users',
    mlCoinsReward: 40,
    xpReward: 80,
    isUnlocked: false,
    requirements: {
      guildMembership: true,
    },
  },
  {
    id: 'social-003',
    title: 'Líder del Gremio',
    description: 'Crea tu propio gremio',
    category: 'social',
    rarity: 'rare',
    icon: 'flag',
    mlCoinsReward: 100,
    xpReward: 300,
    isUnlocked: false,
  },
  {
    id: 'social-004',
    title: 'Ayudante',
    description: 'Ayuda a 10 amigos con sus ejercicios',
    category: 'social',
    rarity: 'rare',
    icon: 'heart-handshake',
    mlCoinsReward: 80,
    xpReward: 250,
    isUnlocked: false,
    progress: {
      current: 3,
      required: 10,
    },
  },
  {
    id: 'social-005',
    title: 'Popular',
    description: 'Ten 25 amigos en tu lista',
    category: 'social',
    rarity: 'epic',
    icon: 'users-round',
    mlCoinsReward: 120,
    xpReward: 400,
    isUnlocked: false,
    requirements: {
      friendsCount: 25,
    },
  },
  {
    id: 'social-006',
    title: 'Influencer',
    description: 'Recibe 100 elogios en tus logros',
    category: 'social',
    rarity: 'epic',
    icon: 'thumbs-up',
    mlCoinsReward: 150,
    xpReward: 500,
    isUnlocked: false,
    progress: {
      current: 12,
      required: 100,
    },
  },
  {
    id: 'social-007',
    title: 'Colaborador',
    description: 'Completa 5 desafíos en equipo',
    category: 'social',
    rarity: 'rare',
    icon: 'handshake',
    mlCoinsReward: 90,
    xpReward: 300,
    isUnlocked: false,
    progress: {
      current: 1,
      required: 5,
    },
  },
  {
    id: 'social-008',
    title: 'Mentor',
    description: 'Mentoriza a 3 estudiantes',
    category: 'social',
    rarity: 'epic',
    icon: 'graduation-cap',
    mlCoinsReward: 140,
    xpReward: 450,
    isUnlocked: false,
    progress: {
      current: 0,
      required: 3,
    },
  },
];

// Hidden Achievements (5 achievements)
export const hiddenAchievements: Achievement[] = [
  {
    id: 'hidden-001',
    title: 'Cazador de Huevos de Pascua',
    description: 'Encuentra el dato oculto sobre Marie Curie',
    category: 'hidden',
    rarity: 'legendary',
    icon: 'egg',
    mlCoinsReward: 200,
    xpReward: 800,
    isUnlocked: false,
    isHidden: true,
  },
  {
    id: 'hidden-002',
    title: 'Viajero del Tiempo',
    description: 'Estudia a medianoche en el cumpleaños de Marie Curie',
    category: 'hidden',
    rarity: 'legendary',
    icon: 'clock',
    mlCoinsReward: 200,
    xpReward: 900,
    isUnlocked: false,
    isHidden: true,
  },
  {
    id: 'hidden-003',
    title: 'Sociedad Secreta',
    description: 'Desbloquea una combinación especial de insignias',
    category: 'hidden',
    rarity: 'legendary',
    icon: 'key',
    mlCoinsReward: 200,
    xpReward: 850,
    isUnlocked: false,
    isHidden: true,
  },
  {
    id: 'hidden-004',
    title: 'Rompe Códigos',
    description: 'Resuelve el rompecabezas oculto en la interfaz',
    category: 'hidden',
    rarity: 'legendary',
    icon: 'puzzle',
    mlCoinsReward: 200,
    xpReward: 900,
    isUnlocked: false,
    isHidden: true,
  },
  {
    id: 'hidden-005',
    title: 'Detective de Platino',
    description: 'Alcanza el nivel de prestigio 5',
    category: 'hidden',
    rarity: 'legendary',
    icon: 'gem',
    mlCoinsReward: 200,
    xpReward: 1000,
    isUnlocked: false,
    isHidden: true,
    requirements: {
      level: 50,
      rank: "K'uk'ulkan",
    },
  },
];

// Export all achievements
export const allAchievements: Achievement[] = [
  ...progressAchievements,
  ...masteryAchievements,
  ...socialAchievements,
  ...hiddenAchievements,
];

// Helper function to get achievements by category
export const getAchievementsByCategory = (category: string): Achievement[] => {
  return allAchievements.filter((achievement) => achievement.category === category);
};

// Helper function to get unlocked achievements
export const getUnlockedAchievements = (): Achievement[] => {
  return allAchievements.filter((achievement) => achievement.isUnlocked);
};

// Helper function to get achievements by rarity
export const getAchievementsByRarity = (rarity: string): Achievement[] => {
  return allAchievements.filter((achievement) => achievement.rarity === rarity);
};
