<?php
define('APP_NAME', 'Helmyx');
define('APP_URL', 'http://localhost/Prodcat');
define('APP_VERSION', '1.0.0');
if (!defined('ROOT_PATH')) {
    define('ROOT_PATH', dirname(__DIR__));
}
define('UPLOAD_PATH', ROOT_PATH . '/uploads');
define('MAX_FILE_SIZE', 10 * 1024 * 1024); // 10MB
define('SESSION_LIFETIME', 7200);
define('IDLE_TIMEOUT_SECONDS', 300); // Auto-logout after 5 minutes of inactivity
define('CSRF_TOKEN_NAME', 'csrf_token');
define('OTP_ISSUER', 'Helmyx');

// SMTP Settings placeholder
define('SMTP_HOST', 'smtp.example.com');
define('SMTP_PORT', 587);
define('SMTP_USERNAME', 'your_username');
define('SMTP_PASSWORD', 'your_password');
define('SMTP_FROM_EMAIL', 'noreply@helmyx.com');
define('SMTP_FROM_NAME', 'Helmyx Support');

define('SUPPORTED_LOCALES', ['en_US', 'en_NG', 'fr_FR']);
// DEFAULT_LOCALE, DEFAULT_CURRENCY, DEFAULT_TIMEZONE, PLATFORM_FEE_RATE are defined in
// index.php after the database connection is available, so they can be overridden by System Settings.

define('DATE_FORMATS', [
    'en_US' => 'm/d/Y H:i:s',
    'en_NG' => 'd/m/Y H:i:s',
    'fr_FR' => 'd/m/Y H:i:s',
]);

define('CURRENCIES', [
    'NGN' => '₦',
    'USD' => '$',
    'EUR' => '€'
]);

// Two-tier industry taxonomy: sector => sub-industries. A sector mapped to an
// empty array (e.g. 'Other') is rendered as a single, standalone option.
// Use getIndustryGroups() for the nested form and getIndustries() for a flat
// leaf-level list (backward-compatible with plain <select> usages).
define('INDUSTRIES', [
    'Technology & Software' => [
        'Enterprise Software / SaaS',
        'Consumer Software & Mobile Apps',
        'IT Services & Infrastructure',
        'Cybersecurity',
        'Artificial Intelligence & Machine Learning',
        'Hardware, Semiconductors & Electronics',
        'Cloud Computing & Hosting',
        'Video Games, Interactive Media & Esports',
    ],
    'Financial Services & Real Estate' => [
        'Banking (Retail, Commercial, Investment)',
        'Fintech & Digital Payments',
        'Venture Capital & Private Equity',
        'Insurance & Insurtech',
        'Asset & Wealth Management',
        'Real Estate Development & Construction',
        'Real Estate Brokerage & Property Management',
        'Mortgage & Commercial Lending',
    ],
    'Healthcare, Pharmaceuticals & Biotech' => [
        'Hospitals, Clinics & Patient Care',
        'Biotechnology & Life Sciences',
        'Pharmaceuticals',
        'Medical Devices & Equipment',
        'Healthtech & Digital Health',
        'Mental Health Services',
        'Health Insurance & Managed Care',
    ],
    'Manufacturing, Industrial & Energy' => [
        'Automotive & Mobility',
        'Aerospace & Defense',
        'Industrial Automation & Robotics',
        'Chemicals & Advanced Materials',
        'Oil, Gas & Fossil Fuels',
        'Renewable Energy & Cleantech (Solar, Wind, Battery)',
        'Mining, Metals & Natural Resources',
        'Utilities (Water, Electric, Power)',
    ],
    'Retail, Consumer Goods & Commerce' => [
        'E-commerce & D2C Brands',
        'Retail (Apparel, Electronics, Home Goods)',
        'Consumer Packaged Goods (CPG)',
        'Food & Beverage Production',
        'Apparel, Fashion & Luxury Goods',
        'Cosmetics, Personal Care & Beauty',
    ],
    'Media, Entertainment & Communications' => [
        'Digital Media & Publishing',
        'Film, Television & Streaming',
        'Music & Audio Production',
        'Telecommunications & ISPs',
        'Sports & Live Entertainment',
        'Journalism, News & Broadcasting',
    ],
    'Professional & Business Services' => [
        'Management & Strategy Consulting',
        'Marketing, Advertising & Public Relations',
        'Accounting, Audit & Tax Services',
        'Legal Services',
        'Human Resources, Staffing & Recruiting',
        'Design, Architecture & Engineering Services',
        'Facilities Management & Outsourcing',
    ],
    'Logistics, Transportation & Supply Chain' => [
        'Freight, Shipping & Marine Transport',
        'Warehousing, Fulfillment & Storage',
        'Supply Chain Software & Analytics',
        'Public Transit & Rail Logistics',
        'Airlines, Aviation & Airport Operations',
        'On-Demand Delivery & Postal Services',
    ],
    'Education & Edtech' => [
        'K-12 Education',
        'Higher Education (Universities & Colleges)',
        'Edtech & Online Learning Platforms',
        'Corporate Training & Workforce Development',
        'Vocational & Technical Training',
    ],
    'Hospitality, Travel & Food Services' => [
        'Restaurants, Bars & Food Services',
        'Hotels, Resorts & Lodging',
        'Travel Agencies & Tour Operators',
        'Event Management & Venues',
        'Leisure, Gaming & Casinos',
    ],
    'Agriculture, Forestry & Environment' => [
        'Farming & Crop Production',
        'Agtech & Precision Agriculture',
        'Livestock, Dairy & Poultry',
        'Forestry, Timber & Paper',
        'Environmental Services & Waste Management',
    ],
    'Public Sector, Non-Profit & Services' => [
        'Government (Federal, State, Local)',
        'Non-Profit Organizations & Philanthropy',
        'Defense, Public Safety & Security',
        'Associations, Unions & Think Tanks',
    ],
    'Other' => [],
]);

// Must match the ENUM values in sql/schema.sql exactly (projects.status / invoices.status)
define('PROJECT_STATUSES', [
    'draft',
    'active',
    'on_hold',
    'completed',
    'cancelled'
]);

define('INVOICE_STATUSES', [
    'draft',
    'submitted',
    'under_review',
    'approved',
    'rejected',
    'paid'
]);

define('CONTRACTOR_DOC_TYPES', [
    'ID',
    'License',
    'Insurance',
    'Contract',
    'Other'
]);

define('APP_ENV', 'development');

if (APP_ENV === 'development') {
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
} else {
    ini_set('display_errors', 0);
    ini_set('display_startup_errors', 0);
    error_reporting(0);
}
