<?php
/**
 * Bridge presentation page — artisanal design matching pricing page.
 *
 * Shown when the Bridge plugin is NOT installed. Presents Bridge features
 * and download links using SlideMind's design tokens.
 *
 * @package SlideMind
 * @since 0.8.0
 */

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

// Free features for the card grid.
$free_features = [
	[
		'icon'  => 'dashicons-media-interactive',
		'title' => __( 'SCORM & xAPI Support', 'slidemind' ),
		'desc'  => __( 'Auto-detects package format. Supports SCORM 1.2, SCORM 2004, and xAPI (Tin Can).', 'slidemind' ),
	],
	[
		'icon'  => 'dashicons-upload',
		'title' => __( 'Drag & Drop Upload', 'slidemind' ),
		'desc'  => __( 'Upload ZIP packages with a simple drag & drop. Replace existing packages without losing tracking data.', 'slidemind' ),
	],
	[
		'icon'  => 'dashicons-shortcode',
		'title' => __( 'Flexible Embedding', 'slidemind' ),
		'desc'  => __( 'Shortcode + Gutenberg block with 3 display modes: inline, lightbox, and new window.', 'slidemind' ),
	],
	[
		'icon'  => 'dashicons-randomize',
		'title' => __( 'LMS Auto-Bridge', 'slidemind' ),
		'desc'  => __( 'Auto-detect your LMS plugin and pass completion status & scores back to the gradebook.', 'slidemind' ),
	],
	[
		'icon'  => 'dashicons-chart-line',
		'title' => __( 'Learner Tracking', 'slidemind' ),
		'desc'  => __( 'Store progress locally in WordPress. Resume support, attempt tracking, and suspend data.', 'slidemind' ),
	],
	[
		'icon'  => 'dashicons-admin-site-alt3',
		'title' => __( 'Universal Compatibility', 'slidemind' ),
		'desc'  => __( 'Storyline, Captivate, Rise, iSpring, Lectora, DominKnow, Elucidat, Evolve, and more.', 'slidemind' ),
	],
];

// Pro features list.
$pro_features = [
	[
		'icon'  => 'dashicons-chart-bar',
		'label' => __( 'Reports Dashboard', 'slidemind' ),
		'desc'  => __( 'KPIs, completion rates, scores at a glance', 'slidemind' ),
	],
	[
		'icon'  => 'dashicons-admin-users',
		'label' => __( 'Learner Analytics', 'slidemind' ),
		'desc'  => __( 'drill-down per learner, xAPI statements, SCORM interactions', 'slidemind' ),
	],
	[
		'icon'  => 'dashicons-database-export',
		'label' => __( 'CSV Export', 'slidemind' ),
		'desc'  => __( 'latest or all attempts, with full interaction data', 'slidemind' ),
	],
	[
		'icon'  => 'dashicons-admin-network',
		'label' => __( 'External LRS Forwarding', 'slidemind' ),
		'desc'  => __( 'Learning Locker, Watershed, and more', 'slidemind' ),
	],
];

// Authoring tools.
$authoring_tools = [
	__( 'Storyline', 'slidemind' ),
	__( 'Rise', 'slidemind' ),
	__( 'Captivate', 'slidemind' ),
	__( 'iSpring', 'slidemind' ),
	__( 'Lectora', 'slidemind' ),
	__( 'DominKnow', 'slidemind' ),
	__( 'Elucidat', 'slidemind' ),
	__( 'Evolve', 'slidemind' ),
];

// LMS plugins.
$lms_plugins = [
	'LearnDash',
	'TutorLMS',
	'LearnPress',
	'LifterLMS',
	'Sensei LMS',
];

// Download URL (same target as the old redirect).
$download_url = self_admin_url( 'plugin-install.php?s=slidemind+bridge&tab=search&type=term' );
?>
<div class="sm-wrap sm-bridge-page">

	<!-- Background decorations -->
	<div class="sm-pricing-bg-blob sm-pricing-bg-blob--sage"></div>
	<div class="sm-pricing-bg-blob sm-pricing-bg-blob--terra"></div>

	<!-- Zone 1 — Hero -->
	<div class="sm-pricing-hero sm-bridge-hero">
		<h1 class="sm-pricing-hero-title">
			SlideMind
			<span class="sm-pricing-hero-accent"><?php esc_html_e( 'Bridge', 'slidemind' ); ?></span>
		</h1>
		<p class="sm-pricing-hero-tagline">
			<?php esc_html_e( 'Host SCORM & xAPI packages in WordPress. Connect any authoring tool to any LMS.', 'slidemind' ); ?>
		</p>
	</div>

	<!-- Zone 2 — What is Bridge -->
	<div class="sm-bridge-intro sm-pricing-anim" style="animation-delay:0.05s">
		<div class="sm-bridge-intro-text">
			<h2 class="sm-bridge-section-title">
				<?php esc_html_e( 'What is SlideMind Bridge?', 'slidemind' ); ?>
			</h2>
			<p>
				<?php esc_html_e( 'SlideMind Bridge is a free WordPress plugin that lets you upload, host, and embed SCORM & xAPI e-learning packages on your site. It auto-detects your LMS plugin and sends completion data back to the gradebook. No manual setup, no external hosting needed.', 'slidemind' ); ?>
			</p>
			<p>
				<?php esc_html_e( 'Works with Storyline, Captivate, Rise, and any other authoring tool that exports SCORM or xAPI.', 'slidemind' ); ?>
			</p>
		</div>
		<div class="sm-bridge-intro-image">
			<div class="sm-bridge-placeholder">
				<span class="dashicons dashicons-format-gallery"></span>
				<span><?php esc_html_e( 'Package list screenshot', 'slidemind' ); ?></span>
			</div>
		</div>
	</div>

	<!-- Early CTA -->
	<div class="sm-bridge-cta sm-bridge-cta--early sm-pricing-anim" style="animation-delay:0.1s">
		<div class="sm-bridge-cta-buttons">
			<a href="<?php echo esc_url( $download_url ); ?>"
				class="sm-pricing-btn sm-pricing-btn--dark">
				<?php esc_html_e( 'Download Free', 'slidemind' ); ?>
				<span class="dashicons dashicons-arrow-right-alt2"></span>
			</a>
			<a href="#bridge-pro"
				class="sm-pricing-btn sm-pricing-btn--outline sm-pricing-btn--outline-terra">
				<?php esc_html_e( 'Get Bridge Pro', 'slidemind' ); ?>
				<span class="dashicons dashicons-arrow-right-alt2"></span>
			</a>
		</div>
		<p class="sm-bridge-cta-note">
			<?php esc_html_e( 'Already have SlideMind Pro? Bridge Pro is included. Simply download the Free version.', 'slidemind' ); ?>
		</p>
	</div>

	<!-- Zone 3 — Free Features grid -->
	<div class="sm-bridge-features-section sm-pricing-anim" style="animation-delay:0.15s">
		<h2 class="sm-bridge-section-title sm-bridge-section-title--center">
			<?php esc_html_e( 'Everything you need, for free', 'slidemind' ); ?>
		</h2>
		<div class="sm-bridge-features-grid">
			<?php foreach ( $free_features as $feature ) : ?>
				<div class="sm-bridge-feature-card">
					<div class="sm-bridge-feature-icon">
						<span class="dashicons <?php echo esc_attr( $feature['icon'] ); ?>"></span>
					</div>
					<h3 class="sm-bridge-feature-title"><?php echo esc_html( $feature['title'] ); ?></h3>
					<p class="sm-bridge-feature-desc"><?php echo esc_html( $feature['desc'] ); ?></p>
				</div>
			<?php endforeach; ?>
		</div>
	</div>

	<!-- Zone 4 — Pro Features hero card -->
	<div class="sm-pricing-section sm-pricing-section--pro sm-pricing-anim" style="animation-delay:0.25s">
		<div class="sm-bridge-pro-card">
			<div class="sm-bridge-pro-bar"></div>
			<div class="sm-bridge-pro-body">
				<div class="sm-bridge-pro-content">
					<div class="sm-bridge-pro-text">
						<div class="sm-pricing-plan-badge sm-pricing-plan-badge--terra">
							<?php esc_html_e( 'Upgrade to Pro', 'slidemind' ); ?>
						</div>
						<h2 class="sm-bridge-pro-title">
							<?php esc_html_e( 'Unlock the full picture', 'slidemind' ); ?>
						</h2>
						<ul class="sm-pricing-features">
							<?php foreach ( $pro_features as $pf ) : ?>
								<li>
									<span class="dashicons <?php echo esc_attr( $pf['icon'] ); ?> sm-pricing-check sm-pricing-check--terra"></span>
									<span><strong><?php echo esc_html( $pf['label'] ); ?>:</strong> <?php echo esc_html( $pf['desc'] ); ?></span>
								</li>
							<?php endforeach; ?>
						</ul>
						<p class="sm-bridge-pro-note">
							<?php esc_html_e( 'Included free with SlideMind Pro, or available as standalone SlideMind Bridge Pro.', 'slidemind' ); ?>
						</p>
					</div>
					<div class="sm-bridge-pro-image">
						<div class="sm-bridge-placeholder sm-bridge-placeholder--dark">
							<span class="dashicons dashicons-chart-area"></span>
							<span><?php esc_html_e( 'Reports dashboard screenshot', 'slidemind' ); ?></span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<!-- Zone 5 — Compatibility section -->
	<div class="sm-bridge-compat sm-pricing-anim" style="animation-delay:0.35s">
		<h2 class="sm-bridge-section-title sm-bridge-section-title--center">
			<?php esc_html_e( 'Works with your tools', 'slidemind' ); ?>
		</h2>
		<div class="sm-bridge-compat-row">
			<h3 class="sm-bridge-compat-label">
				<span class="dashicons dashicons-welcome-learn-more"></span>
				<?php esc_html_e( 'Authoring Tools', 'slidemind' ); ?>
			</h3>
			<div class="sm-bridge-compat-pills">
				<?php foreach ( $authoring_tools as $tool ) : ?>
					<span class="sm-bridge-compat-pill sm-bridge-compat-pill--sage"><?php echo esc_html( $tool ); ?></span>
				<?php endforeach; ?>
				<span class="sm-bridge-compat-pill sm-bridge-compat-pill--sage sm-bridge-compat-pill--any">
					<?php esc_html_e( '+ any SCORM/xAPI', 'slidemind' ); ?>
				</span>
			</div>
		</div>
		<div class="sm-bridge-compat-row">
			<h3 class="sm-bridge-compat-label">
				<span class="dashicons dashicons-welcome-widgets-menus"></span>
				<?php esc_html_e( 'LMS Plugins', 'slidemind' ); ?>
			</h3>
			<div class="sm-bridge-compat-pills">
				<?php foreach ( $lms_plugins as $lms ) : ?>
					<span class="sm-bridge-compat-pill sm-bridge-compat-pill--terra"><?php echo esc_html( $lms ); ?></span>
				<?php endforeach; ?>
			</div>
		</div>
	</div>

	<!-- Zone 6 — CTA section -->
	<div class="sm-bridge-cta sm-pricing-anim" style="animation-delay:0.4s">
		<div class="sm-bridge-cta-buttons">
			<a href="<?php echo esc_url( $download_url ); ?>"
				class="sm-pricing-btn sm-pricing-btn--dark">
				<?php esc_html_e( 'Download Free', 'slidemind' ); ?>
				<span class="dashicons dashicons-arrow-right-alt2"></span>
			</a>
			<a href="#bridge-pro"
				class="sm-pricing-btn sm-pricing-btn--outline sm-pricing-btn--outline-terra">
				<?php esc_html_e( 'Get Bridge Pro', 'slidemind' ); ?>
				<span class="dashicons dashicons-arrow-right-alt2"></span>
			</a>
		</div>
		<p class="sm-bridge-cta-note">
			<?php esc_html_e( 'Already have SlideMind Pro? Bridge Pro is included.', 'slidemind' ); ?>
		</p>
	</div>

	<!-- Zone 7 — FAQ -->
	<div class="sm-pricing-faq">
		<h2 class="sm-pricing-faq-title"><?php esc_html_e( 'Frequently Asked Questions', 'slidemind' ); ?></h2>
		<div class="sm-pricing-faq-grid">

			<details class="sm-pricing-faq-item">
				<summary><?php esc_html_e( 'Do I need SlideMind WP to use SlideMind Bridge?', 'slidemind' ); ?></summary>
				<p><?php esc_html_e( 'No. SlideMind Bridge works on its own. When both plugins are installed, it also hosts the content for AI interactions created with SlideMind WP.', 'slidemind' ); ?></p>
			</details>

			<details class="sm-pricing-faq-item">
				<summary><?php esc_html_e( 'Which SCORM versions are supported?', 'slidemind' ); ?></summary>
				<p><?php esc_html_e( 'SlideMind Bridge supports SCORM 1.2, SCORM 2004 (all editions), and xAPI (Tin Can). The format is auto-detected from the uploaded ZIP package.', 'slidemind' ); ?></p>
			</details>

			<details class="sm-pricing-faq-item">
				<summary><?php esc_html_e( 'How does LMS bridging work?', 'slidemind' ); ?></summary>
				<p><?php esc_html_e( 'SlideMind Bridge auto-detects popular WordPress LMS plugins (LearnDash, TutorLMS, etc.) and passes completion status and scores back to their gradebook. No configuration needed.', 'slidemind' ); ?></p>
			</details>

			<details class="sm-pricing-faq-item">
				<summary><?php esc_html_e( 'Is my tracking data stored locally?', 'slidemind' ); ?></summary>
				<p><?php esc_html_e( 'Yes. All learner progress, scores, and suspend data are stored in your WordPress database. Nothing is sent to external servers unless you enable LRS forwarding in Bridge Pro.', 'slidemind' ); ?></p>
			</details>

			<details class="sm-pricing-faq-item">
				<summary><?php esc_html_e( "What's included in Bridge Pro?", 'slidemind' ); ?></summary>
				<p><?php esc_html_e( 'SlideMind Bridge Pro adds a reports dashboard with completion rates and scores, per-learner analytics with xAPI statement details, CSV exports, and external LRS forwarding. Included free with any SlideMind Pro plan, or available separately.', 'slidemind' ); ?></p>
			</details>

		</div>
	</div>
</div>
