<?php
/**
 * Help page view
 *
 * @package WebEquipe\PDFSearch
 * @since 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>
<div class="wrap">
	<?php \WebEquipe\PDFSearch\Admin_Settings::render_pro_banner(); ?>

	<h1><?php esc_html_e( 'WebEquipe PDF Search - Help & Documentation', 'webequipe-pdf-search' ); ?></h1>

	<div class="webequipe-pdf-search-help">
		
		<div class="card">
			<h2><?php esc_html_e( 'What is This Plugin?', 'webequipe-pdf-search' ); ?></h2>
			<p><?php esc_html_e( 'WebEquipe PDF Search makes your PDF files searchable on your WordPress website. When visitors search your site, they can find content inside your PDF documents, not just your regular pages and posts.', 'webequipe-pdf-search' ); ?></p>
			<p><?php esc_html_e( 'For example, if you have a PDF manual that mentions "WordPress", visitors searching for "WordPress" will find that PDF in the search results.', 'webequipe-pdf-search' ); ?></p>
		</div>

		<div class="card">
			<h2><?php esc_html_e( 'Getting Started', 'webequipe-pdf-search' ); ?></h2>
			<p><?php esc_html_e( 'The plugin works automatically once activated. Here\'s what you need to know:', 'webequipe-pdf-search' ); ?></p>
			
			<h3><?php esc_html_e( 'Step 1: Configure Settings', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'Go to Settings → PDF Search to review and adjust the plugin settings. Most default settings work well for most websites, but you can customize:', 'webequipe-pdf-search' ); ?></p>
			<ul>
				<li><?php esc_html_e( 'Maximum file size for PDFs to index', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'How PDF results appear in search results', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'Whether to process large PDFs in the background', 'webequipe-pdf-search' ); ?></li>
			</ul>

			<h3><?php esc_html_e( 'Step 2: Index Your Existing PDFs', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'If you already have PDFs in your media library, click the "Re-index All PDFs" button in Settings → PDF Search. This will make all your existing PDFs searchable.', 'webequipe-pdf-search' ); ?></p>
			<p><strong><?php esc_html_e( 'Note:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'New PDFs you upload will be automatically indexed, so you only need to do this once for existing files.', 'webequipe-pdf-search' ); ?></p>

			<h3><?php esc_html_e( 'Step 3: Test It Out', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'Try searching your website for a word or phrase that you know appears in one of your PDFs. You should see the PDF appear in the search results!', 'webequipe-pdf-search' ); ?></p>
		</div>

		<div class="card">
			<h2><?php esc_html_e( 'Understanding the Settings', 'webequipe-pdf-search' ); ?></h2>
			<p><?php esc_html_e( 'Go to Settings → PDF Search to configure how the plugin works. Here\'s what each setting does:', 'webequipe-pdf-search' ); ?></p>
			
			<h3><?php esc_html_e( 'General Settings', 'webequipe-pdf-search' ); ?></h3>
			
			<h4><?php esc_html_e( 'Enable PDF Indexing', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When checked, PDFs will be automatically indexed when you upload them to your media library. We recommend keeping this enabled unless you want to manually control which PDFs get indexed.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Enable Search Integration', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When checked, PDFs will appear in your website\'s search results. If you uncheck this, PDFs will still be indexed but won\'t show up when visitors search your site. We recommend keeping this enabled.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Maximum File Size', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'This is the largest PDF file size (in bytes) that the plugin will try to index. The default is 50MB (52,428,800 bytes). If you have very large PDFs, you can increase this number. However, very large files may take a long time to process.', 'webequipe-pdf-search' ); ?></p>
			<p><strong><?php esc_html_e( 'Tip:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( '1 MB = 1,048,576 bytes. So 50 MB = 52,428,800 bytes.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Search Result Excerpt Length', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'This controls how much text from the PDF is shown in search results. The default is 200 characters. You can increase this to show more context, or decrease it to show less. This is just for display purposes - the full PDF content is still searchable.', 'webequipe-pdf-search' ); ?></p>

			<h3><?php esc_html_e( 'Indexing Options', 'webequipe-pdf-search' ); ?></h3>
			
			<h4><?php esc_html_e( 'Batch Size', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When you click "Re-index All PDFs", the plugin processes PDFs in batches. This setting controls how many PDFs are processed in each admin request. The default is 10. If you have a powerful server, you can increase this number to process PDFs faster. If you experience timeouts or errors, try reducing this number.', 'webequipe-pdf-search' ); ?></p>
			<p><?php esc_html_e( 'If Re-index All stops after about 30 seconds no matter what Processing Timeout is set to, lower Batch Size (for example to 1–3) and see Processing Timeout under Advanced Settings below. That usually means your host enforces a PHP or web-server time limit on each request.', 'webequipe-pdf-search' ); ?></p>

			<h4><?php esc_html_e( 'Pages Per Batch', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When indexing large PDFs page by page, this is how many pages are processed in each background or cron step. The default is 5. Lower this value if indexing stops early or times out; raise it only on fast servers with higher PHP time limits.', 'webequipe-pdf-search' ); ?></p>

			<h4><?php esc_html_e( 'Page Index Threshold', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'PDFs with more pages than this number use background page-by-page indexing instead of indexing the whole file in one step. The default is 50. Large manuals or catalogs benefit from background mode; small PDFs are indexed immediately.', 'webequipe-pdf-search' ); ?></p>

			<h4><?php esc_html_e( 'Max Page Content Length', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'Maximum characters stored per page in the search index. The default is 0 (unlimited per page). Set a limit only if you need to control database size. After changing this value, re-index affected PDFs so the new limit applies.', 'webequipe-pdf-search' ); ?></p>

			<h4><?php esc_html_e( 'Text-based and image-based PDFs', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'Only text-based PDFs can be indexed and searched. Image-based PDFs (for example, scanned documents saved as pictures) do not contain extractable text and cannot be parsed. The plugin marks them as Error with guidance to upload a text-based PDF instead.', 'webequipe-pdf-search' ); ?></p>
			<p><?php esc_html_e( 'If a PDF has both text-based pages and image-based pages, indexing succeeds and search covers the text-based pages only. You will see an Indexed status with a warning that lists how many pages could not be parsed.', 'webequipe-pdf-search' ); ?></p>

			<h3><?php esc_html_e( 'Search Display Options', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'These settings control how PDF results appear in your search results:', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Show PDF Icon', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When checked, a PDF icon will appear next to PDF results in search results. This helps visitors identify which results are PDF files. We recommend keeping this enabled.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Show File Size', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When checked, the file size (like "2.5 MB") will be shown in search results. This helps visitors know how large the PDF is before downloading it.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Show Number of Pages', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When checked, the number of pages (like "42") will be shown in search results. This helps visitors know how long the document is.', 'webequipe-pdf-search' ); ?></p>

			<h4><?php esc_html_e( 'Show Last Updated Date', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When checked, the last updated date for the PDF will be shown in search results.', 'webequipe-pdf-search' ); ?></p>

			<h4><?php esc_html_e( 'Show PDF Preview', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When checked, a PDF thumbnail preview will be shown under the meta line in search results (if WordPress has generated a preview image).', 'webequipe-pdf-search' ); ?></p>
			<p><?php esc_html_e( 'Some themes (e.g. Avada Classic) use their own search results layout and may still show a featured image. When this option is unchecked, the plugin adds the body class webequipe-pdf-preview-off on the search page and includes CSS to hide the theme’s post card image for PDF results. If the image still appears, add custom CSS in your theme (e.g. Avada → Theme Options → Custom CSS) targeting your theme’s post card image when body has class webequipe-pdf-preview-off.', 'webequipe-pdf-search' ); ?></p>

			<h3><?php esc_html_e( 'Customizing the Search Results List', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'You can control what appears in each PDF search result by using the "Search Display Options" settings (icon, file size, number of pages, last updated date, and preview).', 'webequipe-pdf-search' ); ?></p>

			<h4><?php esc_html_e( 'Default Layout', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'Each PDF result: title (with icon), then meta line (e.g. Author, Size, Page, Date), then optional preview and summary.', 'webequipe-pdf-search' ); ?></p>

			<h4><?php esc_html_e( 'Styling with CSS', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'To match your theme, add overrides in Appearance → Customize → Additional CSS. For the full list of CSS classes (form and results), see the shortcode section below.', 'webequipe-pdf-search' ); ?></p>

			<h3><?php esc_html_e( 'Advanced Settings', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'These settings are for advanced users. Most websites work fine with the default values:', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Enable Debug Logging', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When enabled, the plugin will log detailed information about indexing and search operations. This is useful for troubleshooting problems. Only enable this if you\'re experiencing issues or if a support person asks you to enable it.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Memory Limit', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'This controls how much server memory (RAM) the plugin can use when processing PDFs. The default is 256M (256 megabytes). Only change this if you\'re experiencing memory errors or if you have very large PDFs. Most users should leave this at the default.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Processing Timeout', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'This setting tells PHP how much time to allow for each indexing step (per PDF or per page batch). The default is 60 seconds. The plugin requests extra time using PHP’s set_time_limit() when your host allows it.', 'webequipe-pdf-search' ); ?></p>
			<p><strong><?php esc_html_e( 'Important:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'This is not a guaranteed timer inside the plugin. It cannot override hard limits set by your hosting company, such as PHP max_execution_time, disabled set_time_limit, PHP-FPM request limits, or web server/proxy timeouts.', 'webequipe-pdf-search' ); ?></p>
			<p><?php esc_html_e( 'Why does indexing stop at about 30 seconds? Many hosts default PHP to 30 seconds or disable set_time_limit. In that case, raising Processing Timeout in the plugin has no effect—the server still stops the script at ~30 seconds.', 'webequipe-pdf-search' ); ?></p>
			<p><?php esc_html_e( 'What to try if indexing stops early:', 'webequipe-pdf-search' ); ?></p>
			<ul>
				<li><?php esc_html_e( 'Lower Batch Size (Indexing Options) so each Re-index request does less work.', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'Lower Pages Per Batch so each background step indexes fewer pages.', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'Keep Enable Background Processing on for large PDFs; on production sites, use a real server cron job so WordPress cron runs reliably.', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'Ask your host to increase max_execution_time and to allow set_time_limit (not listed in disable_functions).', 'webequipe-pdf-search' ); ?></li>
			</ul>
			<p><?php esc_html_e( 'Tip: Re-index a single PDF. If it still fails at about 30 seconds, the limit is almost certainly on the server, not this plugin setting.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Enable Background Processing', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When enabled, large PDFs are processed in the background instead of blocking the browser—large files over 10MB on upload, and PDFs with more pages than Page Index Threshold during re-index. We recommend keeping this enabled.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Delete Data on Uninstall', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'When checked, all plugin data (including the PDF index) will be deleted when you uninstall the plugin. If unchecked, the data will remain in your database even after uninstalling. We recommend leaving this unchecked unless you\'re sure you want to permanently delete all PDF search data.', 'webequipe-pdf-search' ); ?></p>

			<h3><?php esc_html_e( 'Bulk Actions', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'At the bottom of the settings page, you\'ll find bulk action buttons:', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Re-index All PDFs', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'Indexes all PDFs in your media library (skips Excluded). Use after first install or to refresh the index. See Managing Your PDFs below for details.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Clear Index', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'Removes all PDFs from the search index. You must run "Re-index All PDFs" afterward to rebuild. This cannot be undone.', 'webequipe-pdf-search' ); ?></p>

			<h4><?php esc_html_e( 'Manage PDFs Section', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'In the "Manage PDFs" section, you can scan your media library to see all PDFs and manage them individually or in bulk. After clicking "Scan PDFs", you\'ll see a list with the following bulk actions:', 'webequipe-pdf-search' ); ?></p>
			<ul>
				<li><strong><?php esc_html_e( 'Index Selected PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Index all selected PDFs that are not excluded. Excluded PDFs will be skipped automatically.', 'webequipe-pdf-search' ); ?></li>
				<li><strong><?php esc_html_e( 'Unindex Selected PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Remove all selected PDFs from the search index (does not exclude them).', 'webequipe-pdf-search' ); ?></li>
				<li><strong><?php esc_html_e( 'Include Selected PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Clear the exclusion flag from selected PDFs, making them eligible for indexing. This does not index them - use "Index Selected PDFs" after including them.', 'webequipe-pdf-search' ); ?></li>
				<li><strong><?php esc_html_e( 'Exclude Selected PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Permanently exclude all selected PDFs from indexing. They will be skipped even when using "Re-index All PDFs".', 'webequipe-pdf-search' ); ?></li>
			</ul>
			<p><strong><?php esc_html_e( 'Tip:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'You can filter the PDF list by status (Indexed, Not Indexed, Excluded, Errors) and search by PDF name to quickly find the PDFs you want to manage.', 'webequipe-pdf-search' ); ?></p>
		</div>

		<div class="card">
			<h2><?php esc_html_e( 'Managing Your PDFs', 'webequipe-pdf-search' ); ?></h2>
			<p><?php esc_html_e( 'You can see and manage which PDFs are indexed by going to Media → Library. A new column called "Search Indexed" shows the status of each PDF.', 'webequipe-pdf-search' ); ?></p>
			
			<h3><?php esc_html_e( 'Understanding the Status Icons', 'webequipe-pdf-search' ); ?></h3>
			<ul class="status-list">
				<li>
					<span class="dashicons dashicons-yes-alt"></span> 
					<strong><?php esc_html_e( 'Indexed', 'webequipe-pdf-search' ); ?></strong> 
					<span><?php esc_html_e( '- This PDF is searchable. Visitors can find it when searching your site.', 'webequipe-pdf-search' ); ?></span>
				</li>
				<li>
					<span class="dashicons dashicons-minus"></span> 
					<strong><?php esc_html_e( 'Not Indexed', 'webequipe-pdf-search' ); ?></strong> 
					<span><?php esc_html_e( '- This PDF hasn\'t been indexed yet. It won\'t appear in search results.', 'webequipe-pdf-search' ); ?></span>
				</li>
				<li>
					<span class="dashicons dashicons-hidden"></span> 
					<strong><?php esc_html_e( 'Excluded', 'webequipe-pdf-search' ); ?></strong> 
					<span><?php esc_html_e( '- This PDF is excluded from indexing. It will never be indexed, even when you click "Re-index All PDFs".', 'webequipe-pdf-search' ); ?></span>
				</li>
				<li>
					<span class="dashicons dashicons-warning"></span> 
					<strong><?php esc_html_e( 'Error', 'webequipe-pdf-search' ); ?></strong> 
					<span><?php esc_html_e( '- Something went wrong while trying to index this PDF. Hover over the icon to see the error message.', 'webequipe-pdf-search' ); ?></span>
				</li>
			</ul>

			<h3><?php esc_html_e( 'What Can You Do With Each PDF?', 'webequipe-pdf-search' ); ?></h3>
			
			<div class="info-box">
				<h4><?php esc_html_e( 'If a PDF is "Not Indexed":', 'webequipe-pdf-search' ); ?></h4>
				<ul>
					<li><strong><?php esc_html_e( 'Index', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Click this to make this specific PDF searchable right now.', 'webequipe-pdf-search' ); ?></li>
					<li><strong><?php esc_html_e( 'Exclude', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Click this if you never want this PDF to be searchable. This is useful for private documents, drafts, or files you don\'t want visitors to find.', 'webequipe-pdf-search' ); ?></li>
				</ul>
			</div>

			<div class="info-box">
				<h4><?php esc_html_e( 'If a PDF is "Indexed":', 'webequipe-pdf-search' ); ?></h4>
				<ul>
					<li><strong><?php esc_html_e( 'Unindex', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Click this to remove this PDF from search results temporarily. You can add it back later by clicking "Re-index All PDFs" or by clicking "Index" on this specific file.', 'webequipe-pdf-search' ); ?></li>
					<li><strong><?php esc_html_e( 'Exclude', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Click this if you never want this PDF to be searchable. Even if you click "Re-index All PDFs", this PDF will be skipped.', 'webequipe-pdf-search' ); ?></li>
				</ul>
			</div>

			<div class="info-box">
				<h4><?php esc_html_e( 'If a PDF is "Excluded":', 'webequipe-pdf-search' ); ?></h4>
				<ul>
					<li><strong><?php esc_html_e( 'Index', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Click this to remove the exclusion and make this PDF searchable immediately. This will clear the exclusion flag and index the PDF in one step.', 'webequipe-pdf-search' ); ?></li>
				</ul>
				<p><strong><?php esc_html_e( 'Note:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'Excluded PDFs will be skipped when using bulk "Index PDFs" actions. To include excluded PDFs in bulk operations, first use "Include PDFs" to clear the exclusion, then use "Index PDFs" to index them.', 'webequipe-pdf-search' ); ?></p>
			</div>

			<h3><?php esc_html_e( 'Bulk Actions - Managing Multiple PDFs at Once', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'If you need to manage many PDFs at once, you can use bulk actions in the Media Library:', 'webequipe-pdf-search' ); ?></p>
			<ol>
				<li><?php esc_html_e( 'Go to Media → Library', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'Select multiple PDFs by checking the boxes next to the files you want to manage', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'In the "Bulk Actions" dropdown at the top of the list, choose one of these options:', 'webequipe-pdf-search' ); ?>
					<ul>
						<li><strong><?php esc_html_e( 'Index PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Index all selected PDFs that are not excluded. Excluded PDFs will be skipped automatically.', 'webequipe-pdf-search' ); ?></li>
						<li><strong><?php esc_html_e( 'Unindex PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Remove all selected PDFs from the search index (does not exclude them).', 'webequipe-pdf-search' ); ?></li>
						<li><strong><?php esc_html_e( 'Include PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Clear the exclusion flag from selected PDFs, making them eligible for indexing. This does not index them - use "Index PDFs" after including them.', 'webequipe-pdf-search' ); ?></li>
						<li><strong><?php esc_html_e( 'Exclude PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Permanently exclude all selected PDFs from indexing. They will be skipped even when using "Re-index All PDFs".', 'webequipe-pdf-search' ); ?></li>
					</ul>
				</li>
				<li><?php esc_html_e( 'Click the "Apply" button', 'webequipe-pdf-search' ); ?></li>
			</ol>
			<p><?php esc_html_e( 'After processing, you\'ll see a message showing how many PDFs were processed, how many failed, and how many were skipped (if any were not PDF files or were excluded).', 'webequipe-pdf-search' ); ?></p>
			<p><strong><?php esc_html_e( 'Tip:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'Bulk actions only work on PDF files. If you select non-PDF files, they will be skipped automatically.', 'webequipe-pdf-search' ); ?></p>
			<p><strong><?php esc_html_e( 'Working with Excluded PDFs:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'If you want to include and index previously excluded PDFs, use a two-step process: First, select the excluded PDFs and choose "Include PDFs" to clear the exclusion flag. Then, select the same PDFs again and choose "Index PDFs" to index them.', 'webequipe-pdf-search' ); ?></p>

			<h3><?php esc_html_e( 'Re-indexing All PDFs', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'The "Re-index All PDFs" button in Settings → PDF Search will:', 'webequipe-pdf-search' ); ?></p>
			<ul>
				<li><?php esc_html_e( 'Index all PDFs that are not currently indexed', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'Re-index PDFs that were previously indexed (useful if you updated the PDF file)', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'Skip any PDFs you\'ve marked as "Excluded"', 'webequipe-pdf-search' ); ?></li>
			</ul>
			<p><strong><?php esc_html_e( 'Tip:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'If you update a PDF file, you should re-index it so the search results reflect the new content. You can either click "Re-index All PDFs" or just click "Index" on that specific PDF in the Media Library.', 'webequipe-pdf-search' ); ?></p>
		</div>

		<div class="card" id="shortcode-section">
			<h2><?php esc_html_e( 'Adding a PDF Search Form to Your Pages', 'webequipe-pdf-search' ); ?></h2>
			<p><?php esc_html_e( 'You can add a dedicated PDF search form anywhere on your website using a shortcode. This is useful if you want visitors to search specifically for PDFs.', 'webequipe-pdf-search' ); ?></p>
			
			<h3><?php esc_html_e( 'Basic Usage', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'Simply add this shortcode to any page, post, or widget:', 'webequipe-pdf-search' ); ?></p>
			<code>[webequipe_pdf_search_form]</code>
			
			<h3><?php esc_html_e( 'All Available Parameters', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'You can customize the search form by adding options to the shortcode:', 'webequipe-pdf-search' ); ?></p>
			<table class="shortcode-table">
				<thead>
					<tr>
						<th><?php esc_html_e( 'Parameter', 'webequipe-pdf-search' ); ?></th>
						<th><?php esc_html_e( 'Default', 'webequipe-pdf-search' ); ?></th>
						<th><?php esc_html_e( 'Description', 'webequipe-pdf-search' ); ?></th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td><code>placeholder</code></td>
						<td><?php esc_html_e( 'Search PDFs...', 'webequipe-pdf-search' ); ?></td>
						<td><?php esc_html_e( 'Placeholder text shown in the search input field', 'webequipe-pdf-search' ); ?></td>
					</tr>
					<tr>
						<td><code>button_text</code></td>
						<td><?php esc_html_e( 'Search', 'webequipe-pdf-search' ); ?></td>
						<td><?php esc_html_e( 'Text displayed on the search button', 'webequipe-pdf-search' ); ?></td>
					</tr>
					<tr>
						<td><code>search_type</code></td>
						<td><?php esc_html_e( 'all', 'webequipe-pdf-search' ); ?></td>
						<td><?php esc_html_e( 'Set to "pdf_only" to search only PDFs, or "all" to search all content including PDFs', 'webequipe-pdf-search' ); ?></td>
					</tr>
					<tr>
						<td><code>results_per_page</code></td>
						<td>10</td>
						<td><?php esc_html_e( 'Number of results to show per page', 'webequipe-pdf-search' ); ?></td>
					</tr>
					<tr>
						<td><code>classes</code></td>
						<td><?php esc_html_e( '(empty)', 'webequipe-pdf-search' ); ?></td>
						<td><?php esc_html_e( 'Additional CSS classes for custom styling (separate multiple classes with spaces)', 'webequipe-pdf-search' ); ?></td>
					</tr>
				</tbody>
			</table>
			
			<h3><?php esc_html_e( 'Examples', 'webequipe-pdf-search' ); ?></h3>
			
			<h4><?php esc_html_e( 'Example 1: Basic Customization', 'webequipe-pdf-search' ); ?></h4>
			<code>[webequipe_pdf_search_form placeholder="Search documents..." button_text="Find"]</code>
			<p><?php esc_html_e( 'Custom placeholder and button text.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Example 2: PDF-Only Search', 'webequipe-pdf-search' ); ?></h4>
			<code>[webequipe_pdf_search_form search_type="pdf_only"]</code>
			<p><?php esc_html_e( 'This form will only search PDF files, not regular pages or posts.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Example 3: Custom Results Per Page', 'webequipe-pdf-search' ); ?></h4>
			<code>[webequipe_pdf_search_form results_per_page="5"]</code>
			<p><?php esc_html_e( 'Shows 5 results per page instead of the default 10.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Example 4: With Custom CSS Classes', 'webequipe-pdf-search' ); ?></h4>
			<code>[webequipe_pdf_search_form classes="my-custom-class homepage-search"]</code>
			<p><?php esc_html_e( 'Adds custom CSS classes for styling specific instances of the search form.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Example 5: Full Customization', 'webequipe-pdf-search' ); ?></h4>
			<code>[webequipe_pdf_search_form placeholder="Search our PDF library..." button_text="Find Documents" results_per_page="15" search_type="pdf_only" classes="custom-search-form"]</code>
			<p><?php esc_html_e( 'Combines all customization options.', 'webequipe-pdf-search' ); ?></p>
			
			<h3><?php esc_html_e( 'Customizing the Appearance (Styling)', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'Add custom CSS in Appearance → Customize → Additional CSS. Use the classes below to style the form and results.', 'webequipe-pdf-search' ); ?></p>
			
			<h4><?php esc_html_e( 'Available CSS Classes', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'Override these in Additional CSS to match your theme. All use the webequipe-pdf- prefix.', 'webequipe-pdf-search' ); ?></p>
			<ul>
				<li><code>.webequipe-pdf-search-form-wrapper</code> — <?php esc_html_e( 'Form container', 'webequipe-pdf-search' ); ?></li>
				<li><code>.webequipe-pdf-search-form</code> — <?php esc_html_e( 'Form element', 'webequipe-pdf-search' ); ?></li>
				<li><code>.webequipe-pdf-search-input</code> — <?php esc_html_e( 'Search input field', 'webequipe-pdf-search' ); ?></li>
				<li><code>.webequipe-pdf-search-submit</code> — <?php esc_html_e( 'Submit button', 'webequipe-pdf-search' ); ?></li>
				<li><code>.webequipe-pdf-result</code> — <?php esc_html_e( 'Each result item', 'webequipe-pdf-search' ); ?></li>
				<li><code>.webequipe-pdf-search-result-content</code> — <?php esc_html_e( 'Meta + preview + excerpt box', 'webequipe-pdf-search' ); ?></li>
				<li><code>.webequipe-pdf-title-line</code> — <?php esc_html_e( 'Title and icon line', 'webequipe-pdf-search' ); ?></li>
				<li><code>.webequipe-pdf-meta</code> — <?php esc_html_e( 'Meta line (Author, Size, Page, Date)', 'webequipe-pdf-search' ); ?></li>
				<li><code>.webequipe-pdf-preview-wrapper</code> / <code>.webequipe-pdf-preview</code> — <?php esc_html_e( 'Preview thumbnail', 'webequipe-pdf-search' ); ?></li>
				<li><code>.webequipe-pdf-excerpt</code> — <?php esc_html_e( 'Summary text', 'webequipe-pdf-search' ); ?></li>
			</ul>
			
			<h4><?php esc_html_e( 'Example: Form styling', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'Add CSS in Additional CSS:', 'webequipe-pdf-search' ); ?></p>
			<code>/* Customize search form wrapper */
.webequipe-pdf-search-form-wrapper {
	max-width: 600px;
	margin: 30px auto;
}

/* Customize search input */
.webequipe-pdf-search-input {
	border: 2px solid #333;
	border-radius: 8px;
	padding: 12px 20px;
}

/* Customize search button */
.webequipe-pdf-search-submit {
	background-color: #ff6b6b;
	border-radius: 8px;
	padding: 12px 30px;
}</code>
			
			<h4><?php esc_html_e( 'Shortcode with custom class', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'Add your own class via the shortcode, then style it:', 'webequipe-pdf-search' ); ?></p>
			<code>[webequipe_pdf_search_form classes="my-custom-search"]</code>
			<p><?php esc_html_e( 'Then in Additional CSS:', 'webequipe-pdf-search' ); ?></p>
			<code>.my-custom-search { background: #f5f5f5; padding: 20px; border-radius: 10px; }
.my-custom-search .webequipe-pdf-search-input { /* your input styles */ }</code>
			
			<h4><?php esc_html_e( 'Quick Styling Example', 'webequipe-pdf-search' ); ?></h4>
			<p><?php esc_html_e( 'Here\'s a complete example to make your search form look modern:', 'webequipe-pdf-search' ); ?></p>
			<code>.webequipe-pdf-search-form-wrapper {
	background: white;
	border-radius: 12px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	padding: 30px;
	margin: 40px 0;
}

.webequipe-pdf-search-input {
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 14px 20px;
	font-size: 16px;
}

.webequipe-pdf-search-input:focus {
	border-color: #4CAF50;
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.webequipe-pdf-search-submit {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 8px;
	padding: 14px 30px;
	font-weight: 600;
	color: white;
	border: none;
}

.webequipe-pdf-search-submit:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}</code>
		</div>

		<div class="card">
			<h2><?php esc_html_e( 'Common Questions', 'webequipe-pdf-search' ); ?></h2>
			
			<h3><?php esc_html_e( 'Why can\'t I find my PDFs in search results?', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'Here are the most common reasons:', 'webequipe-pdf-search' ); ?></p>
			<ul>
				<li><?php esc_html_e( 'The PDF hasn\'t been indexed yet. Check the Media Library - if you see "Not Indexed", click the "Index" button for that PDF.', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'The PDF is excluded. Check if it shows "Excluded" in the Media Library. If so, click "Include" to make it eligible, then click "Index" to make it searchable.', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'Search integration is disabled. Go to Settings → PDF Search and make sure "Enable Search Integration" is checked.', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'The search term doesn\'t appear in the PDF. The plugin can only find text that actually exists in the PDF file.', 'webequipe-pdf-search' ); ?></li>
			</ul>

			<h3><?php esc_html_e( 'Why did indexing fail for some PDFs?', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'Some PDFs cannot be indexed:', 'webequipe-pdf-search' ); ?></p>
			<ul>
				<li><strong><?php esc_html_e( 'Image-based PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'If your PDF contains only images (such as a scanned document), the plugin cannot parse it for search. Upload a text-based PDF exported from the original document instead.', 'webequipe-pdf-search' ); ?></li>
				<li><strong><?php esc_html_e( 'Password-protected PDFs', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'The plugin cannot index PDFs that are password-protected.', 'webequipe-pdf-search' ); ?></li>
				<li><strong><?php esc_html_e( 'File too large', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'Very large PDFs might exceed the file size limit. You can increase this limit in Settings → PDF Search.', 'webequipe-pdf-search' ); ?></li>
				<li><strong><?php esc_html_e( 'Corrupted files', 'webequipe-pdf-search' ); ?></strong> - <?php esc_html_e( 'If the PDF file is damaged or corrupted, indexing will fail.', 'webequipe-pdf-search' ); ?></li>
			</ul>

			<h3><?php esc_html_e( 'How do I update a PDF that\'s already indexed?', 'webequipe-pdf-search' ); ?></h3>
			<p><?php esc_html_e( 'If you upload a new version of a PDF file, you should re-index it so the search results show the updated content. You can:', 'webequipe-pdf-search' ); ?></p>
			<ul>
				<li><?php esc_html_e( 'Go to Media → Library, find the PDF, and click "Index"', 'webequipe-pdf-search' ); ?></li>
				<li><?php esc_html_e( 'Or click "Re-index All PDFs" in Settings → PDF Search to update all PDFs at once', 'webequipe-pdf-search' ); ?></li>
			</ul>

			<h3><?php esc_html_e( 'What\'s the difference between "Unindex", "Exclude", and "Include"?', 'webequipe-pdf-search' ); ?></h3>
			<p><strong><?php esc_html_e( 'Unindex:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'Temporarily removes the PDF from search results. You can add it back later by clicking "Index" or "Re-index All PDFs".', 'webequipe-pdf-search' ); ?></p>
			<p><strong><?php esc_html_e( 'Exclude:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'Permanently excludes the PDF from indexing. Even if you click "Re-index All PDFs" or use bulk "Index PDFs", this PDF will be skipped. Use this for private documents or files you never want to be searchable.', 'webequipe-pdf-search' ); ?></p>
			<p><strong><?php esc_html_e( 'Include:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'Clears the exclusion flag from a PDF, making it eligible for indexing again. This does not automatically index the PDF - you need to use "Index PDFs" after including it. Use this when you want to re-enable indexing for previously excluded PDFs.', 'webequipe-pdf-search' ); ?></p>
			<p><strong><?php esc_html_e( 'Workflow Example:', 'webequipe-pdf-search' ); ?></strong> <?php esc_html_e( 'If you have 10 excluded PDFs and want to make them searchable: (1) Select all 10 PDFs and choose "Include PDFs" to clear their exclusion flags, (2) Select the same 10 PDFs again and choose "Index PDFs" to index them.', 'webequipe-pdf-search' ); ?></p>
		</div>

		<div class="card">
			<h2><?php esc_html_e( 'Need More Help?', 'webequipe-pdf-search' ); ?></h2>
			<p><?php esc_html_e( 'If you need additional assistance or have questions:', 'webequipe-pdf-search' ); ?></p>
			<ul>
				<li><a href="<?php echo esc_url( 'https://webequipe.com/webequipe-pdf-search' ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Visit our website', 'webequipe-pdf-search' ); ?></a></li>
				<li><a href="<?php echo esc_url( 'https://wordpress.org/support/plugin/webequipe-pdf-search' ); ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Get support on WordPress.org', 'webequipe-pdf-search' ); ?></a></li>
			</ul>
		</div>

	</div>
</div>
