<?php
/**
 * Donate template.
 *
 * @package NaveenCodesImageOptimizer
 */

defined( 'ABSPATH' ) || exit;

(
	static function ( $banner, $stats ) {
		$ultra_image_optimizer_saved_total = size_format( (int) ( $stats['total_saved_bytes'] ?? 0 ), 2 );
		$ultra_image_optimizer_upi_id      = '8053385815@kotak811';
		$ultra_image_optimizer_upi_name    = 'Naveen Kumar';
		$ultra_image_optimizer_upi_link    = 'upi://pay?pa=' . rawurlencode( $ultra_image_optimizer_upi_id ) . '&pn=' . rawurlencode( $ultra_image_optimizer_upi_name ) . '&cu=INR';
		?>
<div class="wrap naveencodes-wrap">
	<?php include NAVEENCODES_DIR . 'templates/admin-banner.php'; ?>
	<div class="naveencodes-header">
		<div>
			<h1><?php esc_html_e( 'Support Development', 'naveencodes-image-optimizer' ); ?></h1>
			<p class="naveencodes-subtitle"><?php esc_html_e( 'NaveenCodes Image Optimizer stays fully free. If the plugin is useful for your website, you can support its ongoing development with an optional donation.', 'naveencodes-image-optimizer' ); ?></p>
		</div>
	</div>

	<div class="naveencodes-panel">
		<div class="naveencodes-callout">
			<strong><?php esc_html_e( 'No features are locked.', 'naveencodes-image-optimizer' ); ?></strong>
			<?php esc_html_e( 'Donations are completely optional. The plugin remains fully usable without payment, with no ads, no nag screens, and no tracking.', 'naveencodes-image-optimizer' ); ?>
		</div>

		<p class="naveencodes-help">
			<?php esc_html_e( 'This website has already saved', 'naveencodes-image-optimizer' ); ?>
			<?php echo esc_html( $ultra_image_optimizer_saved_total ); ?>
			<?php esc_html_e( 'with NaveenCodes Image Optimizer.', 'naveencodes-image-optimizer' ); ?>
		</p>

		<div class="naveencodes-donate-grid">
			<div class="naveencodes-donate-card naveencodes-donate-card--qr">
				<p class="naveencodes-card-label"><?php esc_html_e( 'Scan to Pay', 'naveencodes-image-optimizer' ); ?></p>
				<h2><?php esc_html_e( 'Support with UPI', 'naveencodes-image-optimizer' ); ?></h2>
				<div class="naveencodes-qr-frame">
					<img src="<?php echo esc_url( NAVEENCODES_URL . 'assets/img/upi-qr.png' ); ?>" alt="<?php esc_attr_e( 'UPI QR code for Naveen Kumar', 'naveencodes-image-optimizer' ); ?>" />
				</div>
				<div class="naveencodes-donate-meta">
					<div>
						<p class="naveencodes-help"><?php esc_html_e( 'Payee', 'naveencodes-image-optimizer' ); ?></p>
						<p class="naveencodes-card-value"><?php echo esc_html( $ultra_image_optimizer_upi_name ); ?></p>
					</div>
					<div>
						<p class="naveencodes-help"><?php esc_html_e( 'UPI ID', 'naveencodes-image-optimizer' ); ?></p>
						<span class="naveencodes-upi-pill"><?php echo esc_html( $ultra_image_optimizer_upi_id ); ?></span>
					</div>
				</div>
			</div>

			<div class="naveencodes-donate-meta">
				<div class="naveencodes-donate-card">
					<p class="naveencodes-card-label"><?php esc_html_e( 'How to Donate', 'naveencodes-image-optimizer' ); ?></p>
					<h2><?php esc_html_e( 'Use any UPI app', 'naveencodes-image-optimizer' ); ?></h2>
					<p class="naveencodes-help"><?php esc_html_e( 'Scan the QR code with Google Pay, PhonePe, Paytm, BHIM, Kotak 811, or any other UPI app. If you are on mobile, you can also open the payment link directly.', 'naveencodes-image-optimizer' ); ?></p>
					<div class="naveencodes-actions">
						<a class="button button-primary" href="<?php echo esc_url( $ultra_image_optimizer_upi_link, array( 'upi' ) ); ?>"><?php esc_html_e( 'Open UPI App', 'naveencodes-image-optimizer' ); ?></a>
					</div>
				</div>

				<div class="naveencodes-donate-card">
					<p class="naveencodes-card-label"><?php esc_html_e( 'Payment Details', 'naveencodes-image-optimizer' ); ?></p>
					<div class="naveencodes-donate-meta-item">
						<strong><?php esc_html_e( 'Account Name', 'naveencodes-image-optimizer' ); ?></strong>
						<span><?php echo esc_html( $ultra_image_optimizer_upi_name ); ?></span>
					</div>
					<div class="naveencodes-donate-meta-item">
						<strong><?php esc_html_e( 'UPI ID', 'naveencodes-image-optimizer' ); ?></strong>
						<span><?php echo esc_html( $ultra_image_optimizer_upi_id ); ?></span>
					</div>
					<div class="naveencodes-donate-meta-item">
						<strong><?php esc_html_e( 'Note', 'naveencodes-image-optimizer' ); ?></strong>
						<span><?php esc_html_e( 'Donations are optional and go toward plugin maintenance, testing, and infrastructure costs.', 'naveencodes-image-optimizer' ); ?></span>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
		<?php
	}
)( $banner, $stats );
