<?php

$plugin_url = SOFT_MULTIMEDIA_PLAYER_URL;

// Player Types
$players = [
	[
		'key'         => 'audio',
		'title'       => __('Audio Player', 'soft-multimedia-player'),
		'description' => __('A dedicated player for non-stop audio playback, designed for the best listening experience.', 'soft-multimedia-player'),
	],
	[
		'key'         => 'video',
		'title'       => __('Video Player', 'soft-multimedia-player'),
		'description' => __('A dedicated player for smooth video playback, optimized for an immersive viewing experience.', 'soft-multimedia-player'),
	],
	[
		'key'         => 'podcast',
		'title'       => __('Podcast Player', 'soft-multimedia-player'),
		'description' => __('A dedicated player for professional podcast playback, designed for a long-lasting listening', 'soft-multimedia-player'),
	],
];

// Features
$features = [
	[
		'key'     => 'playlist',
		'title'   => __('Playlist Support', 'soft-multimedia-player'),
		'content' => __('Build your perfect tracks playlist in seconds. Add search to quickly find what you need, and let continuous playback handle the rest—no clicks. Whether you\'re curating music, podcasts, or a video series, it\'s all smooth and under control.', 'soft-multimedia-player'),
	],
	[
		'key'     => 'popup',
		'title'   => __('Popup Player', 'soft-multimedia-player'),
		'content' => __('Keep the music (or video) going while you explore. The pop-up player floats above your content, staying in view even when you scroll or switch pages. Ideal for multitaskers who never want the playback to stop.', 'soft-multimedia-player'),
	],
	[
		'key'     => 'embed',
		'title'   => __('Embed Anywhere', 'soft-multimedia-player'),
		'content' => __('Drop your player into any post, page, or section of your site. Whether it’s a blog, portfolio, or landing page, just plug it in and play. Works with shortcodes and blocks, and fits right in with any theme.', 'soft-multimedia-player'),
	],
	[
		'key'     => 'preview',
		'title'   => __('Realtime Editing Preview', 'soft-multimedia-player'),
		'content' => __('Tweak it and see it—right then and there. Change colors, layout, controls, and more, all while watching your player update live. No guesswork, no reloads—just instant results as you shape the player to match your vision.', 'soft-multimedia-player'),
	],
	[
		'key'     => 'multi-support',
		'title'   => __('Multi-Source Support', 'soft-multimedia-player'),
		'content' => __('Play media from wherever it lives—your WordPress library, direct URLs, or platforms like YouTube, Vimeo, or SoundCloud. Mix and match sources in a single playlist or across your site. It’s your content, your way.', 'soft-multimedia-player'),
	],
	[
		'key'     => 'skins',
		'title'   => __('25+ Multiple Player Skins', 'soft-multimedia-player'),
		'content' => __('Pick a look that fits. With over 20 stylish skins to choose from, your player can be bold, clean, classic, or modern. Preview each one instantly, swap them out in a click, and match the vibe of your site in no time.', 'soft-multimedia-player'),
	],
];

// Other Features
$otherFeatures = [
	[
		'icon'        => 'shortcode',
		'title'       => __('Shortcode Generator', 'soft-multimedia-player'),
		'description' => __('Easily generate custom shortcodes to embed audio, video, or podcast players anywhere on your site with zero coding skills.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'duplicate',
		'title'       => __('Player Duplicator', 'soft-multimedia-player'),
		'description' => __('Quickly duplicate your media players with customized settings, making it easy to create multiple instances in no time.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'unlimited-players',
		'title'       => __('Add Unlimited Players', 'soft-multimedia-player'),
		'description' => __('Add as many players as you need to seamlessly integrate unlimited audio, video, and podcast players across your site.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'instance',
		'title'       => __('Multiple Instances', 'soft-multimedia-player'),
		'description' => __('Run multiple instances of the player simultaneously, each with unique settings and media types.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'controls',
		'title'       => __('Advanced Player Controls', 'soft-multimedia-player'),
		'description' => __('Take full control with advanced playback options, including speed, volume, looping, and more for a personalized media experience.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'color',
		'title'       => __('Color Customization', 'soft-multimedia-player'),
		'description' => __('Fully personalize your player’s colors to match your brand’s style and create a visually cohesive experience.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'metadata',
		'title'       => __('Metadata Customization', 'soft-multimedia-player'),
		'description' => __('Easily manage and display key track info like title, artist, album, and genre. Customize how metadata appears to a player.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'typography',
		'title'       => __('Typography Customization', 'soft-multimedia-player'),
		'description' => __('Adjust fonts, sizes, weights, and spacing to match your site\'s look. Fine-tune text styles across the player for better visual consistency.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'autoplay',
		'title'       => __('Autoplay', 'soft-multimedia-player'),
		'description' => __('Start playback automatically when the page loads. Ideal for featured tracks or episodes that need instant engagement.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'css',
		'title'       => __('Custom CSS', 'soft-multimedia-player'),
		'description' => __('Apply custom CSS to fine-tune the look and feel of your player, giving you full control over its design.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'statistics',
		'title'       => __('Statistics', 'soft-multimedia-player'),
		'description' => __('Track player performance with detailed statistics on usage, engagement, and playback data.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'tools',
		'title'       => __('Tools', 'soft-multimedia-player'),
		'description' => __('Quickly manage player settings with built-in tools to auto-save, export/import configurations, and reset everything when needed.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'classic-widget',
		'title'       => __('Classic Widget', 'soft-multimedia-player'),
		'description' => __('Prefer the Classic WordPress Widgets interface? Add and configure your player seamlessly without needing to switch to block editor.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'gutenberg',
		'title'       => __('Gutenberg Block', 'soft-multimedia-player'),
		'description' => __('Add audio or video with Gutenberg—no setup needed. Customize and play.', 'soft-multimedia-player'),
	],
	[
		'icon'        => 'elementor',
		'title'       => __('Elementor Widget', 'soft-multimedia-player'),
		'description' => __('Designed for effortless integration with Elementor. Simply drag the media player widget into your layout and start customizing.', 'soft-multimedia-player'),
	],
];

$plugins = [
	[
		'key'   => 'integrate-google-drive',
		'title' => __('Integrate Google Drive', 'soft-multimedia-player'),
		'desc'  => __('Complete Google Drive integration for WordPress.', 'soft-multimedia-player'),
		'user'	=> '15',
		'color'	=> '#2FB44A',
	],
	[
		'key'   => 'radio-player',
		'title' => __('Radio Player', 'soft-multimedia-player'),
		'desc'  => __('Live Shoutcast, Icecast and Any Audio Stream Player for WordPress.', 'soft-multimedia-player'),
		'user'	=> '10',
		'color'	=> '#76DE91',
	],
	[
		'key'   => 'dracula-dark-mode',
		'title' => __('Dracula Dark Mode', 'soft-multimedia-player'),
		'desc'  => __('Enhanced Accessibility, Dark Mode & Reading Mode for WordPress.', 'soft-multimedia-player'),
		'user'	=> '5',
		'color'	=> '#675DE1',
	],
	[
		'key'   => 'essential-addons-for-contact-form-7',
		'title' => __('Essential Addons for Contact Form 7', 'soft-multimedia-player'),
		'desc'  => __('50+ Essential Fields, Features & Integrations Add-ons for Contact Form 7.', 'soft-multimedia-player'),
		'user'	=> '1',
		'color'	=> '#33c6f4',
	]
];

$setup_complete = ! get_option('smp_show_setup');

?>

<div id="introduction" class="getting-started-content content-introduction active <?php echo $setup_complete ? 'setup-complete' : ''; ?>">

	<?php

	if (! $setup_complete) {
		include_once SOFT_MULTIMEDIA_PLAYER_INCLUDES . '/views/getting-started/get-started.php';
	}

	?>

	<div class="content-heading heading-introduction">
		<h2><?php _e('Quick', 'soft-multimedia-player') ?>
			<mark><?php _e('Overview', 'soft-multimedia-player') ?></mark>
		</h2>
		<p><?php _e('Discover a brief overview of the plugin\'s features', 'soft-multimedia-player') ?></p>
	</div>

	<section class="section-item introduction-about-smp section-full">

		<div class="section-description">
			<p><?php _e('Multimedia Player is a smart solution for streaming audio, video, and podcasts on your WordPress site. Whether hosting files locally or pulling from platforms like YouTube, Vimeo, or podcast feeds, this plugin ensures smooth playback.', 'soft-multimedia-player'); ?></p>

			<h4><?php _e('What Multimedia Player Supports:', 'soft-multimedia-player'); ?></h4>

			<ol>
				<li><strong><?php _e('Audio Player', 'soft-multimedia-player'); ?></strong>
					– <?php _e('Stream MP3, WAV, and more with customizable controls and styling.', 'soft-multimedia-player'); ?>
				</li>
				<li><strong><?php _e('Video Player', 'soft-multimedia-player'); ?></strong>
					– <?php _e('Easily embed MP4, WebM, YouTube, Vimeo, and Facebook videos.', 'soft-multimedia-player'); ?>
				</li>
				<li><strong><?php _e('Podcast Player', 'soft-multimedia-player'); ?></strong>
					– <?php _e('Optimized for podcasters to play local episodes or stream directly from RSS feeds.', 'soft-multimedia-player'); ?>
				</li>
			</ol>
		</div>


		<div class="col-image">
			<iframe src="https://www.youtube.com/embed/JKbMmM2-WUU?rel=0" frameborder="0"
				allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
				allowfullscreen></iframe>
		</div>

	</section>

	<div class="content-heading heading-overview">
		<h2>
			<mark><?php _e('Multiple Player Types', 'soft-multimedia-player') ?></mark>
		</h2>
		<p><?php _e('Choose from different player types for audio, video, and podcasts for different purposes.', 'soft-multimedia-player'); ?></p>
	</div>

	<div class="player-list">
		<?php foreach ($players as $player) : ?>
			<div class="player-card">
				<img src="<?php echo esc_url($plugin_url . '/assets/images/dashboard/' . $player['key'] . '.png'); ?>"
					alt="<?php echo esc_attr($player['key']); ?>" />
				<h3><?php echo esc_html($player['title']); ?></h3>
				<p><?php echo esc_html($player['description']); ?></p>
			</div>
		<?php endforeach; ?>
	</div>

	<div class="content-heading heading-features">
		<h2>
			<mark><?php _e('Top-notch Features', 'soft-multimedia-player') ?></mark>
		</h2>
		<p><?php _e('Packed with powerful features to enhance your audio, video, and podcast experience.', 'soft-multimedia-player'); ?></p>
	</div>

	<?php
	$i = 0;
	foreach ($features as $feature) :
		$section_reverse = ($i % 2 === 1) ? ' section-reverse' : '';
		$i++;
	?>
		<section class="section-item section-full section-<?php echo esc_attr($feature['key']);
															echo esc_attr($section_reverse); ?>">
			<div class="col-image">
				<img src="<?php echo esc_url($plugin_url . '/assets/images/dashboard/getting-started/' . $feature['key'] . '.png'); ?>"
					alt="<?php echo esc_attr($feature['key']); ?>" />
			</div>
			<div class="col-content">
				<h2><?php echo esc_html($feature['title']); ?></h2>
				<p><?php echo esc_html($feature['content']); ?></p>
			</div>
		</section>
	<?php endforeach; ?>


	<div class="content-heading other-features">
		<h2>
			<mark><?php _e('Never Miss a Single Valuable Features', 'soft-multimedia-player') ?></mark>
		</h2>
		<p><?php _e('Packed with extra features and enhancements to fine-tune your media experience.', 'soft-multimedia-player'); ?></p>
	</div>

	<div class="other-features-list">
		<?php

		foreach ($otherFeatures as $key => $feature) {
			$visibleCount = 9;

		?>

			<div class="other-feature-card <?php echo $key >= $visibleCount ? 'smp-hidden' : '' ?>">
				<img src="<?php echo esc_url($plugin_url . '/assets/images/dashboard/' . $feature['icon'] . '.png'); ?>"
					alt="<?php echo esc_attr($feature['icon']); ?>" />
				<h3><?php echo esc_html($feature['title']); ?></h3>
				<p><?php echo esc_html($feature['description']); ?></p>
			</div>

			<?php if ($key === $visibleCount - 1) { ?>
				<div class="show-all-btn-wrap">
					<button class="smp-btn btn-primary" id="all-feature-show">
						<i class="dashicons dashicons-arrow-down-alt2"></i>
						<?php _e('Show All Feature', 'soft-multimedia-player'); ?>
					</button>
				</div>
			<?php } ?>

		<?php } ?>


	</div>

	<div class="content-heading heading-features">
		<h2><?php _e('Explore Our Popular Plugins', 'soft-multimedia-player') ?>
			<mark><?php _e(' You Might Love.', 'soft-multimedia-player') ?></mark>
		</h2>
		<p><?php _e('Multimedia Player is developed by the same team behind some of the most popular WordPress plugins.', 'soft-multimedia-player'); ?></p>
	</div>

	<div class="popular-plugins-wrap">
		<?php

		foreach ($plugins as $index => $item):
			$plugin_img_url = SOFT_MULTIMEDIA_PLAYER_ASSETS . '/images/dashboard/plugins/' . $item['key'] . '.png';
			$install_url = esc_url(admin_url("plugin-install.php?tab=plugin-information&plugin={$item['key']}"));
			$learn_more_url = esc_url("https://softlabbd.com/{$item['key']}");
		?>
			<div class="popular-plugin-item">
				<img src="<?php echo $plugin_img_url; ?>" alt="<?php echo esc_attr($item['title']); ?>" />

				<div class="plugin-info">
					<h3><?php echo esc_html($item['title']); ?></h3>
					<p><?php echo esc_html($item['desc']); ?></p>
					<div class="users-count" style="--plugin-color: <?php echo esc_attr($item['color']); ?>">
						<i class="dashicons dashicons-admin-users"></i>
						<?php echo sprintf('%sK+ Active Users', $item['user'])  ?>
					</div>
				</div>

				<div class="button-group">
					<a class="smp-btn btn-secondary button"
						href="<?php echo $install_url; ?>">
						<i class="dashicons dashicons-admin-plugins"></i>
						<?php _e('Install Now', 'soft-multimedia-player'); ?>
					</a>

					<a class="smp-btn btn-primary button"
						href="<?php echo $learn_more_url; ?>"
						target="_blank">
						<i class="dashicons dashicons-external"></i>
						<?php _e('Learn More', 'soft-multimedia-player'); ?>
					</a>
				</div>
			</div>
		<?php endforeach; ?>

	</div>
</div>