<?php
/**
 * Global Configuration File
 * -------------------------
 * - Sets timezone
 * - Loads database connection
 * - Loads shared functions
 * - Defines global paths
 * - Central place for future settings (tab names, rarity names, etc.)
 */

// ------------------------------------------------------------
// TIMEZONE
// ------------------------------------------------------------
date_default_timezone_set('Pacific/Auckland');


// ------------------------------------------------------------
// PATH CONSTANTS
// ------------------------------------------------------------
define('BASE_PATH', dirname(__DIR__));
define('ASSETS_PATH', BASE_PATH . "/assets/");
define('IMAGES_PATH', ASSETS_PATH . "images/");
define('HABIT_IMAGES_PATH', IMAGES_PATH . "habits/");
define('ITEM_IMAGES_PATH', IMAGES_PATH . "items/");
define('ICON_PATH', IMAGES_PATH . "icons/"); // SVG icons only


// ------------------------------------------------------------
// INVENTORY TAB NAMES (editable later)
// ------------------------------------------------------------
// These are the internal values stored in the database.
// You can change the DISPLAY names later in a settings page.
$GLOBALS['INVENTORY_TABS'] = [
    'tab1' => 'TAB1',
    'tab2' => 'TAB2',
    'tab3' => 'TAB3',
    'misc' => 'MISC'
];


// ------------------------------------------------------------
// RARITY SYSTEM
// ------------------------------------------------------------
// Default rarity = none (as you requested)
$GLOBALS['RARITY_LEVELS'] = [
    'none'       => 'None',
    'common'     => 'Common',
    'rare'       => 'Rare',
    'epic'       => 'Epic',
    'legendary'  => 'Legendary'
];


// ------------------------------------------------------------
// LOW-STOCK SETTINGS
// ------------------------------------------------------------
// These can be used later for email alerts.
$GLOBALS['LOW_STOCK_PERCENT'] = 20;   // below 20% triggers alert
$GLOBALS['LOW_STOCK_ABSOLUTE'] = 20;  // below 20 units triggers alert


// ------------------------------------------------------------
// LOAD DATABASE + FUNCTIONS
// ------------------------------------------------------------
require_once BASE_PATH . "/includes/db.php";
require_once BASE_PATH . "/includes/functions.php";

?>