<?php
/**
 * HJCyberX Checkout for Paddle Lite Upsell Page.
 *
 * @package PaddleKonnect_Lite
 */

defined( 'ABSPATH' ) || exit;

/**
 * Class PaddleKonnect_Lite_Upsell.
 */
class PaddleKonnect_Lite_Upsell {

	/**
	 * Function init.
	 */
	public static function init(): void {
		add_action( 'admin_menu', array( __CLASS__, 'add_upsell_page' ), 99 );
	}

	/**
	 * Function add_upsell_page.
	 */
	public static function add_upsell_page(): void {
		add_submenu_page(
			'woocommerce',
			'HJCyberX Checkout for Paddle Pro',
			'HJCyberX Checkout for Paddle Pro',
			'manage_options',
			'paddlekonnect-lite-pro',
			array( __CLASS__, 'render_upsell_page' )
		);
	}

	/**
	 * Function render_upsell_page.
	 */
	public static function render_upsell_page(): void {
		?>
		<div class="wrap" style="max-width: 800px; margin: 20px auto; background: #fff; padding: 30px; box-shadow: 0 1px 3px rgba(0,0,0,0.13); border-radius: 8px;">
			<div style="text-align: center; margin-bottom: 30px;">
				<h1 style="color: #0073aa; font-size: 2.5em; margin-bottom: 10px;">Upgrade to HJCyberX Checkout for Paddle Pro</h1>
				<p style="font-size: 1.2em; color: #555;">Unlock the full potential of your Paddle Billing integration.</p>
				<a href="https://plugins.hjcyberx.com/plugins/hjcyberx-checkout-paddle#features" target="_blank" class="button button-primary button-hero" style="background: #0073aa; border-color: #0073aa; font-size: 1.2em; padding: 10px 30px; height: auto;">Upgrade Now</a>
			</div>

			<table class="wp-list-table widefat fixed striped" style="border: 1px solid #e2e4e7; border-collapse: collapse; width: 100%;">
				<thead>
					<tr>
						<th style="font-size: 1.1em; padding: 15px;">Feature</th>
						<th style="font-size: 1.1em; padding: 15px; text-align: center;">Lite (Free)</th>
						<th style="font-size: 1.1em; padding: 15px; text-align: center; background: #f0f6fc; color: #0073aa;">Pro</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td style="padding: 15px; font-weight: bold;">Basic Payments (Paddle API v2)</td>
						<td style="padding: 15px; text-align: center; color: green;">&#10004;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">Webhook Order Completion</td>
						<td style="padding: 15px; text-align: center; color: green;">&#10004;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">Custom Price ID Mapping</td>
						<td style="padding: 15px; text-align: center; color: red;">&#10008;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">Direct Checkout (Skip Cart)</td>
						<td style="padding: 15px; text-align: center; color: red;">&#10008;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">Built-in Vault Content Restrictions</td>
						<td style="padding: 15px; text-align: center; color: red;">&#10008;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">Paid Memberships Pro (PMPro) Integration</td>
						<td style="padding: 15px; text-align: center; color: red;">&#10008;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">Built-in Subscriptions Management</td>
						<td style="padding: 15px; text-align: center; color: red;">&#10008;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">WooCommerce Subscriptions Integration</td>
						<td style="padding: 15px; text-align: center; color: red;">&#10008;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">Bulk Sync Catalog Tool (Automated Pricing creation)</td>
						<td style="padding: 15px; text-align: center; color: red;">&#10008;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">WooCommerce Blocks Checkout Compatibility</td>
						<td style="padding: 15px; text-align: center; color: red;">&#10008;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
					<tr>
						<td style="padding: 15px; font-weight: bold;">Priority Customer Support & Updates via Freemius</td>
						<td style="padding: 15px; text-align: center; color: red;">&#10008;</td>
						<td style="padding: 15px; text-align: center; background: #f0f6fc; color: green;">&#10004;</td>
					</tr>
				</tbody>
			</table>

			<div style="text-align: center; margin-top: 30px;">
				<a href="https://plugins.hjcyberx.com/plugins/hjcyberx-checkout-paddle#features" target="_blank" class="button button-primary button-hero" style="background: #0073aa; border-color: #0073aa; font-size: 1.2em; padding: 10px 30px; height: auto;">Get HJCyberX Checkout for Paddle Pro</a>
			</div>
		</div>
		<?php
	}
}
