<?php
/**
 * File Path: templates/admin/imp-exp-ui.php
 *
 * Import / Export Tab — UI Shell
 *
 * Outputs the scenario card grid and delegates each panel to a partial.
 *
 * Variables injected by class-mbs-tab-child-ui.php via mbs_get_template_part():
 * @var bool   $is_registered
 * @var bool   $is_pro
 * @var string $nonce
 * @var string $template_url  (only used by panel-csv.php)
 *
 * @package MyBookShowroom
 * @since   1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>
<div class="mbs-tab-content mbs-imp-exp-wrap">

	<h2><?php esc_html_e( 'Import / Export', 'my-book-showroom' ); ?></h2>
	<p class="mbs-tab-lead"><?php esc_html_e( 'Choose a scenario below to get started.', 'my-book-showroom' ); ?></p>

	<!-- ── Scenario card grid ─────────────────────────────────────────── -->
	<div class="mbs-imp-exp-cards" role="tablist" aria-label="<?php esc_attr_e( 'Import/Export scenarios', 'my-book-showroom' ); ?>">

		<!-- Card: Migrate from Another Plugin (FREE) — spans 2 columns for prominence -->
		<button type="button"
		        class="mbs-imp-exp-card mbs-imp-exp-card--wide"
		        data-panel="migrate"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-migrate">
			<span class="mbs-imp-exp-badge mbs-imp-exp-badge--free"><?php esc_html_e( 'FREE', 'my-book-showroom' ); ?></span>
			<?php echo mbs_icon( 'scenario-run-migrations', array( 'size' => '48px', 'aria_label' => '' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'Migrate from Another Plugin', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'Move your entire catalog — books, authors, series, covers, and settings — from a competitor plugin.', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-migrate-tags">
				<span class="mbs-imp-exp-migrate-tag"><?php esc_html_e( 'MyBookTable', 'my-book-showroom' ); ?></span>
				<span class="mbs-imp-exp-migrate-tag"><?php esc_html_e( 'Novelist', 'my-book-showroom' ); ?></span>
				<span class="mbs-imp-exp-migrate-tag"><?php esc_html_e( 'WP Books Gallery', 'my-book-showroom' ); ?></span>
			</span>
		</button>

				<!-- Card: Import Books (CSV / XLSX) -->
		<button type="button"
		        class="mbs-imp-exp-card"
		        data-panel="csv"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-csv">
			<?php echo mbs_icon( 'scenario-csv-import', array( 'size' => '48px', 'aria_label' => '' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'Import Books', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'CSV or XLSX — book data, with optional cover image columns', 'my-book-showroom' ); ?></span>
		</button>

		<!-- Card: Import from ZIP -->
		<button type="button"
		        class="mbs-imp-exp-card"
		        data-panel="zip"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-zip">
			<?php echo mbs_icon( 'scenario-export-archive', array( 'size' => '48px', 'aria_label' => '' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'Import from ZIP', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'XLSX catalog + media files exported by My Book Showroom', 'my-book-showroom' ); ?></span>
		</button>

		<!-- Card: ISBN Bulk Lookup (FREE) -->
		<button type="button"
		        class="mbs-imp-exp-card"
		        data-panel="isbn"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-isbn">
			<span class="mbs-imp-exp-badge mbs-imp-exp-badge--free"><?php esc_html_e( 'FREE', 'my-book-showroom' ); ?></span>
			<?php echo mbs_icon( 'scenario-search-discover', array( 'size' => '48px', 'aria_label' => '' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'ISBN Bulk Lookup', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'Paste ISBNs — pull book data from Google Books or Open Library', 'my-book-showroom' ); ?></span>
		</button>

		<!-- Card: Plugin Settings (REGISTERED) -->
		<button type="button"
		        class="mbs-imp-exp-card<?php echo $is_registered ? '' : ' is-locked'; ?>"
		        data-panel="settings"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-settings"
		        <?php echo $is_registered ? '' : 'aria-disabled="true"'; ?>>
			<span class="mbs-imp-exp-badge mbs-imp-exp-badge--registered"><?php esc_html_e( 'REG', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-icon dashicons dashicons-admin-settings"></span>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'Plugin Settings', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'Backup and restore your plugin configuration as JSON', 'my-book-showroom' ); ?></span>
		</button>

		<!-- Card: Amazon Import (PRO) -->
		<button type="button"
		        class="mbs-imp-exp-card<?php echo $is_pro ? '' : ' is-locked'; ?>"
		        data-panel="amazon"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-amazon"
		        <?php echo $is_pro ? '' : 'aria-disabled="true"'; ?>>
			<span class="mbs-imp-exp-badge mbs-imp-exp-badge--pro"><?php esc_html_e( 'PRO', 'my-book-showroom' ); ?></span>
			<?php echo mbs_icon( 'scenario-amazon-lookup', array( 'size' => '48px', 'aria_label' => '' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'Amazon Import', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'Import by ASIN or ISBN via Amazon Product Advertising API', 'my-book-showroom' ); ?></span>
		</button>

		<!-- Card: Import from EPUB (PRO) -->
		<button type="button"
		        class="mbs-imp-exp-card<?php echo $is_pro ? '' : ' is-locked'; ?>"
		        data-panel="epub"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-epub"
		        <?php echo $is_pro ? '' : 'aria-disabled="true"'; ?>>
			<span class="mbs-imp-exp-badge mbs-imp-exp-badge--pro"><?php esc_html_e( 'PRO', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-icon dashicons dashicons-media-document"></span>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'Import from EPUB', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'Upload an .epub file — title, author, cover, description, TOC, classifications, and contributors extracted automatically.', 'my-book-showroom' ); ?></span>
		</button>

		<!-- Card: Export Books (PRO) -->
		<button type="button"
		        class="mbs-imp-exp-card<?php echo $is_pro ? '' : ' is-locked'; ?>"
		        data-panel="export"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-export"
		        <?php echo $is_pro ? '' : 'aria-disabled="true"'; ?>>
			<span class="mbs-imp-exp-badge mbs-imp-exp-badge--pro"><?php esc_html_e( 'PRO', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-icon dashicons dashicons-download"></span>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'Export Books', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'Download your entire catalog as a CSV or XLSX file', 'my-book-showroom' ); ?></span>
		</button>


		<!-- Card: Export Catalog + Media (PRO/PUB) -->
		<button type="button"
		        class="mbs-imp-exp-card<?php echo $is_pro ? '' : ' is-locked'; ?>"
		        data-panel="export-zip"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-export-zip"
		        <?php echo $is_pro ? '' : 'aria-disabled="true"'; ?>>
			<span class="mbs-imp-exp-badge mbs-imp-exp-badge--pro"><?php esc_html_e( 'PRO', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-icon dashicons dashicons-media-archive"></span>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'Export Catalog + Media', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'Download your catalog and all media as a single ZIP archive', 'my-book-showroom' ); ?></span>
		</button>


		<!-- Card: Press Kit (PRO) -->
		<button type="button"
		        class="mbs-imp-exp-card<?php echo $is_pro ? '' : ' is-locked'; ?>"
		        data-panel="press-kit"
		        role="tab"
		        aria-selected="false"
		        aria-controls="mbs-panel-press-kit"
		        <?php echo $is_pro ? '' : 'aria-disabled="true"'; ?>>
			<span class="mbs-imp-exp-badge mbs-imp-exp-badge--pro"><?php esc_html_e( 'PRO', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-icon dashicons dashicons-media-document"></span>
			<span class="mbs-imp-exp-card-title"><?php esc_html_e( 'Press Kit', 'my-book-showroom' ); ?></span>
			<span class="mbs-imp-exp-card-desc"><?php esc_html_e( 'Generate a DOCX press kit per book — title page, author bio, and key facts table.', 'my-book-showroom' ); ?></span>
		</button>

	</div><!-- .mbs-imp-exp-cards -->
	<!-- ── Panels ─────────────────────────────────────────────────────── -->
	<div class="mbs-imp-exp-panels">

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-migrate', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-csv', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-zip', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-isbn', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-amazon', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-export', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-export-zip', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-settings', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-epub', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

		<?php mbs_get_template_part( 'admin/imp-exp-partials/panel-press-kit', array(
			'is_registered' => $is_registered,
			'is_pro'        => $is_pro,
			'nonce'         => $nonce,
			'template_url'  => $template_url,
		) ); ?>

	</div><!-- .mbs-imp-exp-panels -->

</div><!-- .mbs-imp-exp-wrap -->
