<?php

/**
 * Metabox: Episode Info.
 *
 * @link    https://aiopodcasting.com
 * @since   1.0.0
 *
 * @package AiO_Podcast_Studio
 */

// Exit if accessed directly
if ( ! defined( 'WPINC' ) ) {
	die;
}
?>
<div class="aiopod aiopod-metabox-ui">
	<!-- Tabs -->
	<div class="aiopod-tabs">
		<button type="button" class="aiopod-tab aiopod-active" data-target="#aiopod-tab-content-episode-details">
			<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
				<path stroke-linecap="round" stroke-linejoin="round" d="M12 18.75a6 6 0 0 0 6-6v-1.5m-6 7.5a6 6 0 0 1-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 0 1-3-3V4.5a3 3 0 1 1 6 0v8.25a3 3 0 0 1-3 3Z" />
			</svg>
			<?php esc_html_e( 'Episode Details', 'aio-podcast-studio' ); ?>
		</button>

		<button type="button" class="aiopod-tab" data-target="#aiopod-tab-content-distribution">
			<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
				<path stroke-linecap="round" stroke-linejoin="round" d="M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z" />
			</svg>
			<?php esc_html_e( 'Distribution', 'aio-podcast-studio' ); ?>
		</button>
	</div>

	<!-- Tab Content: Episode Details -->
	<div id="aiopod-tab-content-episode-details" class="aiopod-tab-content">
		<!-- Accordion: Episode Details -->
		<div class="aiopod-accordion" data-collapsible="false">
			<div class="aiopod-accordion-body">
				<?php require_once AIOPOD_PLUGIN_DIR . 'admin/partials/episodes/accordion-episode-details.php'; ?>
			</div>
		</div>

		<!-- Accordion: Add Participants -->
		<div class="aiopod-accordion" data-collapsible="true">
			<button type="button" class="aiopod-accordion-header">
				<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
					<path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z" />
				</svg>
				<?php esc_html_e( 'Add Participants', 'aio-podcast-studio' ); ?>
				<span class="dashicons dashicons-arrow-down-alt2"></span>
			</button>
			<div class="aiopod-accordion-body">
				<?php require_once AIOPOD_PLUGIN_DIR . 'admin/partials/episodes/accordion-participants.php'; ?>
			</div>
		</div>

		<!-- Accordion: Transcription -->
		<div class="aiopod-accordion" data-collapsible="true">
			<button type="button" class="aiopod-accordion-header">
				<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
					<path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z" />
				</svg>
				<?php esc_html_e( 'Transcription', 'aio-podcast-studio' ); ?>
				<span class="dashicons dashicons-arrow-down-alt2"></span>
			</button>
			<div class="aiopod-accordion-body">
				<?php require_once AIOPOD_PLUGIN_DIR . 'admin/partials/episodes/accordion-transcription.php'; ?>
			</div>
		</div>

		<!-- Accordion: Chapters -->
		<div class="aiopod-accordion" data-collapsible="true">
			<button type="button" class="aiopod-accordion-header">
				<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
					<path stroke-linecap="round" stroke-linejoin="round" d="M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75" />
				</svg>
				<?php esc_html_e( 'Chapters', 'aio-podcast-studio' ); ?>
				<span class="dashicons dashicons-arrow-down-alt2"></span>
			</button>
			<div class="aiopod-accordion-body">
				<?php require_once AIOPOD_PLUGIN_DIR . 'admin/partials/episodes/accordion-chapters.php'; ?>
			</div>
		</div>

		<?php do_action( 'aiopod_episode_details_accordions', $post, $post_meta ); ?>
	</div>

	<!-- Tab Content: Distribution -->
	<div id="aiopod-tab-content-distribution" class="aiopod-tab-content" style="display: none;">
		<!-- Author Info -->
		<div class="aiopod-accordion" data-collapsible="false">
			<div class="aiopod-accordion-body">
				<?php require_once AIOPOD_PLUGIN_DIR . 'admin/partials/episodes/accordion-author-info.php'; ?>
			</div>
		</div>

		<!-- Block from Directories -->
		<div class="aiopod-accordion" data-collapsible="false">
			<div class="aiopod-accordion-body">
				<?php require_once AIOPOD_PLUGIN_DIR . 'admin/partials/episodes/accordion-distribution.php'; ?>
			</div>
		</div>
	</div>

	<?php wp_nonce_field( 'aiopod_save_episode_metabox', 'aiopod_episode_metabox_nonce' ); // Nonce ?>
</div>