<?php
/**
 * Lite version and feature flags.
 *
 * @package Vareon_Calculator_Suite_Lite
 */

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

/**
 * Get the current edition slug.
 *
 * @return string 'lite' or 'pro'
 */
function vareoncalc_get_version() {
	return 'lite';
}

/**
 * Check whether Pro is active.
 *
 * @return bool Always false in Lite.
 */
function vareoncalc_is_pro() {
	return false;
}

/**
 * Check whether Lite is active.
 *
 * @return bool Always true in Lite.
 */
function vareoncalc_is_lite() {
	return true;
}

/**
 * Feature availability map for Lite.
 *
 * @return array Feature => Version mapping
 */
function vareoncalc_get_feature_map() {
	return array(
		'basic_themes'  => 'lite',
		'blocks'        => 'lite',
		'shortcodes'    => 'lite',
		'validation'    => 'lite',
		'responsive'    => 'lite',
		'accessibility' => 'lite',
	);
}

/**
 * Get available calculators for the current version.
 *
 * @return array List of calculator type slugs.
 */
function vareoncalc_get_available_calculators() {
	return vareoncalc_get_lite_calculators();
}

/**
 * Check whether a calculator type is available.
 *
 * @param string $type Calculator type to check.
 * @return bool True if calculator is available.
 */
function vareoncalc_is_calculator_available( $type ) {
	return in_array( $type, vareoncalc_get_available_calculators(), true );
}

/**
 * Get Lite calculator slugs.
 *
 * @return array List of Lite calculator types
 */
function vareoncalc_get_lite_calculators() {
	return array(
		'loan',
		'mortgage',
		'savings',
		'bmi',
		'age',
		'unit-converter',
		'percentage',
		'tip',
		'roi',
		'credit-card-payoff',
		'discount',
		'fuel-cost',
		'gpa',
		'grade-calc',
	);
}

/**
 * Check if a specific feature is available.
 *
 * @param string $feature Feature key to check.
 * @return bool True if feature is available in Lite.
 */
function vareoncalc_has_feature( $feature ) {
	$feature_map = vareoncalc_get_feature_map();

	return isset( $feature_map[ $feature ] ) && 'lite' === $feature_map[ $feature ];
}

/**
 * Get available theme presets.
 *
 * @return array Available theme preset slugs.
 */
function vareoncalc_get_available_themes() {
	return array( 'light', 'dark', 'modern' );
}
