<?php
/**
 * Pro upgrade screen for gated features.
 *
 * @package Lucrativeit_Subscription_Recurring_Billing
 *
 * @var string $pro_feature Feature slug (staff|roles).
 */

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

// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Included template; variables are local to the including scope.

$features = array(
	'staff' => array(
		'title'       => __( 'Staff Management', 'lucrativeit-subscription-recurring-billing' ),
		'description' => __( 'Add team members, assign branches, and control who can access your subscription portal.', 'lucrativeit-subscription-recurring-billing' ),
		'icon'        => '&#128188;',
		'benefits'    => array(
			__( 'Invite and manage staff accounts', 'lucrativeit-subscription-recurring-billing' ),
			__( 'Assign positions and branch access', 'lucrativeit-subscription-recurring-billing' ),
			__( 'Link staff to role-based permissions', 'lucrativeit-subscription-recurring-billing' ),
		),
	),
	'roles' => array(
		'title'       => __( 'Roles & Permissions', 'lucrativeit-subscription-recurring-billing' ),
		'description' => __( 'Define custom roles and control which modules each team member can view or manage.', 'lucrativeit-subscription-recurring-billing' ),
		'icon'        => '&#128737;',
		'benefits'    => array(
			__( 'Create roles with granular module access', 'lucrativeit-subscription-recurring-billing' ),
			__( 'Restrict billing, plans, or settings per role', 'lucrativeit-subscription-recurring-billing' ),
			__( 'Pre-built Super Admin, Manager, and Support templates', 'lucrativeit-subscription-recurring-billing' ),
		),
	),
	'email_branding' => array(
		'title'       => __( 'Email Branding', 'lucrativeit-subscription-recurring-billing' ),
		'description' => __( 'Add your logo to the email header and customize footer text so every invoice and notification looks professional.', 'lucrativeit-subscription-recurring-billing' ),
		'icon'        => '&#9993;',
		'benefits'    => array(
			__( 'Upload a header logo with width and position controls', 'lucrativeit-subscription-recurring-billing' ),
			__( 'Customize header background and text colors', 'lucrativeit-subscription-recurring-billing' ),
			__( 'Add custom footer text and secondary lines', 'lucrativeit-subscription-recurring-billing' ),
		),
	),
	'pdf_invoice' => array(
		'title'       => __( 'PDF Invoice', 'lucrativeit-subscription-recurring-billing' ),
		'description' => __( 'Generate branded PDF invoices with your logo and footer, and attach them automatically to customer emails.', 'lucrativeit-subscription-recurring-billing' ),
		'icon'        => '&#128196;',
		'benefits'    => array(
			__( 'PDF header logo with width and alignment', 'lucrativeit-subscription-recurring-billing' ),
			__( 'Custom footer text, notes, and business address', 'lucrativeit-subscription-recurring-billing' ),
			__( 'Attach PDF invoices to payment and receipt emails', 'lucrativeit-subscription-recurring-billing' ),
		),
	),
);

$feature = isset( $features[ $pro_feature ] ) ? $features[ $pro_feature ] : array(
	'title'       => __( 'Pro Feature', 'lucrativeit-subscription-recurring-billing' ),
	'description' => sprintf(
		/* translators: %s: plugin name */
		__( 'This feature is available in %s Pro.', 'lucrativeit-subscription-recurring-billing' ),
		lucrsure_plugin_name()
	),
	'icon'        => '&#9733;',
	'benefits'    => array(),
);
?>

<div class="lucrsure-pro-feature">
	<div class="lucrsure-card lucrsure-pro-feature-card">
		<span class="lucrsure-pro-badge"><?php esc_html_e( 'Pro', 'lucrativeit-subscription-recurring-billing' ); ?></span>
		<div class="lucrsure-pro-feature-icon" aria-hidden="true"><?php echo wp_kses( $feature['icon'], array() ); ?></div>
		<h1><?php echo esc_html( $feature['title'] ); ?></h1>
		<p class="lucrsure-sub"><?php echo esc_html( $feature['description'] ); ?></p>

		<?php if ( ! empty( $feature['benefits'] ) ) : ?>
			<ul class="lucrsure-pro-benefits">
				<?php foreach ( $feature['benefits'] as $benefit ) : ?>
					<li><?php echo esc_html( $benefit ); ?></li>
				<?php endforeach; ?>
			</ul>
		<?php endif; ?>

		<div class="lucrsure-pro-actions">
			<a class="lucrsure-btn lucrsure-btn-primary" href="<?php echo esc_url( lucrsure_pro_url() ); ?>" target="_blank" rel="noopener noreferrer">
				<?php esc_html_e( 'Upgrade to Pro', 'lucrativeit-subscription-recurring-billing' ); ?>
			</a>
			<a class="lucrsure-btn lucrsure-btn-light" href="<?php echo esc_url( lucrsure_admin_url( 'dashboard' ) ); ?>">
				<?php esc_html_e( 'Back to Dashboard', 'lucrativeit-subscription-recurring-billing' ); ?>
			</a>
		</div>

		<p class="lucrsure-pro-footnote lucrsure-muted">
			<?php esc_html_e( 'Staff and Roles are part of the Pro add-on alongside extra payment gateways and advanced notifications.', 'lucrativeit-subscription-recurring-billing' ); ?>
		</p>
	</div>
</div>
