<?php
/**
 * Centralized Labels & Configuration
 *
 * All user-facing text, icons, and labels in one place.
 * English is the source language; Slovak via i18n (.po/.mo).
 * Change here → Changes everywhere automatically.
 */

if (!defined('ABSPATH')) exit;

/**
 * Global Constants
 */
define('MTCAM_DEFAULT_COLOR', '#9C27B0');

/**
 * Inline icons for rendering (maps, owners, etc.)
 */
define('MTCAM_ICON_MAP', '📍');
define('MTCAM_ICON_OWNER', '👤');

/**
 * Get all bait file types
 */
function mtcam_get_all_bait_types() {
    return array(
        'bait_html' => mtcam_label_bait_html(),
        'bait_tel' => mtcam_label_bait_tel(),
    );
}

/**
 * Get all security types
 */
function mtcam_get_all_security_types() {
    return array(
        'sec_box' => mtcam_label_sec_box(),
        'sec_cable' => mtcam_label_sec_cable(),
        'sec_padlock' => mtcam_label_sec_padlock(),
        'sec_password' => mtcam_label_sec_password(),
        'sec_camera' => mtcam_label_sec_camera(),
    );
}

/**
 * Get all power types for select dropdown
 */
function mtcam_get_all_power_types() {
    return array(
        'lithium'       => '🔋 ' . __('Lithium batteries', 'my-trail-camera'),
        'solar'         => '☀️ ' . __('Solar panel', 'my-trail-camera'),
        'solar_lithium' => '☀️🔋 ' . __('Solar + Lithium', 'my-trail-camera'),
        'solar_lead'    => '☀️🪫 ' . __('Solar + Lead-acid', 'my-trail-camera'),
        'external'      => '🔌 ' . __('External power', 'my-trail-camera'),
    );
}

/**
 * Get power type label
 */
function mtcam_get_power_label($type) {
    $types = mtcam_get_all_power_types();
    return $types[$type] ?? $types['lithium'];
}

/**
 * Get power type icon (emoji only, no label).
 * Single source of truth — any UI that needs a power icon should call this.
 */
function mtcam_get_power_icon( $type ) {
    static $icons = array(
        'lithium'       => '🔋',
        'solar'         => '☀️',
        'solar_lithium' => '☀️🔋',
        'solar_lead'    => '☀️🪫',
        'external'      => '🔌',
    );
    return $icons[ $type ] ?? '🔋';
}

/**
 * Does this power type have solar?
 */
function mtcam_has_solar($power_type) {
    return in_array($power_type, array('solar', 'solar_lithium', 'solar_lead'));
}

/**
 * Get all GPS tracker types
 */
function mtcam_get_all_gps_types() {
    return array(
        'gps_airtag' => mtcam_label_gps_airtag(),
        'gps_tile' => mtcam_label_gps_tile(),
        'gps_samsung' => mtcam_label_gps_smarttag(),
        'gps_other' => mtcam_label_gps_other(),
    );
}

/**
 * i18n wrapper functions
 * Emoji are kept separate from translatable text
 */
function mtcam_label_bait_html()     { return '🌐 ' . __('HTML', 'my-trail-camera'); }
function mtcam_label_bait_tel()      { return '☎️ ' . __('Tel', 'my-trail-camera'); }
function mtcam_label_sec_box()       { return '🛡️ ' . __('Metal Box', 'my-trail-camera'); }
function mtcam_label_sec_cable()     { return '🔗 ' . __('Cable Lock', 'my-trail-camera'); }
function mtcam_label_sec_padlock()   { return '🔐 ' . __('Padlock', 'my-trail-camera'); }
function mtcam_label_sec_password()  { return '🔑 ' . __('Password', 'my-trail-camera'); }
function mtcam_label_sec_camera()    { return '📷 ' . __('Monitored by another trail camera', 'my-trail-camera'); }
function mtcam_label_gps_airtag()    { return '🍎 ' . __('AirTag', 'my-trail-camera'); }
function mtcam_label_gps_tile()      { return '📍 ' . __('Tile', 'my-trail-camera'); }
function mtcam_label_gps_smarttag()  { return '📱 ' . __('SmartTag', 'my-trail-camera'); }
function mtcam_label_gps_other()     { return '🔍 ' . __('Other', 'my-trail-camera'); }

function mtcam_label_active()        { return '✅ ' . __('IN FIELD', 'my-trail-camera'); }
function mtcam_label_stolen()        { return '⚠️ ' . __('STOLEN', 'my-trail-camera'); }
function mtcam_label_inactive()      { return '⭕ ' . __('Inactive', 'my-trail-camera'); }
function mtcam_label_tested()        { return '🧪 ' . __('TESTING', 'my-trail-camera'); }
function mtcam_label_at_home()       { return '🏠 ' . __('AT HOME', 'my-trail-camera'); }
function mtcam_label_stored()        { return mtcam_label_at_home(); } // Legacy alias
function mtcam_label_police_reported() { return '🚨 ' . __('Reported to police', 'my-trail-camera'); }

function mtcam_label_security()      { return '🔒 ' . __('Security', 'my-trail-camera'); }
function mtcam_label_bait_files()    { return '📁 MTC'; }
function mtcam_btn_add_camera()      { return '💾 ' . __('Add Camera', 'my-trail-camera'); }
