<?php
/**
 * Static data catalog for the upgrade UI: pricing tiers, Pro feature list,
 * and the free-vs-pro comparison matrix.
 *
 * Lifted out of `Admin\ProUpgrade` to keep this static data separate from
 * the URL/render helpers that consume it. `ProUpgrade` remains the public
 * facade — each `ProUpgrade::proFeatures()` /
 * `comparisonRows()` method delegates here and then runs its filter so
 * the `trx_ad_pro_*` filter contract is unchanged.
 *
 * @package ThemeREX\AutoDealer\Admin\Upgrade
 */

declare(strict_types=1);

namespace ThemeREX\AutoDealer\Admin\Upgrade;

defined( 'ABSPATH' ) || exit;

final class Catalog {

	/**
	 * Eight headline Pro features — surfaced on the upgrade page hero grid + readme.txt.
	 * Order = display order.
	 *
	 * @return list<array{key:string,name:string,summary:string,icon:string}>
	 */
	public static function features(): array {
		return array(
			array(
				'key'     => 'leads',
				'name'    => __( 'Lead CRM + Webhooks', 'trx-auto-dealer' ),
				'summary' => __( 'Every inquiry stored as a lead with status workflow (new → contacted → qualified → won/lost), HMAC-signed webhooks to your CRM, CSV export, and per-dealer notification routing.', 'trx-auto-dealer' ),
				'icon'    => 'megaphone',
			),
			array(
				'key'     => 'multi_dealer',
				'name'    => __( 'Multi-Dealer Marketplace', 'trx-auto-dealer' ),
				'summary' => __( 'Dealer + agent WordPress roles with data isolation, per-dealer dashboards with view/call/inquiry analytics, dealer directory shortcode, and social-proof counters on listings.', 'trx-auto-dealer' ),
				'icon'    => 'admin-users',
			),
			array(
				'key'     => 'import_export',
				'name'    => __( 'CSV/XML Import + Export + Feeds', 'trx-auto-dealer' ),
				'summary' => __( 'Bulk-import inventory from CSV or XML, scheduled imports from remote URLs, exports to Facebook Marketplace, AutoTrader, MobileDe, and AutoScout24 feeds.', 'trx-auto-dealer' ),
				'icon'    => 'database-import',
			),
			array(
				'key'     => 'featured_payments',
				'name'    => __( 'Featured Listings + Paid Promotion', 'trx-auto-dealer' ),
				'summary' => __( 'Sell featured-listing slots to dealers via WooCommerce. 3 tiers (7-day / 14-day / 30-day), auto-expire via WP-Cron, idempotent activation on order completion.', 'trx-auto-dealer' ),
				'icon'    => 'star-filled',
			),
			array(
				'key'     => 'test_drive',
				'name'    => __( 'Test Drive Bookings', 'trx-auto-dealer' ),
				'summary' => __( 'Calendar-based booking flow on every listing. Available slots configured per dealer, admin confirmation workflow, customer email reminders.', 'trx-auto-dealer' ),
				'icon'    => 'calendar-alt',
			),
			array(
				'key'     => 'vin_decoder',
				'name'    => __( 'VIN Decoder + AI Descriptions', 'trx-auto-dealer' ),
				'summary' => __( 'Decode any 17-character VIN against NHTSA (free) or a paid provider. Pre-fills make/model/year/specs. Generate listing descriptions with OpenAI in seconds.', 'trx-auto-dealer' ),
				'icon'    => 'search',
			),
			array(
				'key'     => 'advanced_search',
				'name'    => __( 'Geo Search + Saved Searches + Alerts', 'trx-auto-dealer' ),
				'summary' => __( 'Radius search ("vehicles within 50km of me"), saved-search subscriptions with daily email digests, and Web Push notifications on new matches.', 'trx-auto-dealer' ),
				'icon'    => 'location-alt',
			),
			array(
				'key'     => 'custom_fields',
				'name'    => __( 'Custom Fields + Price History', 'trx-auto-dealer' ),
				'summary' => __( 'Define your own vehicle fields beyond the built-in spec set. Price-change history with market-value badges on listings.', 'trx-auto-dealer' ),
				'icon'    => 'admin-customizer',
			),
		);
	}

	/**
	 * Free-vs-Pro capability matrix. Each row is one product capability; `free`
	 * and `pro` are either a checkmark string ("Yes") or an em-dash ("—").
	 *
	 * The visual class on the rendered cell is keyed off the em-dash literal
	 * (see `UpgradePage::renderPage`), so don't change it without updating
	 * the consumer.
	 *
	 * @return list<array{capability:string,free:string,pro:string}>
	 */
	public static function comparisonRows(): array {
		$dash_no = '—';
		$check_y = __( 'Yes', 'trx-auto-dealer' );
		return array(
			array(
				'capability' => __( 'Vehicle + dealer custom post types', 'trx-auto-dealer' ),
				'free'       => $check_y,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Search + filter (free-text, taxonomy, range)', 'trx-auto-dealer' ),
				'free'       => $check_y,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Gutenberg blocks + Elementor widgets', 'trx-auto-dealer' ),
				'free'       => __( '13 + 15', 'trx-auto-dealer' ),
				'pro'        => __( '17 + 15', 'trx-auto-dealer' ),
			),
			array(
				'capability' => __( 'PDF spec sheet + QR code', 'trx-auto-dealer' ),
				'free'       => $check_y,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Schema.org + 7 SEO-plugin integrations', 'trx-auto-dealer' ),
				'free'       => $check_y,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Inquiry forms (email only)', 'trx-auto-dealer' ),
				'free'       => $check_y,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Lead CRM (stored + workflow + webhooks)', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Multi-dealer roles + data isolation', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'CSV / XML import + export', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Marketplace feeds (FB / AutoTrader / etc.)', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Featured listings + WC paid promotion', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Test drive bookings', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'VIN decoder + AI descriptions', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Geo radius search + saved searches', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Web Push notifications', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Custom fields + price history', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Multisite-aware activation', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'WooCommerce deposit + listing-fee integration', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
			array(
				'capability' => __( 'Priority email support', 'trx-auto-dealer' ),
				'free'       => $dash_no,
				'pro'        => $check_y,
			),
		);
	}
}
