-- ============================================================================
-- HDG Localization - enUS (Base)
-- ============================================================================
-- Bootstrap file: creates the L table, defines all English keys, attaches
-- accessor methods, and exports as _G.HDG_L. Override locale files register
-- into _G.HDG_Locales[code] and are applied via L:ApplyOverride().
-- ============================================================================

local addonName, privateDB = ...

-- Override locale registry (populated by HDG_Locale_*.lua files)
_G.HDG_Locales = {}

-- Create the active localization table
local L = {}

-- ============================================================================
-- ENGLISH (Default/Fallback)
-- ============================================================================
--
-- LAYOUT POLICY: Short labels that live in fixed-width contexts (column
-- headers, compact buttons) stay English in ALL locales. Translated strings
-- that are longer than the English can break column alignment and overflow
-- buttons. Only translate strings that have room to grow: panel headers,
-- status messages, tooltips, and full-line text.
--
-- Keys marked "-- ENGLISH ONLY" below must NOT appear in override files.
-- If they do, the English value is used anyway (override files should
-- simply omit them so they fall through to the base).
-- ============================================================================

-- Tab Names
L["TAB_RECIPES"] = "Recipes"
L["TAB_ACQUIRE"] = "Acquire"
L["TAB_GOBLIN"] = "Goblin"
L["TAB_PREVIEW"] = "Preview"
L["TAB_TRAINERS"] = "Trainers"
L["TAB_ALTS"] = "Alts"
L["TAB_STYLES"] = "Style"
L["TAB_DATA"] = "Data"
L["TAB_CONFIG"] = "Config"

-- Panel Headers
L["HEADER_CRAFTING_QUEUE"] = "Crafting Queue"
L["HEADER_SHOPPING_LIST"] = "Shopping List"
L["HEADER_MATERIALS"] = "Materials"
L["HEADER_REQUIRED_MATERIALS"] = "Required Materials"
L["HEADER_RAW_MATERIALS"] = "Raw Materials"
L["HEADER_DIRECT_MATERIALS"] = "Direct Materials"
L["HEADER_LUMBER"] = "Lumber"
L["HEADER_TRACKED_REAGENTS"] = "Tracked Reagents"
L["HEADER_CRAFTING_HISTORY"] = "Decor Crafting / Acquisition History"
L["HEADER_FARMING_HISTORY"] = "Farming History"
L["HEADER_ACCOUNT_SUMMARY"] = "Account Summary"
L["HEADER_PROFIT_ANALYSIS"] = "Profit Analysis"

-- Column Headers -- ENGLISH ONLY (fixed-width table cells)
L["COL_TYPE"] = "Type"
L["COL_NEEDED"] = "Needed"
L["COL_IN_STOCK"] = "In Stock"
L["COL_ALL"] = "All"
L["COL_TIME"] = "Time"
L["COL_ITEM"] = "Item"
L["COL_COST"] = "Cost"
L["COL_SOURCE"] = "Source"
L["COL_CHARACTER"] = "Character"
L["COL_COLLECTED"] = "Collected"
L["COL_RATE"] = "Rate"
L["COL_DURATION"] = "Duration"
L["COL_ZONE"] = "Zone"
L["COL_SELL_PRICE"] = "Sell"
L["COL_MAT_COST"] = "Mat Cost"
L["COL_PROFIT"] = "Profit"
L["COL_MARGIN"] = "Margin"
L["COL_LUMBER_VALUE"] = "$/Lum"
L["COL_TOTAL_LUMBER"] = "Lum Total"
L["COL_SALE_RATE"] = "Sale Rate"
L["COL_MARKET_VALUE"] = "Market"
L["COL_AH_QTY"] = "# AH"

-- Buttons -- short labels ENGLISH ONLY; longer labels safe to translate
L["BTN_CLEAR"] = "Clear"       -- ENGLISH ONLY
L["BTN_CLOSE"] = "Close"       -- ENGLISH ONLY
L["BTN_EXPORT"] = "Export"     -- ENGLISH ONLY
L["BTN_REFRESH"] = "Refresh"   -- ENGLISH ONLY
L["BTN_ALL"] = "All"           -- ENGLISH ONLY
L["BTN_READY"] = "Ready"       -- ENGLISH ONLY
L["BTN_DIRECT"] = "Direct"     -- ENGLISH ONLY
L["BTN_RAW"] = "Raw"           -- ENGLISH ONLY
L["BTN_FILTER_DECOR"] = "Filter Decor"
L["BTN_DECOR_GUIDE"] = "Decor Guide"
L["BTN_END_SESSION"] = "End Session"
L["BTN_STOP_TRACKING"] = "Stop Tracking"
L["BTN_SCAN_AH"] = "Scan AH"
L["BTN_ADD_TO_AUCTIONATOR"] = "Add to Auctionator"
L["BTN_ADD_ALL_AUCTIONATOR"] = "Add All to Auctionator"
L["BTN_ADD_ALL_AUCTIONATOR_RAW"] = "Add All to Auctionator (Raw Mats)"
L["BTN_ADD_TO_TSM"] = "Add to TSM Shopping"
L["BTN_MY_COLLECTION"] = "My Collection"

-- Checkboxes / Toggles
L["CHECK_UNCOLLECTED_ONLY"] = "Uncollected"
L["CHECK_INCLUDE_MATS"] = "+Mats"  -- ENGLISH ONLY
L["CHECK_ONLY_KNOWN"] = "My Recipes"
L["CHECK_KNOWN_BY_ALTS"] = "All Known Recipes"
L["CHECK_SHOW_PROFESSION_BUTTONS"] = "Show Profession Window Buttons"
L["CHECK_SHOW_MINIMAP_BUTTON"] = "Show Minimap Button"
L["CHECK_SHOW_IN_COMPARTMENT"] = "Show in Addon Compartment"
L["HINT_MINIMAP_BUTTON"] = "(Draggable icon around the minimap)"
L["HINT_COMPARTMENT"] = "(Minimap drawer menu - requires /reload)"
L["HINT_COMPARTMENT_UNAVAILABLE"] = "(Not available - requires WoW 10.0+)"

-- Locale Override
L["LOCALE_OVERRIDE"] = "Language Override"
L["LOCALE_AUTO"] = "Auto (Client)"
L["LOCALE_HINT"] = "Requires /reload to apply"
L["LOCALE_NOTE"] = "Note: Only affects addon UI text. Recipe and item names match your client's locale."
L["TRANSLATE_NOTE"] = "Share feedback, bugs, and translations on Discord."

-- Filter Labels
L["FILTER_PROFESSION"] = "Profession"
L["FILTER_EXPANSION"] = "Expansion"
L["FILTER_ALL_PROFESSIONS"] = "All Professions"
L["FILTER_ALL_EXPANSIONS"] = "All Expansions"
L["FILTER_TAGS"] = "Tags"
L["FILTER_CATEGORY"] = "Filter"

-- Preview Tab Categories
L["CAT_ALL"] = "All"
L["CAT_CRAFTED"] = "Crafted"
L["CAT_SIZES"] = "Sizes"
L["CAT_FACTIONS"] = "Factions"
L["CAT_STYLES"] = "Styles"
L["CAT_EXPANSIONS"] = "Expansions"
L["CAT_OTHER"] = "Other"

-- Status Messages
L["STATUS_LOADING"] = "Loading..."
L["STATUS_NO_DATA"] = "No data available"
L["STATUS_NO_RECIPES"] = "No recipes found"
L["STATUS_NO_HISTORY"] = "No crafting/acquisition history yet."
L["STATUS_NO_FARMING_HISTORY"] = "No farming sessions recorded yet."
L["STATUS_NO_CHARACTER_DATA"] = "No character data yet. Open a profession window to scan skill levels."
L["STATUS_ALL_LUMBER_COLLECTED"] = "All lumber collected!"
L["STATUS_NO_MATERIALS_QUEUED"] = "No materials in crafting queue"
L["STATUS_HAVE_ALL_MATERIALS"] = "Have all materials!"
L["STATUS_INSTALL_PRICE_ADDON"] = "Install TSM/Auctionator for prices"

-- Tab Tooltip Descriptions
L["TIP_TAB_RECIPES"] = "View all housing decor recipes"
L["TIP_TAB_ACQUIRE"] = "Vendor shopping guide - find where to buy decorations"
L["TIP_TAB_GOBLIN"] = "Profit analysis - find the most profitable crafts"
L["TIP_TAB_PREVIEW"] = "Preview decorations"
L["TIP_TAB_TRAINERS"] = "Find recipe trainers"
L["TIP_TAB_ALTS"] = "View profession data across all characters"
L["TIP_TAB_DATA"] = "View farming history and statistics"
L["TIP_TAB_CONFIG"] = "Configure addon settings and minimap icon"

-- Tooltips
L["TIP_CLICK_TO_PREVIEW"] = "Click to preview"
L["TIP_CLICK_HEADERS_TO_SORT"] = "Click headers to sort"
L["TIP_CTRL_CLICK_ADD_QUEUE"] = "Ctrl-click to add to queue"
L["TIP_SHIFT_CLICK_SEARCH_AH"] = "Shift-click to search AH"
L["TIP_RIGHT_CLICK_OPTIONS"] = "Right-click for options"
L["TIP_DRAG_TO_MOVE"] = "Drag to move"
L["TIP_CLOSE_MAIN_WINDOW"] = "Close Main Window"
L["TIP_OPEN_MAIN_WINDOW"] = "Open Main Window"
L["TIP_SHOW_MATERIALS"] = "Show Materials"
L["TIP_HIDE_MATERIALS"] = "Hide Materials"
L["TIP_MATERIALS_UNAVAILABLE"] = "Materials Unavailable"
L["TIP_END_FARMING_SESSION"] = "End Farming Session"
L["TIP_ENDS_SESSION_TRACKING"] = "Ends the current farming session tracking"
L["TIP_SELECT_ALL_COPY"] = "Select all (Ctrl+A) then copy (Ctrl+C)"

-- Export
L["EXPORT_CRAFTING_TITLE"] = "Export Crafting History"
L["EXPORT_FARMING_TITLE"] = "Export Farming History"

-- Crafting Queue
L["QUEUE_NOT_KNOWN"] = "Not Known"
L["QUEUE_YOU"] = "(you)"
L["QUEUE_NEEDS_TRAINING"] = "Not Learned"
L["QUEUE_KNOWN_BY"] = "Known by"

-- Farming Tracker
L["FARM_SESSION_ENDED"] = "farming session ended"
L["FARM_COLLECTED"] = "collected"
L["FARM_THIS_SESSION"] = "this session"
L["FARM_FIRST_TO_LAST"] = "(first to last)"

-- Materials
L["MAT_GATHERED"] = "Gathered"
L["MAT_CRAFTED"] = "Crafted"
L["MAT_VENDOR"] = "Vendor"
L["MAT_DROPPED"] = "Dropped"
L["MAT_SPECIAL"] = "Special"

-- Material Source Categories
L["MAT_FROM_VENDOR"] = "From Vendor"
L["MAT_FROM_GATHERING"] = "From Gathering / AH"
L["MAT_FROM_CRAFTING"] = "From Crafting / AH"

-- Acquisition Sources
L["SOURCE_CRAFTED"] = "Crafted"
L["SOURCE_LEARNED"] = "Learned"

-- Collection Status
L["STATUS_COLLECTED"] = "Collected"
L["STATUS_COLLECTION"] = "All Decor"
L["STATUS_UNCOLLECTED"] = "Unknown"
L["STATUS_NOT_COLLECTED"] = "Not Collected"
L["TIP_MY_COLLECTION"] = "My Collection"
L["TIP_SHOW_ALL_DECOR"] = "Show ALL housing decor items from the catalog"
L["TIP_NOT_JUST_CRAFTABLE"] = "(not just craftable recipes)."
L["TIP_UNCOLLECTED_ONLY"] = "Uncollected Only"
L["TIP_HIDE_COLLECTED"] = "Hide items you've already collected"

-- Skill Thresholds Legend
L["LEGEND_CAN_LEARN"] = "Can learn decor recipes"
L["LEGEND_BELOW_THRESHOLD"] = "Below threshold"
L["LEGEND_NO_DECOR_RECIPES"] = "No decor recipes"

-- Profession Window
L["PROF_NOT_LEARNED"] = "Not Learned"

-- Profession Names (for filters)
L["PROF_ALL"] = "All"
L["PROF_ALCHEMY"] = "Alchemy"
L["PROF_BLACKSMITHING"] = "Blacksmithing"
L["PROF_COOKING"] = "Cooking"
L["PROF_ENCHANTING"] = "Enchanting"
L["PROF_ENGINEERING"] = "Engineering"
L["PROF_INSCRIPTION"] = "Inscription"
L["PROF_JEWELCRAFTING"] = "Jewelcrafting"
L["PROF_LEATHERWORKING"] = "Leatherworking"
L["PROF_TAILORING"] = "Tailoring"
L["PROF_HERBALISM"] = "Herbalism"
L["PROF_MINING"] = "Mining"
L["PROF_SKINNING"] = "Skinning"
L["PROF_FISHING"] = "Fishing"

-- Misc
L["MISC_UNKNOWN"] = "Unknown"
L["MISC_ITEMS"] = "items"
L["MISC_PER_HOUR"] = "/hr"          -- ENGLISH ONLY
L["MISC_ESTIMATED"] = "Est:"         -- ENGLISH ONLY
L["MISC_EXPANSION"] = "Expansion"
L["MISC_IN_BAGS_BANK"] = "In Bags/Bank"
L["MISC_TOTAL_NEEDED"] = "Total Needed"
L["MISC_NEED_MORE"] = "Need %s more"
L["MISC_HAVE_ENOUGH"] = "Have enough"
L["MISC_LUMBER_MUST_BE_FARMED"] = "Lumber must be farmed"
L["MISC_NOT_NEEDED_FOR_QUEUE"] = "Not needed for crafting queue"
L["MISC_ALL_RECIPES_COLLECTED"] = "All recipes using this collected"

-- ============================================================================
-- Acquisition Tab
-- ============================================================================
L["ACQ_TITLE"] = "Acquisition Guide"
L["ACQ_HOW_TO_USE"] = " How to Use"
L["ACQ_HIDE_UNRELEASED"] = "Hide Unreleased"
L["ACQ_EXPORT_NOTES"] = "Export Notes"
L["ACQ_BY_VENDOR"] = "By Vendor"
L["ACQ_BY_ITEM"] = "By Item"
L["ACQ_CLEAR_PINS"] = "Clear Pins"       -- ENGLISH ONLY
L["ACQ_MAP_ALL"] = "Map All"             -- ENGLISH ONLY
L["ACQ_RESET"] = "Reset"                 -- ENGLISH ONLY
L["ACQ_NAVIGATE"] = "Navigate"           -- ENGLISH ONLY
L["ACQ_SHOW_ON_MAP"] = "Show on Map"
L["ACQ_ADD_TO_QUEUE"] = "Add to Crafting Queue"
L["ACQ_EXPORT_TITLE"] = "Export User Notes"
L["ACQ_PINS_CLEARED"] = "All waypoints and map pins cleared."
L["ACQ_NO_VENDORS_TO_MAP"] = "No valid vendor locations to map."
L["ACQ_NO_COORDS"] = "No valid coordinates for this vendor."
L["ACQ_COMBAT_MAP_ERROR"] = "Cannot open map during combat."
L["ACQ_MAP_PIN_ERROR"] = "Could not set map pin for this zone."
L["ACQ_STATUS_VENDORS"] = "Showing %d vendors (%d items)"
L["ACQ_STATUS_ITEMS"] = "Showing %d items (%d uncollected)"

-- ============================================================================
-- Styles Tab
-- ============================================================================
L["STYLE_BROWSE_HEADER"] = "Browse by Style"
L["STYLE_BETA"] = "(Beta - in development)"
L["STYLE_CREATOR"] = "+ Style Creator"
L["STYLE_NEW"] = "+ New Style"
L["STYLE_NEW_DESC"] = "Click to create a custom style with your own facet tags"
L["STYLE_BACK"] = "< Back"               -- ENGLISH ONLY
L["STYLE_CREATOR_TITLE"] = "Style Creator"
L["STYLE_NAME_LABEL"] = "Name:"          -- ENGLISH ONLY
L["STYLE_DESC_LABEL"] = "Desc:"          -- ENGLISH ONLY
L["STYLE_CLEAR_ALL"] = "Clear All"       -- ENGLISH ONLY
L["STYLE_SAVE"] = "Save"                 -- ENGLISH ONLY
L["STYLE_CANCEL"] = "Cancel"             -- ENGLISH ONLY
L["STYLE_DELETE"] = "Delete"             -- ENGLISH ONLY
L["STYLE_IMPORT"] = "Import"             -- ENGLISH ONLY
L["STYLE_EXPORT_TITLE"] = "Export Style"
L["STYLE_IMPORT_PROMPT"] = "Paste an HDG style string to import:"
L["STYLE_CONFIRM_DELETE"] = "Delete custom style \"%s\"?"
L["STYLE_TIER_SIGNATURE"] = "Signature"
L["STYLE_TIER_ACCENT"] = "Accent"
L["STYLE_TIER_VERSATILE"] = "Versatile"
L["STYLE_TIER_CLASHING"] = "Clashing"
L["STYLE_BASKET"] = "BASKET (%d)"
L["STYLE_UNDO"] = "Undo"                 -- ENGLISH ONLY
L["STYLE_MSG_IMPORT_FAILED"] = "Import failed: %s"
L["STYLE_MSG_IMPORTED"] = "Imported style: %s"
L["STYLE_MSG_SAVED"] = "Saved custom style: %s"
L["STYLE_ERR_NAME_EMPTY"] = "Style name cannot be empty."
L["STYLE_ERR_NO_TAGS"] = "Need at least one tag selected."
L["STYLE_ERR_MAX_REACHED"] = "Maximum %d custom styles reached."
L["STYLE_ERR_NO_CURATED_ITEMS"] = "Add at least one item to your curated style."
L["STYLE_MODE_SMART"] = "Smart"
L["STYLE_MODE_CURATED"] = "Curated"
L["STYLE_ADD_ALL"] = "Add All"
L["STYLE_SEARCH_PLACEHOLDER"] = "Search items..."

-- ============================================================================
-- Recipes Tab
-- ============================================================================
L["RECIPE_PROFESSIONS"] = "Professions"
L["RECIPE_EST_COST"] = "Est. Cost:"
L["RECIPE_CRAFT_CONFIRM"] = "Craft Confirmation"
L["RECIPE_CRAFT_ONE"] = "Craft 1"        -- ENGLISH ONLY
L["RECIPE_CRAFT_N"] = "Craft %d"
L["RECIPE_CRAFT_QUESTION"] = "Craft this item?"
L["RECIPE_KEEP_PROF_OPEN"] = "Keep profession window open after craft"
L["RECIPE_SEARCH"] = "Search recipes..."
L["RECIPE_TIER_READY"] = "Ready to Craft"
L["RECIPE_TIER_ALMOST"] = "Have Most Materials (75-99%%)"
L["RECIPE_TIER_HALFWAY"] = "Halfway There (50-74%%)"
L["RECIPE_TIER_NEED_MATS"] = "Need Materials (<50%%)"
L["RECIPE_MSG_CRAFTING"] = "[HDG] Crafting %dx %s..."
L["RECIPE_MSG_CRAFT_FAILED"] = "[HDG] CraftRecipe failed: %s"
L["RECIPE_MSG_INVALID"] = "[HDG] Invalid recipe data."
L["RECIPE_MSG_NO_API"] = "[HDG] C_TradeSkillUI not available."
L["RECIPE_MSG_PROF_NOT_READY"] = "[HDG] Profession window not ready. Please try again."

-- ============================================================================
-- Config Tab
-- ============================================================================
L["CONFIG_TITLE"] = "Configuration"
L["CONFIG_APPEARANCE"] = "Appearance"
L["CONFIG_INTERFACE"] = "Interface"
L["CONFIG_LUMBER_RADAR"] = "Lumber Radar"
L["CONFIG_QUOTES"] = "Farming & Crafting Quotes"
L["CONFIG_COMMUNITY"] = "Community"
L["CONFIG_HOW_TO_USE"] = "How to Use"
L["CONFIG_ADVANCED"] = "Advanced"
L["CONFIG_SPECIAL_THANKS"] = "Special Thanks"
L["CONFIG_LANGUAGE"] = "Language"

-- Config: Interface card
L["CFG_SHOW_MINIMAP"] = "Show Minimap Button"
L["CFG_HINT_MINIMAP"] = "(Draggable icon around the minimap)"
L["CFG_SHOW_COMPARTMENT"] = "Show in Addon Compartment"
L["CFG_HINT_COMPARTMENT"] = "(Minimap drawer menu - requires /reload)"
L["CFG_SHOW_PROF_BUTTONS"] = "Show Profession Window Buttons"
L["CFG_HINT_PROF_BUTTONS"] = "(Decor Guide & Filter Decor buttons)"
L["CFG_PIN_LUMBER"] = "Pin Lumber Tracker"
L["CFG_HINT_PIN_LUMBER"] = "(Floating widget - also via pin button)"
L["CFG_COMPARTMENT_CHANGED"] = "Addon compartment setting changed. Use /reload to apply."

-- Config: Lumber Radar card
L["CFG_AUTO_LUMBER_TRACKER"] = "Auto-Enable Lumber Tracker"
L["CFG_HINT_AUTO_LUMBER"] = "(Auto-show tracker when collecting lumber)"
L["CFG_AUTO_LUMBER_RADAR"] = "Auto-Show Lumber Radar"
L["CFG_HINT_AUTO_RADAR"] = "(/lumberhud to toggle manually)"
L["CFG_HINT_RADAR_SCALE"] = "(0.5x to 2.5x - resize the radar)"
L["CFG_HINT_RADAR_FPS"] = "(10-30 fps - smoothness vs CPU)"
L["CFG_PIN_RADAR"] = "Pin Radar to Tracker"
L["CFG_HINT_PIN_RADAR"] = "(Radar follows lumber tracker)"

-- Config: Quotes card
L["CFG_ENABLE_QUOTES"] = "Enable Quotes"
L["CFG_HINT_QUOTES"] = "(Talking head popups and chat messages while farming/crafting)"
L["CFG_QUOTES_CHAT_ONLY"] = "Only print quotes to chat"
L["CFG_HINT_CHAT_ONLY"] = "(No talking head display)"
L["CFG_LUMBER_QUOTES"] = "Lumber Quotes"
L["CFG_HINT_LUMBER_QUOTES"] = "(Vamoose, Squirrel, Gazlowe while lumber farming)"
L["CFG_HINT_CHATTINESS"] = "(0=Off, or quote after 1 to N lumber)"
L["CFG_CRAFT_QUOTES"] = "Craft Quotes"
L["CFG_HINT_CRAFT_QUOTES"] = "(When crafting/acquiring decor)"

-- Config: Advanced card
L["CFG_ENABLE_DEBUG"] = "Enable Debug Mode"
L["CFG_HINT_DEBUG"] = "(Enables /hdgdebug slash commands for troubleshooting)"
L["CFG_DEBUG_ENABLED"] = "Debug mode enabled - /hdgdebug commands now available"
L["CFG_DEBUG_DISABLED"] = "Debug mode disabled"

-- Config: Waypoints
L["CFG_WAYPOINT_AUTO"] = "Auto"
L["CFG_WAYPOINT_NATIVE"] = "Blizzard Native"
L["CFG_WAYPOINT_TOMTOM"] = "TomTom Only"

-- ============================================================================
-- Goblin Tab
-- ============================================================================
L["GOBLIN_EXPORT_TITLE"] = "Goblin Export (%d items)"
L["GOBLIN_NO_DATA_EXPORT"] = "No data to export. Adjust filters or scan prices first."
L["GOBLIN_ADDED_TO_QUEUE"] = "Added %s to crafting queue"
L["GOBLIN_OPEN_AH_TO_SEARCH"] = "Open the Auction House to search"
L["GOBLIN_CANNOT_SCAN"] = "Cannot scan: %s"
L["GOBLIN_SCANNING"] = "Scanning..."
L["GOBLIN_UPDATED"] = "Updated!"
L["GOBLIN_NO_AH_DATA"] = "No AH data"
L["GOBLIN_NO_PRICE_ADDON"] = "No price addon"
L["GOBLIN_SEARCH"] = "Search..."
L["GOBLIN_ITEMS_COUNT"] = "%d items"
L["GOBLIN_FILTERED_COUNT"] = "%d / %d items"
L["GOBLIN_KNOWN_BY_ALTS"] = "All Known Recipes"

-- ============================================================================
-- Alts Tab
-- ============================================================================
L["ALTS_PANEL_TITLE"] = "Your Characters"
L["ALTS_VIEW_RECIPES"] = "Recipes"
L["ALTS_VIEW_SKILLS"] = "Skills"
L["ALTS_HEADER_CHAR_DETAILS"] = "Character Details"
L["ALTS_NO_PROFESSIONS"] = "No Professions / Not Scanned"
L["ALTS_CURRENT"] = " (current)"
L["ALTS_LUMBER_KNOWN"] = "Find Lumber known"
L["ALTS_LUMBER_NOT_LEARNED"] = "Find Lumber not learned"
L["ALTS_LOG_IN"] = "Log in to check"
L["ALTS_SCAN_INSTRUCTIONS"] = "Open a profession window on each character to scan their skill levels."

-- ============================================================================
-- Data Tab
-- ============================================================================
L["DATA_CRAFTING_CLEARED"] = "Crafting history cleared."
L["DATA_NO_CRAFTING_EXPORT"] = "No crafting history to export."
L["DATA_FARMING_CLEARED"] = "Farming history cleared."
L["DATA_NO_FARMING_DELETE"] = "No farming sessions to delete."
L["DATA_DELETED_SESSION"] = "Deleted most recent session: "
L["DATA_NO_FARMING_EXPORT"] = "No farming history to export."
L["DATA_NO_COLLECTION_EXPORT"] = "No collection data to export. Click Refresh first."
L["DATA_EXPORTED_CRAFTING"] = "Exported %d crafting entries."
L["DATA_EXPORTED_FARMING"] = "Exported %d farming entries."
L["DATA_EXPORTED_COLLECTION"] = "Exported %d items (%d owned)."
L["DATA_DECOR_COLLECTION"] = "Decor Collection"
L["DATA_COLLECTION_DESC"] = "Overview of your owned decor items from the Housing Catalog."
L["DATA_FARMING_HELP"] = "Sessions start when lumber enters your bags. Zone shows where the last lumber was collected. Reloading UI ends the session."
L["DATA_CRAFTING_SORT_HELP"] = "(click item to preview, headers to sort)"
L["DATA_CLICK_REFRESH"] = "Click Refresh to load data"
L["DATA_CATALOG_UNAVAILABLE"] = "Housing Catalog API not available"
L["DATA_EMPTY_FARMING"] = "No farming sessions recorded yet.\nStart farming lumber to see your history here!"
L["DATA_STAT_UNIQUE"] = "Unique: "
L["DATA_STAT_STORAGE"] = "Storage: "
L["DATA_STAT_PLACED"] = "Placed: "
L["DATA_STAT_TOTAL"] = "Total: "
L["DATA_STAT_OWNED"] = "Owned: "

-- ============================================================================
-- Trainers Tab
-- ============================================================================
L["TRAINER_PANEL_TITLE"] = "Profession Trainers"
L["TRAINER_PANEL_SUBTITLE"] = "Click profession to expand/collapse"
L["TRAINER_DATA_NOT_LOADED"] = "Trainer data not loaded"
L["TRAINER_WAYPOINT_CLEARED"] = "Waypoint cleared."
L["TRAINER_ALL_CLEARED"] = "All waypoints and map pins cleared."
L["TRAINER_UNKNOWN_ZONE"] = "Unknown zone: '%s' - please report this!"
L["TRAINER_NEEDS_TRAINING"] = "Needs training:"
L["TRAINER_TRAINERS_SUFFIX"] = " trainers"

-- ============================================================================
-- Decor Preview Tab
-- ============================================================================
L["PREVIEW_TAB_TITLE"] = "Decor Preview"
L["PREVIEW_FILTER"] = "Filter:"
L["PREVIEW_ITEMS"] = "Items"
L["PREVIEW_HIDE_UNRELEASED"] = "Hide Unreleased"
L["PREVIEW_FIND_VENDOR"] = "Find Vendor"
L["PREVIEW_PLACEHOLDER"] = "Select an item to preview"
L["PREVIEW_LOADING"] = "Loading catalog..."
L["PREVIEW_NO_WINDOW"] = "Main window not available. Open /hdg first."
L["PREVIEW_NOT_INITIALIZED"] = "Module not initialized. Try reopening /hdg."
L["PREVIEW_NO_ITEM_ID"] = "Could not find item ID for this decor"
L["PREVIEW_ADDED_QUEUE"] = "Added %d craftable item(s) to crafting queue"
L["PREVIEW_NO_CRAFTABLE"] = "No craftable items to add (check your filters)"
L["PREVIEW_ADDED_TO_LIST"] = "Added %s to %s"
L["PREVIEW_SHOPPING_LIST"] = "shopping list"
L["PREVIEW_WISH_LIST"] = "wish list"
L["PREVIEW_INFO_PROFESSION"] = "Profession:"
L["PREVIEW_INFO_STORED"] = "(Stored: %d)"
L["PREVIEW_INFO_PLACED"] = "(Placed: %d)"
L["PREVIEW_INFO_ALLOWED"] = "Allowed:"
L["PREVIEW_INFO_INDOORS"] = "Indoors"
L["PREVIEW_INFO_OUTDOORS"] = "Outdoors"
L["PREVIEW_INFO_TAGS"] = "Tags:"
L["PREVIEW_INFO_DYEABLE"] = "Dyeable:"
L["PREVIEW_UNAVAILABLE"] = "Preview unavailable"

-- ============================================================================
-- UI Main / Header
-- ============================================================================
L["UI_HOUSE_LEVEL"] = "House Level"

-- ============================================================================
-- Buttons (additional)
-- ============================================================================
L["BTN_SELECT_ALL"] = "Select All"     -- ENGLISH ONLY
L["BTN_IMPORT"] = "Import"             -- ENGLISH ONLY
L["BTN_OPEN_LIST"] = "Open List"
L["BTN_RELOAD"] = "Reload"             -- ENGLISH ONLY
L["BTN_ALL_MY_MATS"] = "All My Mats"

-- ============================================================================
-- Status Messages (additional)
-- ============================================================================
L["STATUS_ERROR"] = "Error"
L["STATUS_SHOPPING_LIST_EMPTY"] = "Your shopping list is empty"
L["STATUS_SHOPPING_LIST_HINT"] = "Add items from the Acquire tab or import a list"
L["STATUS_NO_ZONE_VENDORS"] = "No vendors with uncollected items"

-- ============================================================================
-- Headers (additional)
-- ============================================================================
L["HEADER_WISH_LIST"] = "Wish List"
L["HEADER_ZONE_VENDORS"] = "Zone Vendors"
L["HEADER_ZONE_SCANNER"] = "Zone Scanner"

-- ============================================================================
-- Styles Tab (additional)
-- ============================================================================
L["STYLE_FILTER_CRAFTABLE"] = "Craftable"
L["STYLE_ADD_TO_SHOPPING_LIST"] = "Add to Shopping List"
L["STYLE_VIEW_LIST"] = "List"           -- ENGLISH ONLY
L["STYLE_VIEW_GRID"] = "Grid"           -- ENGLISH ONLY
L["STYLE_SAVE_PLACED_DECOR"] = "Save Placed Decor"
L["STYLE_NEW_SNAPSHOT_DESC"] = "Snapshot all placed decor"
L["STYLE_ITEMS_PLACED"] = "%d items (%d placed)"
L["STYLE_ITEMS_IN_LIST"] = "%d items in list"

-- ============================================================================
-- Acquisition Tab (additional)
-- ============================================================================
L["ACQ_ALL_ZONES"] = "All Zones"
L["ACQ_ALL_REPS"] = "All Reps"
L["ACQ_ALL_SOURCES"] = "All Sources"
L["ACQ_FILTER_DYE"] = "Dye"            -- ENGLISH ONLY
L["ACQ_UNKNOWN_VENDOR"] = "Unknown Vendor"
L["ACQ_NO_ITEMS_INVENTORY"] = "No items in inventory"

-- ============================================================================
-- Vendor Shopping List (additional)
-- ============================================================================
L["EXPORT_SHOPPING_LIST_TITLE"] = "Export Shopping List"
L["IMPORT_SHOPPING_LIST_TITLE"] = "Import Shopping List"
L["IMPORT_CREATE_NEW_LIST"] = "Create as new list"
L["EXPORT_USE_DECOR_IDS"] = "Use Decor IDs"

-- ============================================================================
-- Zone Mode
-- ============================================================================
L["CFG_ZONE_SCANNER_ENABLE"] = "Enable Zone Scanner"
L["CFG_ZONE_SCANNER_POPUP"] = "Pop Up Zone Alert"
L["CFG_ZONE_SCANNER_SQUIRRELS"] = "Squirrel Toast"
L["CFG_ZONE_SCANNER_CHAT"] = "Squirrel Chat"
L["CFG_ZONE_SCANNER_SOUND"] = "Sound"

-- ============================================================================
-- Lumber Tracker (additional)
-- ============================================================================
L["LT_COL_QUEUE"] = "Queue"             -- ENGLISH ONLY
L["LT_COL_OWNED"] = "Owned"             -- ENGLISH ONLY
L["LT_NOW_TRACKING"] = "Now tracking: %s"
L["LT_STOPPED_TRACKING"] = "Stopped tracking: %s"
L["LT_ALREADY_TRACKING"] = "Already tracking this reagent"
L["LT_ALREADY_LUMBER"] = "Lumber is already tracked in the Lumber section"

-- ============================================================================
-- Materials List (additional)
-- ============================================================================
L["PLACEHOLDER_SEARCH_MATS"] = "Search materials..."

-- ============================================================================
-- Config Tab (additional)
-- ============================================================================
L["CFG_TOOLTIP_REAGENT_TAG"] = "Tooltip: Decor Reagent Tag"
L["CFG_HINT_REAGENT_TAG"] = "(Show profession & recipe count on reagent tooltips)"

-- ============================================================================
-- Alts Tab (additional)
-- ============================================================================
L["ALTS_HIDDEN_COUNT"] = "Hidden (%d)"

-- ============================================================================
-- House Tab
-- ============================================================================
L["HOUSE_NO_DATA"] = "No house data available"

-- ============================================================================
-- TOOLTIP TEXT (Pass 3 - tooltip descriptions and hints)
-- ============================================================================

-- Shared tooltip actions
L["TIP_CLOSE"] = "Close"
L["TIP_PIN_WINDOW"] = "Pin Window"
L["TIP_PINNED_DESC"] = "Pinned -- stays open on Escape and reload"
L["TIP_CLICK_PIN"] = "Click to keep window open on Escape and reload"
L["TIP_CLICK_EXPAND_COLLAPSE"] = "Click to expand/collapse"
L["TIP_COST_PREFIX"] = "Cost: %s"
L["TIP_ADD_TO_SHOPPING_LIST"] = "Add to Shopping List"
L["TIP_REMOVE_FROM_SHOPPING_LIST"] = "Remove from Shopping List"
L["TIP_SHIFTCLICK_ADD_QUEUE"] = "Shift-Click to add to crafting queue"
L["TIP_SHIFTCLICK_FIND_ACQUIRE"] = "Shift-click to find in Acquire tab"
L["TIP_SHIFTCLICK_ADD_SHOPPING"] = "Shift-Click to add to Shopping List"

-- Material tooltip labels
L["TIP_SOURCE_LABEL"] = "Source:"
L["TIP_HAVE_LABEL"] = "Have:"
L["TIP_NEED_LABEL"] = "Need:"
L["TIP_TARGET_LABEL"] = "Target:"
L["TIP_HAVE_ENOUGH"] = "Have enough!"
L["TIP_NEED_N_MORE"] = "Need %s more"
L["TIP_UNIT_PRICE"] = "Unit Price:"
L["TIP_EST_COST"] = "Est. Cost:"
L["TIP_BAGS_LABEL"] = "Bags:"
L["TIP_BANK_LABEL"] = "Bank:"
L["TIP_WARBAND_LABEL"] = "Warband:"
L["TIP_REAGENTS_LABEL"] = "Reagents:"
L["TIP_EXPANSION_LABEL"] = "Expansion:"
L["TIP_ACCOUNT_STOCK"] = "Account Stock:"
L["TIP_NEEDED_LABEL"] = "Needed:"

-- Material actions
L["TIP_CLICK_AH_SEARCH"] = "Click to set AH search text"
L["TIP_SHIFTCLICK_AUCTIONATOR"] = "Shift-Click to search Auctionator"
L["TIP_RIGHTCLICK_AUCTIONATOR"] = "Right-Click to add to Auctionator list"
L["TIP_CLICK_REMOVE_REAGENT"] = "Click to remove from tracked reagents"
L["TIP_CLICK_SEE_RECIPES"] = "Click to see recipes"
L["TIP_CLICK_CYCLE_SORT"] = "Click to cycle sort mode"
L["TIP_SORT_PREFIX"] = "Sort: %s"

-- MaterialsList toggle tooltips
L["TIP_SHOWING_RAW"] = "Showing Raw Materials"
L["TIP_CLICK_SHOW_DIRECT"] = "Click to show direct (immediate) reagents"
L["TIP_SHOWING_DIRECT"] = "Showing Direct Materials"
L["TIP_CLICK_SHOW_RAW"] = "Click to show fully-expanded raw reagents"
L["TIP_SHOWING_MY_MATS"] = "Showing My Materials"
L["TIP_CLICK_RETURN_QUEUE"] = "Click to return to crafting queue materials"
L["TIP_MY_MATERIALS"] = "My Materials"
L["TIP_CLICK_BROWSE_REAGENTS"] = "Click to browse all housing reagents you own"

-- Vendor Shopping List tooltips
L["TIP_ADD_ONE_MORE"] = "Add one more"
L["TIP_PIN_ZONE_VENDORS"] = "Pin all vendors in this zone"
L["TIP_PIN_VENDORS_IN"] = "Pin all vendors in %s"
L["TIP_DELETE_LIST"] = "Delete list"
L["TIP_RENAME_LIST"] = "Rename list"
L["TIP_CREATE_NEW_LIST"] = "Create New List"
L["TIP_ZONE_SCANNER_SETTINGS"] = "Zone Scanner Settings"
L["TIP_OPEN_SOURCE_URL"] = "Open source URL"
L["TIP_SHIFTCLICK_WAYPOINT"] = "Shift-Click to set waypoint"
L["TIP_SHIFTCLICK_ADD_ALL_LIST"] = "Shift-Click to add all to list"

-- HDG_UI tooltips
L["TIP_REFRESH"] = "Refresh"
L["TIP_REFRESH_DESC"] = "Clears caches and refreshes all tabs"
L["TIP_CHANGE_THEME"] = "Change Theme"
L["TIP_THEME_CURRENT"] = "Current: %s"
L["TIP_THEME_LEFTCLICK"] = "Left-click: %s"
L["TIP_THEME_RIGHTCLICK"] = "Right-click: %s"
L["TIP_MATERIALS_LIST"] = "Materials List"
L["TIP_MATERIALS_LIST_DESC"] = "Required reagents for your crafting queue"
L["TIP_SHIFTCLICK_ADD_ITEMS"] = "Shift-Click items to add them"
L["TIP_HOUSE_XP_1"] = "Earn House XP by collecting new decor items."
L["TIP_HOUSE_XP_2"] = "Higher house levels unlock more decoration slots."
L["TIP_OPEN_DECOR_GUIDE"] = "Open Decor Guide"
L["TIP_FILTERED_TO"] = "Filtered to %s decor recipes"
L["TIP_VIEW_ALL_DECOR"] = "View all housing decor recipes"
L["TIP_CLEAR_FILTER"] = "Clear Filter"
L["TIP_CLICK_SHOW_ALL"] = "Click to show all recipes again."
L["TIP_FILTER_HOUSE_DECOR"] = "Filter House Decor"
L["TIP_FILTER_HOUSE_DECOR_DESC"] = "Filters recipes to show only House Decor."
L["TIP_FILTER_NOTE_1"] = "Note: Select each expansion tab"
L["TIP_FILTER_NOTE_2"] = "to see all decor recipes."

-- Lumber Tracker tooltips
L["TIP_HIDE_RADAR"] = "Hide Radar"
L["TIP_HIDE_RADAR_DESC"] = "Hide the lumber radar HUD"
L["TIP_SHOW_RADAR"] = "Show Radar"
L["TIP_SHOW_RADAR_DESC"] = "Show the lumber radar HUD"
L["TIP_SHOW_ALL_LUMBER"] = "Show All Lumber"
L["TIP_SHOW_ONLY_ACTIVE"] = "Show Only Active"
L["TIP_HAVE_ENOUGH_QUEUE"] = "Have enough for crafting queue"
L["TIP_UNCOLLECTED_DECOR_NEEDS"] = "Uncollected crafted Decor needs:"
L["TIP_HAVE_ENOUGH_ALL"] = "Have enough for all recipes"
L["TIP_MOUNTED_UNLOCKED"] = "Mounted Harvesting: Unlocked!"
L["TIP_MOUNTED_LABEL"] = "Mounted Harvesting:"
L["TIP_MOUNTED_HINT"] = "Gather 250 to unlock mounted lumber farming"
L["TIP_UNPIN_TRACKER"] = "Unpin (return to embedded)"

-- Minimap tooltips
L["TIP_MINIMAP_LEFTCLICK"] = "Left-click: Toggle addon"
L["TIP_MINIMAP_RIGHTCLICK"] = "Right-click: Menu"
L["TIP_MINIMAP_DRAG"] = "Drag: Move button"
L["TIP_MINIMAP_DESC"] = "Track and craft housing decor items"
L["TIP_MINIMAP_CLICK"] = "Click: Toggle addon window"

-- Decor Preview tooltips
L["TIP_STORED"] = "Stored"
L["TIP_STORED_FILTER_DESC"] = "Show only items with stored copies you can destroy"
L["TIP_CRAFTABLE"] = "Craftable"
L["TIP_CRAFTABLE_DESC"] = "Recipe is available to craft"
L["TIP_STAR_KNOWN_YOU"] = "Bright Star = Known by you"
L["TIP_STAR_KNOWN_ALT"] = "Dim Star = Known by alt"
L["TIP_CHECK_NOT_KNOWN"] = "Dim Check = Not known"
L["TIP_COLLECTED_DESC"] = "Decor item is in your collection"
L["TIP_GREEN_COLLECTED"] = "Green = Collected"
L["TIP_GRAY_NOT_COLLECTED"] = "Gray = Not collected"
L["TIP_STORED_COL_DESC"] = "Item has stored copies that can be destroyed"
L["TIP_ITEM_COLLECTED"] = "Item collected"
L["TIP_NOT_COLLECTED_DIM"] = "Not collected"
L["TIP_RECIPE_KNOWN_BY"] = "Recipe known by: %s"
L["TIP_CRAFTABLE_BY"] = "Craftable by: %s"
L["TIP_AVAILABLE_VENDOR"] = "Available from vendor:"
L["TIP_AND_N_MORE"] = "...and %d more"
L["TIP_QUEST_PREFIX"] = "Quest: %s"
L["TIP_ACHIEVEMENT_PREFIX"] = "Achievement: %s"
L["TIP_COLLECTED_DECOR_ITEM"] = "Collected decor item"
L["TIP_TAGS_PREFIX"] = "Tags: %s"
L["TIP_ADD_ALL_QUEUE_DESC1"] = "Adds all currently displayed craftable items"
L["TIP_ADD_ALL_QUEUE_DESC2"] = "to your crafting queue"
L["TIP_N_RECIPES"] = "%d recipes"
L["TIP_N_ITEMS"] = "%d items"

-- Styles Tab tooltips
L["TIP_CLICK_COPY_URL"] = "Click to copy URL"
L["TIP_TIER"] = "Tier: %s"
L["TIP_SOURCE"] = "Source: %s"
L["TIP_SHIFTCLICK_INSPECT"] = "Shift-Click to select/inspect"
L["TIP_PLACED"] = "Placed: %d"
L["TIP_IN_STORAGE"] = "In storage: %d"
L["TIP_QTY"] = "Qty: %d"
L["TIP_SELECT_TAGS_PREVIEW"] = "Select tags to see preview"

-- Goblin Tab tooltips
L["TIP_USE_DIRECT"] = "Use Direct AH Prices"
L["TIP_DIRECT_DESC"] = "Scans the Auction House directly. No addons required."
L["TIP_USE_TSM"] = "Use TSM Prices"
L["TIP_TSM_DESC"] = "TradeSkillMaster market data"
L["TIP_USE_AUC"] = "Use Auctionator Prices"
L["TIP_AUC_DESC"] = "Auctionator auction data"
L["TIP_ADDON_NOT_INSTALLED"] = "Addon not installed"
L["TIP_SCAN_AH"] = "Scan Auction House"
L["TIP_SCAN_AH_DESC"] = "Scans all current auctions to update pricing data for profit calculations."
L["TIP_SCAN_DIRECT"] = "Scan Auction House"
L["TIP_SCAN_DIRECT_DESC"] = "Queries AH prices directly for all items in the current filter. The AH search view will update during scanning."
L["TIP_REFRESH_TSM"] = "Refresh from TSM"
L["TIP_REFRESH_TSM_DESC"] = "Recalculates profit data using current TSM market values."
L["TIP_LAST_SCAN"] = "Last scan: %s"
L["TIP_CLICK_SCAN"] = "Click to scan now"
L["TIP_AH_REQUIRED"] = "Auction House Required"
L["TIP_AH_REQUIRED_DESC"] = "Visit an auctioneer and open the Auction House window to scan prices."
L["TIP_SCAN_COOLDOWN"] = "Scan Cooldown"
L["TIP_SCAN_COOLDOWN_DESC"] = "Please wait before scanning again."
L["TIP_EXPORT_CSV"] = "Export to CSV"
L["TIP_EXPORT_CSV_DESC"] = "Click to export profit data to CSV format"
L["TIP_CLICK_EXPAND"] = "Click to expand material breakdown"
L["TIP_CTRL_QUEUE"] = "Ctrl-Click to add to crafting queue"
L["TIP_SHIFT_AH"] = "Shift-Click to search Auction House"
L["TIP_NO_PRICE_DATA"] = "No price data"

-- Recipes Tab tooltips
L["RECIPE_API_NOTE"] = "(Profession window opened - required by Blizzard API)"
L["RECIPE_CRAFT_MAX"] = "Max %d"
L["RECIPE_TIP_CLICK_ADD_QUEUE"] = "Click to add to crafting queue"
L["RECIPE_TIP_UNCOLLECTED_TITLE"] = "Show Uncollected Only"
L["RECIPE_TIP_UNCOLLECTED_DESC"] = "Hide recipes for decor you've already collected"
L["RECIPE_TIP_SEARCH_MATS"] = "Search Reagents"
L["RECIPE_TIP_SEARCH_MATS_DESC"] = "Also search by reagent/material names"
L["RECIPE_TIP_SEARCH_MATS_EX"] = "e.g. search 'bismuth' to find recipes using Bismuth"
L["RECIPE_TIP_PROF_PROGRESS"] = "Profession Progress"
L["RECIPE_TIP_PROF_PROGRESS_DESC"] = "Shows recipes collected / total recipes"
L["RECIPE_TIP_WORKFLOW"] = "Workflow:"
L["RECIPE_TIP_WORKFLOW_1"] = "1. Click recipes to add to Crafting Queue"
L["RECIPE_TIP_WORKFLOW_2"] = "2. Review Required Materials"
L["RECIPE_TIP_WORKFLOW_3"] = "3. Right-click materials for AH search"
L["RECIPE_TIP_SHOW_ALL"] = "Show All Recipes"
L["RECIPE_TIP_SHOW_READY"] = "Show Ready to Craft"
L["RECIPE_TIP_FILTER_MATS"] = "Filter by material availability"
L["RECIPE_TIP_QUEUE_DESC"] = "Recipes you want to craft"
L["RECIPE_TIP_QUEUE_HOW"] = "How to use:"
L["RECIPE_TIP_QUEUE_ADD"] = "Click recipes on the left to add them here"
L["RECIPE_TIP_QUEUE_REMOVE"] = "Click items here to remove them"
L["RECIPE_TIP_SEND_PSL"] = "Send to PSL"
L["RECIPE_TIP_SEND_PSL_DESC"] = "Export crafting queue to Profession Shopping List"
L["RECIPE_TIP_PIN_LUMBER"] = "Pin Lumber Tracker"
L["RECIPE_TIP_PIN_LUMBER_DESC"] = "Move to separate floating window"
L["RECIPE_TIP_PIN_LUMBER_NOTE"] = "Stays visible when addon window closes"
L["RECIPE_SORT_BY_RECIPE"] = "By Recipe"
L["RECIPE_SORT_TOTALS"] = "Totals"
L["RECIPE_TIP_SORT_MODE"] = "Material Sort Mode"
L["RECIPE_TIP_SORT_TOTALS_DESC"] = "Currently: Totals (aggregated)"
L["RECIPE_TIP_SORT_SWITCH_RECIPE"] = "Click to switch to By Recipe view"
L["RECIPE_TIP_SORT_RECIPE_DESC"] = "Currently: By Recipe (per-recipe breakdown)"
L["RECIPE_TIP_SORT_SWITCH_TOTALS"] = "Click to switch to Totals view"
L["RECIPE_TIP_DIRECT_MATS"] = "Direct Materials"
L["RECIPE_TIP_DIRECT_MATS_DESC"] = "Show materials as listed in recipes"
L["RECIPE_TIP_DIRECT_AS_IS"] = "Crafted reagents shown as-is"
L["RECIPE_TIP_RAW_MATS"] = "Raw Materials (Power Craft)"
L["RECIPE_TIP_RAW_MATS_DESC"] = "Expand crafted reagents to base materials"
L["RECIPE_TIP_RAW_GATHER"] = "Shows what you actually need to gather/buy"
L["RECIPE_TIP_CRAFT_NOW"] = "Craft Now"
L["RECIPE_TIP_QUEUED"] = "Queued: %d"
L["RECIPE_TIP_CAN_CRAFT"] = "Can craft: %d"
L["RECIPE_TIP_CLICK_CONFIRM"] = "Click to craft with confirmation"
L["RECIPE_TIP_SHIFT_OPEN_PROF"] = "Shift-Click to open in profession window"
L["RECIPE_TIP_MATERIALS_N"] = "Materials (x%d):"
L["RECIPE_TIP_LEFT_OPEN_PROF"] = "Left-click: Open in profession window"
L["RECIPE_TIP_SHIFT_REMOVE_ONE"] = "Shift+Left-click: Remove one"
L["RECIPE_TIP_SHIFT_RIGHT_REMOVE_ALL"] = "Shift+Right-click: Remove all"
L["RECIPE_TIP_RIGHT_REMOVE_ALL"] = "Right-click: Remove all"
L["RECIPE_TIP_REAGENTS_PER_CRAFT"] = "Reagents per craft:"
L["RECIPE_EMPTY_QUEUE_HINT"] = "Add recipes to crafting queue"
L["RECIPE_CRAFT_ORDER"] = "Craft order:"
L["RECIPE_MSG_LUMBER_PINNED"] = "Lumber tracker pinned to separate window"
L["RECIPE_TIP_CRAFT_FIRST"] = "Craft These First"
L["RECIPE_TIP_CRAFT_FIRST_1"] = "Intermediate items you need to craft"
L["RECIPE_TIP_CRAFT_FIRST_2"] = "before making the final decor."
L["RECIPE_TIP_ALT_RECIPES"] = "Alternative Recipes:"
L["RECIPE_TIP_REQUIRES"] = "Requires:"

-- Data Tab tooltips
L["DATA_TIP_AH_PRICE"] = "AH Price at Time of Crafting"
L["DATA_TIP_ITEM_VALUE"] = "Item Value:"
L["DATA_TIP_MATERIAL_COST"] = "Material Cost:"
L["DATA_TIP_PROFIT"] = "Profit:"
L["DATA_TIP_LOSS"] = "Loss:"
L["DATA_TIP_PRICE_SOURCE"] = "Source: %s"
L["DATA_TIP_DELETE_SESSION"] = "Delete Most Recent Session"
L["DATA_TIP_DELETE_SESSION_DESC"] = "Removes the most recent farming session from history"
L["DATA_TIP_EXPORT_COLLECTION"] = "Export Collection to CSV"
L["DATA_TIP_EXPORT_COLLECTION_DESC"] = "Opens a window with CSV data you can copy"
L["DATA_TIP_REFRESH_COLLECTION"] = "Refresh Collection Data"
L["DATA_TIP_REFRESH_COLLECTION_DESC"] = "Fetches your owned decor from the Housing Catalog"
L["DATA_TOP_CATEGORIES"] = "Top Categories: "
L["DATA_NO_CATEGORIES"] = "None"

-- Alts Tab tooltips
L["ALTS_TIP_OPEN_PROF_SCAN"] = "Open profession window to scan recipes"
L["ALTS_TIP_BEST_RECIPES"] = "Best: %d / %d decor recipes"
L["ALTS_TIP_ALL_LEARNED"] = "All recipes learned!"
L["ALTS_TIP_RECIPES_REMAINING"] = "%d recipes remaining"
L["ALTS_TIP_NO_RECIPES"] = "No decor recipes for this expansion"
L["ALTS_TIP_SKILL_REQUIRED"] = "Decor recipes require %d+ skill"
L["ALTS_TIP_SCAN_RECIPES"] = "Decor Recipes: Open profession window to scan"
L["ALTS_TIP_RECIPES_COMPLETE"] = "Decor Recipes: %d/%d (complete)"
L["ALTS_TIP_RECIPES_REMAINING_DETAIL"] = "Decor Recipes: %d/%d (%d remaining)"
L["ALTS_TIP_RECIPES_ZERO"] = "Decor Recipes: 0/%d"
L["ALTS_TIP_HIDE_SHOW"] = "Click to hide/show this character"
L["ALTS_TIP_DATA_CONTINUES"] = "Data collection continues normally."

-- ============================================================================
-- Save baseline for locale switching
-- ============================================================================
_G.HDG_BaseLocale = {}
for k, v in pairs(L) do
    _G.HDG_BaseLocale[k] = v
end

-- ============================================================================
-- LOCALE APPLICATION
-- ============================================================================

local function ApplyLocale(targetLocale)
    -- Reset to English base
    for key, value in pairs(_G.HDG_BaseLocale) do
        L[key] = value
    end

    -- Apply locale-specific overrides
    if _G.HDG_Locales[targetLocale] then
        for key, value in pairs(_G.HDG_Locales[targetLocale]) do
            L[key] = value
        end
    end

    -- Handle fallbacks for regional variants
    local fallbacks = {
        ["esMX"] = "esES",
        ["ptPT"] = "ptBR",
    }
    if fallbacks[targetLocale] and _G.HDG_Locales[fallbacks[targetLocale]] then
        for key, value in pairs(_G.HDG_Locales[fallbacks[targetLocale]]) do
            if not L[key] or L[key] == _G.HDG_BaseLocale[key] then
                L[key] = value
            end
        end
    end
end

-- Initial build with client locale
ApplyLocale(GetLocale())

-- ============================================================================
-- ACCESSOR METHODS
-- ============================================================================

function L:Get(key, fallback)
    return self[key] or fallback or key
end

function L:ApplyOverride()
    local override = HDG_Settings and HDG_Settings.localeOverride
    local targetLocale = (override and override ~= "auto") and override or GetLocale()
    ApplyLocale(targetLocale)
end

function L:GetEffectiveLocale()
    local override = HDG_Settings and HDG_Settings.localeOverride
    return (override and override ~= "auto") and override or GetLocale()
end

function L:GetAvailableLocales()
    return {
        { code = "auto", name = L["LOCALE_AUTO"] or "Auto (Client)" },
        { code = "enUS", name = "English" },
        { code = "esES", name = "Espanol (ES)" },
        { code = "esMX", name = "Espanol (MX)" },
        { code = "ptBR", name = "Portugues (BR)" },
        { code = "deDE", name = "Deutsch" },
        { code = "frFR", name = "Francais" },
        { code = "itIT", name = "Italiano" },
        { code = "ruRU", name = "Russian" },
        { code = "koKR", name = "Korean" },
        { code = "zhCN", name = "Chinese (Simplified)" },
        { code = "zhTW", name = "Chinese (Traditional)" },
    }
end

-- ============================================================================
-- EXPORT
-- ============================================================================

_G.HDG_L = L
_G.HDG_Localization = L
