export interface AchievementUnlockedEvent {
  achievement: {
    id: AchievementId;
    name: string;
    description: string;
    icon: string;
    unlocked_at: string | null;
  };
}

export type AchievementId =
  // Token Milestones
  | "FirstSteps" // 1,000 tokens
  | "GrowingStrong" // 10,000 tokens
  | "BlossomingCoder" // 100,000 tokens
  | "TokenMaster" // 1,000,000 tokens
  | "TokenBillionaire" // 10,000,000 tokens
  | "TokenTreasure" // 50,000,000 tokens

  // Code Generation
  | "HelloWorld" // First code block
  | "CodeWizard" // 100 code blocks
  | "ThousandBlocks" // 1,000 code blocks
  | "CodeFactory" // 5,000 code blocks
  | "CodeEmpire" // 10,000 code blocks

  // File Operations
  | "FileManipulator" // 10 files edited
  | "FileArchitect" // 100 files edited
  | "FileEngineer" // 500 files edited
  | "FileLegend" // 1,000 files edited

  // Conversation milestones
  | "ConversationStarter" // 10 messages
  | "ChattyKathy" // 100 messages
  | "Conversationalist" // 1,000 messages
  | "ChatMarathon" // 5,000 messages
  | "ChatLegend" // 10,000 messages

  // Tool usage
  | "Toolsmith" // 5 different tools
  | "ToolMaster" // 10 different tools

  // Time-based achievements
  | "EarlyBird" // Started session 5-7 AM
  | "NightOwl" // Coding after midnight
  | "AllNighter" // Worked 2-5 AM
  | "WeekendWarrior" // Coding on weekend
  | "DedicatedDeveloper" // 30 days in a row

  // Search and exploration
  | "Explorer" // 50 searches
  | "MasterSearcher" // 500 searches

  // Session achievements
  | "QuickSession" // Productive session < 5 min
  | "FocusedWork" // 30 min session
  | "DeepDive" // 2 hour session
  | "MarathonSession" // 5+ hour session
  | "UltraMarathon" // 8 hour session
  | "CodingRetreat" // 12 hour session

  // Special achievements
  | "FirstMessage" // First message sent
  | "FirstTool" // First tool used
  | "FirstCodeBlock" // First code generated
  | "FirstFileEdit" // First file edit
  | "Polyglot" // 5+ languages in one session
  | "SpeedCoder" // 10 code blocks in 10 minutes
  | "ClaudeConnoisseur" // Used all Claude models
  | "MarathonCoder" // 10k tokens in one session

  // Relationship & Greetings
  | "GoodMorning" // Say "good morning"
  | "GoodNight" // Say "good night" or "goodnight"
  | "ThankYou" // Say "thank you" or "thanks"
  | "LoveYou" // Say "love you" or "ily"
  | "HelloHikari" // Say "hello hikari" or "hi hikari"
  | "HowAreYou" // Ask "how are you"
  | "MissedYou" // Say "missed you"
  | "BackAgain" // Say "i'm back" or "back again"

  // Personality & Fun
  | "EmojiUser" // Use an emoji in a message
  | "QuestionMaster" // Use "?" in 20 messages
  | "CapsLock" // Send a message in ALL CAPS
  | "PleaseAndThankYou" // Use "please" in messages

  // Emotional
  | "Frustrated" // Say "frustrated" or "ugh" or "argh"
  | "Excited" // Say "excited" or "yay" or "woohoo"
  | "Confused" // Say "confused" or "don't understand"
  | "Curious" // Ask "why" or "how does"
  | "Impressed" // Say "wow" or "amazing" or "incredible"

  // Git & Development
  | "GitGuru" // Use git commands 10 times
  | "TestWriter" // Create test files
  | "Debugger" // Fix bugs (messages with "fix", "bug", "error")
  | "CommitKing" // 50 commits
  | "CommitLegend" // 200 commits
  | "BranchMaster" // Create 10 branches
  | "MergeExpert" // Merge 20 PRs
  | "ConflictResolver" // Resolve merge conflicts

  // Tool Mastery
  | "BashMaster" // Use Bash tool 50 times
  | "FileExplorer" // Use Read tool 100 times
  | "SearchExpert" // Use Grep tool 50 times
  | "EditMaster" // Use Edit tool 100 times
  | "WriteMaster" // Use Write tool 50 times
  | "GlobMaster" // Use Glob tool 100 times
  | "TaskMaster" // Use Task tool 50 times
  | "WebFetcher" // Use WebFetch tool 20 times
  | "McpExplorer" // Use MCP tools 50 times

  // Daily Streaks
  | "WeekStreak" // 7 days in a row
  | "TwoWeekStreak" // 14 days in a row
  | "MonthStreak" // 30 days in a row
  | "QuarterStreak" // 90 days in a row

  // Time Challenges
  | "MorningPerson" // 10 sessions started before 9 AM
  | "NightCoder" // 10 sessions after 10 PM
  | "LunchBreakCoder" // Session during 12-1 PM
  | "CoffeeTime" // Session during 3-4 PM

  // Day-specific
  | "MondayMotivation" // Coding on Monday
  | "FridayFinisher" // Coding on Friday
  | "HumpDay" // Coding on Wednesday

  // Seasonal/Special Times
  | "NewYearCoder" // Coding on January 1st
  | "ValentinesDev" // Coding on February 14th
  | "SpookyCode" // Coding on October 31st
  | "HolidayCoder" // Coding on December 25th
  | "LeapDayCoder" // Coding on February 29th

  // Message Content
  | "LongMessage" // Send a message over 500 characters
  | "NovelWriter" // Send a message over 2000 characters
  | "ShortAndSweet" // Complete a task with messages under 50 chars each
  | "CodeInMessage" // Include code block in user message
  | "MarkdownMaster" // Use markdown formatting in message

  // Programming Languages
  | "RustDeveloper" // Generate Rust code
  | "PythonDeveloper" // Generate Python code
  | "JavaScriptDev" // Generate JavaScript code
  | "TypeScriptDev" // Generate TypeScript code
  | "GoDeveloper" // Generate Go code
  | "CppDeveloper" // Generate C++ code
  | "JavaDeveloper" // Generate Java code
  | "HtmlCssDev" // Generate HTML/CSS code
  | "SqlDeveloper" // Generate SQL code
  | "ShellScripter" // Generate shell/bash scripts
  | "FullStackDev" // Generate code in 10+ languages

  // Project Types
  | "FrontendDev" // Work on frontend files
  | "BackendDev" // Work on backend files
  | "ConfigEditor" // Edit config files
  | "DocWriter" // Edit documentation

  // Error Handling
  | "ErrorHunter" // Fix 10 errors
  | "ExceptionSlayer" // Fix 50 errors
  | "BugExterminator" // Fix 100 bugs

  // Refactoring
  | "CleanCoder" // Refactor code
  | "Optimizer" // Optimize performance
  | "Simplifier" // Simplify complex code

  // Testing
  | "TestNovice" // Write 10 tests
  | "TestEnthusiast" // Write 50 tests
  | "TestMaster" // Write 100 tests
  | "CoverageKing" // Achieve test coverage mentions

  // Documentation
  | "Documenter" // Write documentation
  | "CommentWriter" // Add comments to code
  | "ReadmeHero" // Create/edit README files

  // API & Integration
  | "ApiExplorer" // Work with APIs
  | "DatabaseDev" // Work with databases
  | "CloudCoder" // Work with cloud services

  // Special Milestones
  | "CenturyClub" // 100 sessions
  | "ThousandSessions" // 1000 sessions
  | "Veteran" // Used Hikari for 30+ days total
  | "OldTimer" // Used Hikari for 90+ days total
  | "Loyalist" // Used Hikari for 365+ days total

  // Fun & Easter Eggs
  | "Perfectionist" // Redo something 5 times
  | "Persistent" // Ask same question 3 times
  | "Patient" // Wait for long response
  | "Speedy" // Send 10 messages in 1 minute

  // UI Exploration
  | "MultiTasker" // Multiple conversations
  | "Minimalist" // Use compact mode
  | "PrivacyFirst" // Use streamer mode
  | "ThemeChanger" // Change themes
  | "SettingsTweaker" // Adjust settings

  // Achievement Meta
  | "AchievementHunter" // Unlock 25 achievements
  | "Completionist" // Unlock 50 achievements
  | "MasterUnlocker" // Unlock 100 achievements
  | "PlatinumStatus" // Unlock all achievements

  // Clipboard & Snippets
  | "ClipboardCollector" // Use clipboard history
  | "SnippetCreator" // Create a snippet
  | "SnippetMaster" // Create 20 snippets

  // Other Features
  | "QuickActionUser" // Use quick actions
  | "HistoryBuff" // Browse history
  | "Archivist" // Export sessions
  | "SessionExporter" // Export a session
  | "GitPanelUser" // Use Git panel
  | "FeatureExplorer"; // Use 10+ features

export interface Achievement {
  id: AchievementId;
  name: string;
  description: string;
  icon: string;
  rarity: "common" | "rare" | "epic" | "legendary";
  unlocked: boolean;
  unlockedAt?: Date;
  progress?: number;
  maxProgress?: number;
}

export interface AchievementCategory {
  name: string;
  description: string;
  achievements: Achievement[];
}
