<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}


?>

<!-- HELP PAGE HTML -->
<div class="ak-help-container">
	<h3 class="ak-title"><?php esc_html_e( '🛠️ Plugin Help & Support', 'author-kit' ); ?></h3>

	<!-- Quick Access Section -->
	<div class="ak-section">
		<h2><?php esc_html_e( '🔗 Quick Access', 'author-kit' ); ?></h2>
		<ul class="ak-links">
			<li><a href="#" target="_blank"><?php esc_html_e( '📄 Documentation – Setup guides & tutorials', 'author-kit' ); ?></a></li>
			<li><a href="https://wordpress.org/support/plugin/author-kit/" target="_blank"><?php esc_html_e( '💬 Support Page – Forum & tickets', 'author-kit' ); ?></a></li>
			<li><a href="mailto:authorkit.wp@gmail.com"><?php esc_html_e( '📧 Email Us – Reach out directly', 'author-kit' ); ?></a></li>
		</ul>
	</div>

	<!-- Download Files Section -->
	<div class="ak-section">
		<h2><?php esc_html_e( '🧰 Diagnostic Tools', 'author-kit' ); ?></h2>
		<div class="ak-buttons">
			<a href="
			<?php
			echo esc_url(
				wp_nonce_url( admin_url( 'admin-post.php?action=author_kit_download_log' ), 'author_kit_download_log' )
			);
			?>
			" class="ak-btn">
				<?php esc_html_e( '⬇️ Download Log File', 'author-kit' ); ?>
			</a>

			<a id="system" href="
			<?php
			echo esc_url(
				wp_nonce_url( admin_url( 'admin-post.php?action=author_kit_download_sys_report' ), 'author_kit_download_sys_report' )
			);
			?>
			" class="ak-btn">
				<?php esc_html_e( '📄 Download System Report', 'author-kit' ); ?>
			</a>
		</div>
		<p class="ak-note"><?php esc_html_e( '📝 Note: These files are crucial to debug the Author Kit issue. Please download and send them to us via email.', 'author-kit' ); ?></p>
	</div>

	<!-- Email Form Submission -->
	<div class="ak-section">
		<h2><?php esc_html_e( '✉️ Contact Support', 'author-kit' ); ?></h2>
		<form method="post" enctype="multipart/form-data" class="ak-form" id="ak-help-form">
			<div class="ak-grid">
				<input type="text" name="help_name" id="help_name" placeholder="<?php esc_attr_e( 'Your Full Name', 'author-kit' ); ?>" required>
				<input type="email" name="help_email" id="help_email" placeholder="<?php esc_attr_e( 'Your Email Address', 'author-kit' ); ?>" required>
			</div>
			<input type="text" name="help_subject" id="help_subject" placeholder="<?php esc_attr_e( 'Subject of Your Request', 'author-kit' ); ?>" required>
			<textarea name="help_message" id="help_message" rows="5" placeholder="<?php esc_attr_e( 'Describe your issue or question...', 'author-kit' ); ?>" required></textarea>

			<label class="ak-file-label"><?php esc_html_e( '📎 Attach a file (optional):', 'author-kit' ); ?></label>
			<input type="file" name="help_file[]" id="help_file" multiple>

			<div class="ak-privacy">
				<input type="checkbox" name="privacy_check" required>
				<span>
					<?php
					printf(
						/* translators: %1$s and %2$s are the opening and closing of anchor tag respectively */
						esc_html__( 'I agree to the %1$sPrivacy Policy%1$s', 'author-kit' ),
						'<a href="https://authorkit.pro/privacy-policy" target="_blank">',
						'</a>'
					);
					?>
				</span>
			</div>

			<button  id="ak-form-submit" type="submit" class="ak-submit author-kit-btn">
				<?php esc_html_e( '🚀 Submit Support Request', 'author-kit' ); ?>
			</button>
		</form>
	</div>
</div>
