<?php

/**
 * Provide a admin area view for the plugin help and support
 *
 * This file is used to markup the help and support page.
 *
 * @link       http://example.com
 * @since      1.0.0
 *
 * @package    Subscription_System
 * @subpackage Subscription_System/admin/partials
 */

// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>

<div class="wrap">
	
	<div class="subscription-system-help-content">
		
		<!-- Available Shortcodes Section -->
		<div class="help-section">
			<h2><?php esc_html_e( 'Available Shortcodes', 'subscription-system' ); ?></h2>
			
			<div class="shortcode-section">
				<h3><?php esc_html_e( 'Registration Form Shortcode', 'subscription-system' ); ?></h3>
				<div class="shortcode-display">
					<textarea readonly rows="1">[subs_sys_register]</textarea>
					<div class="shortcode-actions">
						<button class="button copy-shortcode" data-shortcode="subs_sys_register">
							<?php esc_html_e( 'Copy', 'subscription-system' ); ?>
						</button>
					</div>
					<p class="shortcode-note">
						<?php esc_html_e( 'Legacy shortcode [subscription_register] is still supported for backward compatibility.', 'subscription-system' ); ?>
					</p>
				</div>
				
				<h4><?php esc_html_e( 'Features:', 'subscription-system' ); ?></h4>
				<ul class="feature-list">
					<li><?php esc_html_e( 'Username field (required)', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Email field (required)', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Password field (required)', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Built-in security with nonce verification', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Input validation and sanitization', 'subscription-system' ); ?></li>
				</ul>
				
				<h4><?php esc_html_e( 'Usage Example:', 'subscription-system' ); ?></h4>
				<p><?php esc_html_e( 'Simply add the shortcode to any page or post where you want the registration form to appear:', 'subscription-system' ); ?></p>
				<div class="code-example">
					<textarea readonly rows="3">[subs_sys_register]</textarea>
				</div>
			</div>
			
			<div class="shortcode-section">
				<h3><?php esc_html_e( 'Login Form Shortcode', 'subscription-system' ); ?></h3>
				<div class="shortcode-display">
					<textarea readonly rows="1">[subs_sys_login]</textarea>
					<div class="shortcode-actions">
						<button class="button copy-shortcode" data-shortcode="subs_sys_login">
							<?php esc_html_e( 'Copy', 'subscription-system' ); ?>
						</button>
					</div>
					<p class="shortcode-note">
						<?php esc_html_e( 'Legacy shortcode [subscription_login] is still supported for backward compatibility.', 'subscription-system' ); ?>
					</p>
				</div>
				
				<h4><?php esc_html_e( 'Features:', 'subscription-system' ); ?></h4>
				<ul class="feature-list">
					<li><?php esc_html_e( 'Username or email field (required)', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Password field (required)', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Remember me checkbox', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Built-in security with nonce verification', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Automatic redirect after successful login', 'subscription-system' ); ?></li>
				</ul>
				
				<h4><?php esc_html_e( 'Usage Example:', 'subscription-system' ); ?></h4>
				<p><?php esc_html_e( 'Add the shortcode to any page or post where you want the login form to appear:', 'subscription-system' ); ?></p>
				<div class="code-example">
					<textarea readonly rows="3">[subs_sys_login]</textarea>
				</div>
			</div>
		</div>

		<!-- Configuration Section -->
		<div class="help-section">
			<h2><?php esc_html_e( 'Configuration', 'subscription-system' ); ?></h2>
			
			<h3><?php esc_html_e( 'Plugin Settings', 'subscription-system' ); ?></h3>
			<p><?php esc_html_e( 'You can configure the plugin settings by navigating to:', 'subscription-system' ); ?></p>
			<p><strong><?php esc_html_e( 'Subscription System → Settings', 'subscription-system' ); ?></strong></p>
			
			<h4><?php esc_html_e( 'Available Settings:', 'subscription-system' ); ?></h4>
			<ul class="feature-list">
				<li><strong><?php esc_html_e( 'Enable User Registration:', 'subscription-system' ); ?></strong> <?php esc_html_e( 'Controls whether users can register through the subscription forms.', 'subscription-system' ); ?></li>
			</ul>
			
			<div class="settings-link">
				<a href="<?php echo esc_url( admin_url( 'admin.php?page=subs-sys-mh-settings' ) ); ?>" class="button button-primary">
					<?php esc_html_e( 'Go to Settings', 'subscription-system' ); ?>
				</a>
			</div>
		</div>

		<!-- Troubleshooting Section -->
		<div class="help-section">
			<h2><?php esc_html_e( 'Troubleshooting', 'subscription-system' ); ?></h2>
			
			<h3><?php esc_html_e( 'Common Issues', 'subscription-system' ); ?></h3>
			
			<div class="troubleshoot-item">
				<h4><?php esc_html_e( 'Registration form not appearing', 'subscription-system' ); ?></h4>
				<ul>
					<li><?php esc_html_e( 'Make sure user registration is enabled in the plugin settings', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Check that you\'re using the correct shortcode: [subs_sys_register]', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Verify that the plugin is activated', 'subscription-system' ); ?></li>
				</ul>
			</div>
			
			<div class="troubleshoot-item">
				<h4><?php esc_html_e( 'Login form not working', 'subscription-system' ); ?></h4>
				<ul>
					<li><?php esc_html_e( 'Check that you\'re using the correct shortcode: [subs_sys_login]', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Make sure the user account exists and is active', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Verify that WordPress user registration is enabled', 'subscription-system' ); ?></li>
				</ul>
			</div>
			
			<div class="troubleshoot-item">
				<h4><?php esc_html_e( 'Forms showing security errors', 'subscription-system' ); ?></h4>
				<ul>
					<li><?php esc_html_e( 'Clear your browser cache and try again', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Make sure you\'re not using any caching plugins that might interfere', 'subscription-system' ); ?></li>
					<li><?php esc_html_e( 'Check that your WordPress installation is up to date', 'subscription-system' ); ?></li>
				</ul>
			</div>
		</div>

		<!-- Support Section -->
		<div class="help-section">
			<h2><?php esc_html_e( 'Support', 'subscription-system' ); ?></h2>
			
			<div class="support-grid">
				<div class="support-card">
					<div class="support-icon">
						<span class="dashicons dashicons-book-alt"></span>
					</div>
					<h3><?php esc_html_e( 'Documentation', 'subscription-system' ); ?></h3>
					<p><?php esc_html_e( 'Comprehensive guides and tutorials for using the Subscription System plugin.', 'subscription-system' ); ?></p>
					<a href="<?php echo esc_url( 'https://mediahubster.in/subscription-system/docs' ); ?>" class="button" target="_blank" rel="noopener noreferrer">
						<?php esc_html_e( 'View Documentation', 'subscription-system' ); ?>
					</a>
				</div>
				
				<div class="support-card">
					<div class="support-icon">
						<span class="dashicons dashicons-sos"></span>
					</div>
					<h3><?php esc_html_e( 'Get Support', 'subscription-system' ); ?></h3>
					<p><?php esc_html_e( 'Need help? Our support team is here to assist you with any questions or issues.', 'subscription-system' ); ?></p>
					<a href="<?php echo esc_url( 'mailto:support@mediahubster.in' ); ?>" class="button">
						<?php esc_html_e( 'Contact Support', 'subscription-system' ); ?>
					</a>
				</div>
				
				<div class="support-card">
					<div class="support-icon">
						<span class="dashicons dashicons-star-filled"></span>
					</div>
					<h3><?php esc_html_e( 'Rate Plugin', 'subscription-system' ); ?></h3>
					<p><?php esc_html_e( 'Love the plugin? Please consider leaving a review to help others discover it.', 'subscription-system' ); ?></p>
					<a href="<?php echo esc_url( 'https://wordpress.org/plugins/subscription-system/' ); ?>" class="button" target="_blank" rel="noopener noreferrer">
						<?php esc_html_e( 'Leave Review', 'subscription-system' ); ?>
					</a>
				</div>
			</div>
		</div>

	</div>
</div>
