<?php
/**
 * Theme Get Started / Upsell Page
 *
 * @package FITNESS_INSIGHT
 */

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

/**
 * Add theme page to admin menu
 */
add_action( 'admin_menu', 'fitness_insight_add_theme_page' );
function fitness_insight_add_theme_page() {
    add_theme_page(
        __( 'Upgrade to PRO', 'fitness-insight' ),
        __( 'Upgrade to PRO', 'fitness-insight' ),
        'manage_options',
        'fitness-insight-pro',
        'fitness_insight_pro_page_callback'
    );
}

/**
 * Render theme Get Started page
 */
function fitness_insight_pro_page_callback() {
	$fitness_insight_theme_name_clean = strtolower( preg_replace( '#[^a-zA-Z]#', '', wp_get_theme()->get( 'Name' ) ) );
	$fitness_insight_wizard_page_slug = apply_filters( $fitness_insight_theme_name_clean . '_theme_setup_wizard_fitness_insight_page_slug', $fitness_insight_theme_name_clean . '-wizard' );
	$fitness_insight_demo_url         = admin_url( 'themes.php?page=' . $fitness_insight_wizard_page_slug );
	?>
	<div class="wrap ot-pro-wrap">
		<h1><?php esc_html_e( 'Get Started with Fitness Insight 🚀', 'fitness-insight' ); ?></h1>

		<div class="ot-pro-hero">
			<div class="hero-content">
				<div class="hero-left">
					<h2><?php esc_html_e( 'Build Your Professional Website Today', 'fitness-insight' ); ?></h2>
					<p class="subtitle"><?php esc_html_e( 'Get access to premium features, advanced layouts, demo import, and priority support', 'fitness-insight' ); ?></p>
					<div class="button-group">
						<a class="button button-hero theme-install" href="<?php echo esc_url( $fitness_insight_demo_url ); ?>">
							<span class="dashicons dashicons-download"></span>
							<?php esc_html_e( 'Demo Import', 'fitness-insight' ); ?>
						</a>
						<a href="<?php echo esc_url( FITNESS_INSIGHT_LIVE_DEMO ); ?>" target="_blank" class="button button-hero button-demo">
							<span class="dashicons dashicons-visibility"></span>
							<?php esc_html_e( 'Live Demo', 'fitness-insight' ); ?>
						</a>
						<a href="<?php echo esc_url( FITNESS_INSIGHT_BUY_PRO ); ?>" target="_blank" class="button button-primary button-hero button-pro">
							<span class="dashicons dashicons-star-filled"></span>
							<?php esc_html_e( 'Get Pro Theme', 'fitness-insight' ); ?>
						</a>
						<a href="<?php echo esc_url( FITNESS_INSIGHT_FREE_DOC ); ?>" target="_blank" class="button button-hero button-docs">
							<span class="dashicons dashicons-book"></span>
							<?php esc_html_e( 'Documentation', 'fitness-insight' ); ?>
						</a>
						<a href="<?php echo esc_url( FITNESS_INSIGHT_BUNDLE_LINK ); ?>" target="_blank" class="button button-hero button-bundle">
							<span class="dashicons dashicons-cart"></span>
							<?php esc_html_e( 'WordPress Theme Bundle', 'fitness-insight' ); ?>
						</a>
					</div>
				</div>
				<div class="hero-right">
					<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/screenshot.png" alt="<?php esc_attr_e( 'Fitness Insight Theme Screenshot', 'fitness-insight' ); ?>" class="theme-screenshot">
				</div>
			</div>
		</div>

		<div class="ot-pro-features">
			<h2><?php esc_html_e( 'Why Upgrade to Pro?', 'fitness-insight' ); ?></h2>

			<div class="feature-grid">
				<div class="feature-box">
					<span class="dashicons dashicons-layout"></span>
					<h3><?php esc_html_e( 'Different Styling Options', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( 'Choose from multiple color schemes and styling options to match your brand identity.', 'fitness-insight' ); ?></p>
				</div>

				<div class="feature-box">
					<span class="dashicons dashicons-admin-customizer"></span>
					<h3><?php esc_html_e( 'Section Reordering Option', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( 'Rearrange homepage sections in any order to best showcase your services.', 'fitness-insight' ); ?></p>
				</div>

				<div class="feature-box">
					<span class="dashicons dashicons-editor-table"></span>
					<h3><?php esc_html_e( 'Footer Builder', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( 'Create custom footers with advanced widgets and flexible column layouts.', 'fitness-insight' ); ?></p>
				</div>

				<div class="feature-box">
					<span class="dashicons dashicons-art"></span>
					<h3><?php esc_html_e( 'Typography Controls', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( 'Full control over fonts, sizes, and text styling across all sections of your site.', 'fitness-insight' ); ?></p>
				</div>

				<div class="feature-box">
					<span class="dashicons dashicons-cart"></span>
					<h3><?php esc_html_e( 'WooCommerce Styling', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( 'Advanced WooCommerce integration with custom product and service page layouts.', 'fitness-insight' ); ?></p>
				</div>

				<div class="feature-box">
					<span class="dashicons dashicons-admin-tools"></span>
					<h3><?php esc_html_e( 'Advanced Options', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( 'Access advanced theme settings to achieve greater customization and control.', 'fitness-insight' ); ?></p>
				</div>

				<div class="feature-box">
					<span class="dashicons dashicons-performance"></span>
					<h3><?php esc_html_e( 'Performance Optimized', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( '3X faster loading with optimized code, minified assets, and clean markup.', 'fitness-insight' ); ?></p>
				</div>

				<div class="feature-box">
					<span class="dashicons dashicons-sos"></span>
					<h3><?php esc_html_e( 'Priority Support', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( 'Get expert help within 24 hours through our dedicated priority support system.', 'fitness-insight' ); ?></p>
				</div>

				<div class="feature-box">
					<span class="dashicons dashicons-admin-appearance"></span>
					<h3><?php esc_html_e( 'Unlimited Color Schemes', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( 'Customize every color to match your brand identity with unlimited color options.', 'fitness-insight' ); ?></p>
				</div>

				<div class="feature-box">
					<span class="dashicons dashicons-download"></span>
					<h3><?php esc_html_e( 'One-Click Demo Import', 'fitness-insight' ); ?></h3>
					<p><?php esc_html_e( 'Import the complete demo content with one click and get your site ready instantly.', 'fitness-insight' ); ?></p>
				</div>
			</div>
		</div>

		<div class="ot-pro-comparison">
			<h2><?php esc_html_e( 'Free vs Pro Comparison', 'fitness-insight' ); ?></h2>

			<table class="comparison-table">
				<thead>
					<tr>
						<th><?php esc_html_e( 'Feature', 'fitness-insight' ); ?></th>
						<th><?php esc_html_e( 'Free', 'fitness-insight' ); ?></th>
						<th class="pro-col"><?php esc_html_e( 'Pro', 'fitness-insight' ); ?></th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td><?php esc_html_e( 'WordPress Customizer Support', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Demo Importer', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Responsive Design', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Color Options', 'fitness-insight' ); ?></td>
						<td><?php esc_html_e( 'Limited', 'fitness-insight' ); ?></td>
						<td class="pro-col"><?php esc_html_e( 'Unlimited', 'fitness-insight' ); ?></td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Typography Controls (Heading &amp; Body Font)', 'fitness-insight' ); ?></td>
						<td><?php esc_html_e( 'Basic', 'fitness-insight' ); ?></td>
						<td class="pro-col"><?php esc_html_e( 'Advanced', 'fitness-insight' ); ?></td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Sticky Header', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Preloader / Loader', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Scroll-to-Top Button', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Homepage Slider Section', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Social Media Links', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'WooCommerce Support', 'fitness-insight' ); ?></td>
						<td><?php esc_html_e( 'Basic', 'fitness-insight' ); ?></td>
						<td class="pro-col"><?php esc_html_e( 'Advanced Styling', 'fitness-insight' ); ?></td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Section Reordering', 'fitness-insight' ); ?></td>
						<td>&#10060;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Boxed / Full-Width Layout', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Left / Right Sidebar', 'fitness-insight' ); ?></td>
						<td>&#9989;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Priority Support', 'fitness-insight' ); ?></td>
						<td>&#10060;</td>
						<td class="pro-col">&#9989;</td>
					</tr>
				</tbody>
			</table>
		</div>

		<div class="ot-pro-testimonials">
			<h2><?php esc_html_e( 'What Our Users Say', 'fitness-insight' ); ?></h2>

			<div class="testimonial-grid">
				<div class="testimonial-box">
					<div class="stars">&#11088;&#11088;&#11088;&#11088;&#11088;</div>
					<p><?php esc_html_e( '"I was looking for a clean and professional theme for my business and this theme delivered exactly that. Setup was quick and the layout looks very modern."', 'fitness-insight' ); ?></p>
					<span class="author"><?php esc_html_e( '- John D.', 'fitness-insight' ); ?></span>
				</div>

				<div class="testimonial-box">
					<div class="stars">&#11088;&#11088;&#11088;&#11088;</div>
					<p><?php esc_html_e( '"The theme design is professional and easy to customize. The documentation helped me set up my Fitness Insight website without any issues."', 'fitness-insight' ); ?></p>
					<span class="author"><?php esc_html_e( '- Sarah M.', 'fitness-insight' ); ?></span>
				</div>

				<div class="testimonial-box">
					<div class="stars">&#11088;&#11088;&#11088;&#11088;&#11088;</div>
					<p><?php esc_html_e( '"Very flexible and beginner-friendly. I was able to adjust colors, sections, and layouts directly from the Customizer. Highly recommended."', 'fitness-insight' ); ?></p>
					<span class="author"><?php esc_html_e( '- Michael R.', 'fitness-insight' ); ?></span>
				</div>

				<div class="testimonial-box">
					<div class="stars">&#11088;&#11088;&#11088;&#11088;</div>
					<p><?php esc_html_e( '"The mobile responsive design works perfectly. Most of my clients visit from their phones, and the site looks clean and professional."', 'fitness-insight' ); ?></p>
					<span class="author"><?php esc_html_e( '- Emily T.', 'fitness-insight' ); ?></span>
				</div>

				<div class="testimonial-box">
					<div class="stars">&#11088;&#11088;&#11088;&#11088;&#11088;</div>
					<p><?php esc_html_e( '"Great theme for professionals. The service sections and homepage layout helped me present my services clearly to potential clients."', 'fitness-insight' ); ?></p>
					<span class="author"><?php esc_html_e( '- David L.', 'fitness-insight' ); ?></span>
				</div>

				<div class="testimonial-box">
					<div class="stars">&#11088;&#11088;&#11088;&#11088;</div>
					<p><?php esc_html_e( '"Customer support is very helpful and responsive. They guided me during setup and solved my issue quickly."', 'fitness-insight' ); ?></p>
					<span class="author"><?php esc_html_e( '- Jennifer K.', 'fitness-insight' ); ?></span>
				</div>

				<div class="testimonial-box">
					<div class="stars">&#11088;&#11088;&#11088;&#11088;&#11088;</div>
					<p><?php esc_html_e( '"Fast loading and SEO friendly. After launching my website with this theme, I started receiving more inquiries from clients."', 'fitness-insight' ); ?></p>
					<span class="author"><?php esc_html_e( '- Robert H.', 'fitness-insight' ); ?></span>
				</div>

				<div class="testimonial-box">
					<div class="stars">&#11088;&#11088;&#11088;&#11088;</div>
					<p><?php esc_html_e( '"A very good theme with useful features for Fitness Insight businesses. Easy to install and the demo import was a real time-saver."', 'fitness-insight' ); ?></p>
					<span class="author"><?php esc_html_e( '- Lisa P.', 'fitness-insight' ); ?></span>
				</div>
			</div>
		</div>

		<div class="ot-pro-cta">
			<h2><?php esc_html_e( 'Ready to Upgrade?', 'fitness-insight' ); ?></h2>
			<p><?php esc_html_e( 'Join hundreds of satisfied customers who upgraded to Pro', 'fitness-insight' ); ?></p>
			<?php
			$fitness_insight_theme = wp_get_theme();
			$fitness_insight_theme_name = $fitness_insight_theme->get( 'Name' );
			?>

			<a href="<?php echo esc_url( FITNESS_INSIGHT_BUY_PRO ); ?>" target="_blank" class="button button-primary button-hero">
				<?php echo esc_html( sprintf( __( 'Get %s Pro Now', 'fitness-insight' ), $fitness_insight_theme_name ) ); ?> &rarr;
			</a>
		</div>

		<div class="ot-pro-footer">
			<p>
				<?php
				printf(
					/* translators: %s: Support URL */
					__( 'Need help? Contact our <a href="%s" target="_blank">support</a> team anytime.', 'fitness-insight' ),
					esc_url( FITNESS_INSIGHT_SUPPORT )
				);
				?>
			</p>
		</div>
	</div>
	<?php
}
