<?php
/*
 * @package Nova Autocare
 */

 function nova_autocare_admin_enqueue_scripts() {
    wp_enqueue_style( 'nova-autocare-admin-style', esc_url( get_template_directory_uri() ).'/getstart/getstart.css' );
}
add_action( 'admin_enqueue_scripts', 'nova_autocare_admin_enqueue_scripts' );

function nova_autocare_admin_notice_scripts( $hook ) {

	wp_enqueue_script(
		'nova-autocare-admin-notice',
		get_template_directory_uri() . '/js/admin-notice.js',
		array( 'jquery' ),
		'1.0',
		true
	);

	wp_localize_script(
		'nova-autocare-admin-notice',
		'nova_autocare_localize',
		array(
			'ajax_url' => admin_url( 'admin-ajax.php' ),
			'nonce'    => wp_create_nonce( 'nova_autocare_notice_nonce' ),
		)
	);
}
add_action( 'admin_enqueue_scripts', 'nova_autocare_admin_notice_scripts' );

function nova_autocare_deprecated_hook_admin_notice() {

	// Don't show if dismissed.
	if ( get_option( 'dismissed-get_started_notice', false ) ) {
		return;
	}

	$screen = get_current_screen();

	// Don't show on the Getting Started page.
	if ( $screen && 'appearance_page_nova-autocare' === $screen->id ) {
		return;
	}

	$nova_autocare_comments_theme = wp_get_theme();
	?>

	<div class="nova-autocare-notice-wrapper notice notice-get-started-class is-dismissible" data-notice="get_started_notice">
		<div class="nova-autocare-notice">
			<div class="nova-autocare-notice-content">
				<div class="nova-autocare-notice-heading">
					<h2 class="notice-title1"><?php echo esc_html__('Welcome! Thanks For Installing', 'nova-autocare' ); ?></h2>
					<h2 class="notice-title2"><?php echo esc_html( $nova_autocare_comments_theme ); ?> 🎉</h2>
					<p class="notice-text">
						<?php
						printf(
							/* translators: %s: Theme name */
							esc_html__( "You're all set to build something amazing.", 'nova-autocare' ),
						);
						?>
					</p>
				</div>
				<div class="diplay-flex-btn">
					<a class="button button-primary theme-install nova-autocare-get-started"
						href="<?php echo esc_url( admin_url( 'themes.php?page=nova-autocare' ) ); ?>">
						<?php echo esc_html__('GET STARTED', 'nova-autocare' ); ?>
					</a>

					<a class="button button-primary" target="_blank"
						href="<?php echo esc_url( NOVA_AUTOCARE_PREMIUM_PAGE ); ?>">
						<?php echo esc_html__('GO PRO', 'nova-autocare' ); ?>
					</a>

					<a class="button button-primary" target="_blank"
						href="<?php echo esc_url( NOVA_AUTOCARE_BUNDLE_PAGE ); ?>">
						<?php echo esc_html__('Get Bundle', 'nova-autocare' ); ?>
					</a>
				</div>
			</div>
			<div class="nova-autocare-notice-img">
				<img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/btm-bundle-img.png'); ?>" alt="<?php echo esc_attr('Logo', 'nova-autocare' ); ?>">
			</div>
		</div>
	</div>
	<?php
}
add_action( 'admin_notices', 'nova_autocare_deprecated_hook_admin_notice' );

// After switching theme, reset dismissed notice option
add_action('after_switch_theme', 'nova_autocare_after_switch_theme');
function nova_autocare_after_switch_theme() {
    update_option('dismissed-get_started_notice', FALSE);
}

function nova_autocare_dismiss_admin_notice() {
	check_ajax_referer( 'nova_autocare_notice_nonce', 'nonce' );
	update_option( 'dismissed-get_started_notice', true );
	wp_send_json_success();
}
add_action( 'wp_ajax_nova_autocare_dismiss_admin_notice', 'nova_autocare_dismiss_admin_notice' );

function nova_autocare_dismiss_quick_start_guide() {
	check_ajax_referer( 'nova_autocare_notice_nonce', 'nonce' );
	update_option( 'dismissed-quick_start_guide', true );
	wp_send_json_success();
}
add_action( 'wp_ajax_nova_autocare_dismiss_quick_start_guide', 'nova_autocare_dismiss_quick_start_guide' );

function nova_autocare_theme_info_menu_link() {
    $nova_autocare_theme = wp_get_theme();
    add_theme_page(
        /* translators: 1: Theme name. */
        sprintf( esc_html__( 'Welcome to %1$s', 'nova-autocare' ), $nova_autocare_theme->get( 'Name' )),
        esc_html__( 'Getting Started', 'nova-autocare' ),
        'edit_theme_options',
        'nova-autocare',
        'nova_autocare_theme_info_page'
    );
}
add_action( 'admin_menu', 'nova_autocare_theme_info_menu_link' );

function nova_autocare_theme_info_page() {
    $nova_autocare_theme = wp_get_theme();
    ?>
    <div class="getstarted-info">
        <!-- quick start guide -->
       <?php if ( ! get_option( 'dismissed-quick_start_guide', false ) ) : ?>
       <div class="quick-start-guide" data-notice="quick_start_guide">
         <div class="left-info">
            <i class="dashicons dashicons-store gradient-text"></i>
            <p><?php echo esc_html__('New here? Check our quick start guide to launch your website in minutes.','nova-autocare'); ?></p>
         </div>
         <div class="right-info">
            <a class="gradient-text" href="<?php echo esc_url( NOVA_AUTOCARE_THEME_DOCUMENTATION ); ?>" target="_blank"><?php echo esc_html__('View Quick Start Guide','nova-autocare'); ?><i class="dashicons dashicons-arrow-right-alt"></i></a>
            <button class="quick-start-guide-dismiss" aria-label="<?php esc_attr_e( 'Dismiss', 'nova-autocare' ); ?>">&times;</button>
         </div>
       </div>
       <?php endif; ?>
       <!-- getstart banner -->
        <div class="getstart-banner">
            <div class="left-banner-info">
                <h4><?php echo esc_html__('Unlock the Full Power of','nova-autocare'); ?></h4>
                <h2><i class="dashicons dashicons-star-filled"></i><?php echo esc_html__('Nova Themes','nova-autocare'); ?></h2>
                <div class="information">
                    <div class="theme-info">
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Premium Starter Sites','nova-autocare'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Advanced Theme Options','nova-autocare'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Priority Support & Updates','nova-autocare'); ?></p>
                    </div>
                    <div class="theme-info">
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Custom Templates & Parts','nova-autocare'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('WooCommerce Compatible','nova-autocare'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Regular Updates & Support','nova-autocare'); ?></p>
                    </div>
                </div>
                <div class="left-btn">
                    <a href="<?php echo esc_url( NOVA_AUTOCARE_PREMIUM_PAGE ); ?>" target="_blank"><?php echo esc_html__('Upgrade To Premium at $45 ','nova-autocare'); ?><i class="dashicons dashicons-arrow-right-alt"></i></a>
                    <a href="<?php echo esc_url( NOVA_AUTOCARE_PRO_DEMO ); ?>" target="_blank"><?php echo esc_html__('Live Demo','nova-autocare'); ?></a>
                </div>
            </div>
            <div class="middle-banner-info">
                <div class="bundle-image">
                    <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/mid-bundle-img.png'); ?>" alt="<?php echo esc_attr( 'bundle image', 'nova-autocare'); ?>"/>
                </div>
            </div>
            <div class="right-banner-info">
                <div class="right-info">
                    <div class="theme-bundle">
                        <div class="save-tag"><?php echo esc_html__('SAVE BIG!','nova-autocare'); ?></div>
                        <h4><?php echo esc_html__('Get Theme Bundle','nova-autocare'); ?></h4>
                        <h2><span class="text"><?php echo esc_html__('For','nova-autocare'); ?></span><?php echo esc_html__('$79','nova-autocare'); ?><span class="value"><?php echo esc_html__('$3799','nova-autocare'); ?></span></h2>
                        <div class="right-btn">
                            <a href="<?php echo esc_url( NOVA_AUTOCARE_BUNDLE_PAGE ); ?>" target="_blank"><?php echo esc_html__('Get Bundle Now','nova-autocare'); ?></a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- getstart Info -->
         <div class="getstart-info">
            <div class="left-getstart-info">
                <!-- About Theme -->
                 <div class="about-desc">
                    <div class="about-info">
                        <div class="names">
                            <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/logo.png'); ?>" alt="<?php echo esc_attr( 'Logo', 'nova-autocare'); ?>"/>
                            <h2><?php echo esc_html__('About Nova Themes','nova-autocare'); ?></h2>
                        </div>
                        <p><?php echo esc_html__('Nova Themes is dedicated to creating modern, fast, and flexible WordPress themes that help you build stunning websites with ease. Our themes are perfect for any business, blog, portfolio, or online store.','nova-autocare'); ?></p>
                        <div class="icon-info">
                            <div class="icon-structure">
                                <i class="dashicons dashicons-search gradient-text"></i>
                                <p><?php echo esc_html__('Lightning Fast','nova-autocare'); ?></p>
                            </div>
                            <div class="icon-structure"><span class=""></span>
                                <i class="dashicons dashicons-smartphone gradient-text"></i>
                                <p><?php echo esc_html__('SEO Optimized','nova-autocare'); ?></p>
                            </div>
                            <div class="icon-structure">
                                <i class="dashicons dashicons-admin-customizer gradient-text"></i>
                                <p><?php echo esc_html__('Mobile Friendly','nova-autocare'); ?></p>
                            </div>
                            <div class="icon-structure">
                                <i class="dashicons dashicons-layout gradient-text"></i>
                                <p><?php echo esc_html__('Easy to Customize','nova-autocare'); ?></p>
                            </div>
                        </div>
                    </div>
                    <div class="about-image">
                        <img src="<?php echo esc_url( $nova_autocare_theme->get_screenshot() ); ?>" alt="<?php echo esc_attr( 'screenshot', 'nova-autocare'); ?>"/>
                    </div>
                 </div>
                <!-- Important Links -->
                <div class="important-info">
                    <h3><?php echo esc_html__('Important Links','nova-autocare'); ?></h4>
                    <div class="links-cards">
                        <div class="links-card first-card">
                            <i class="dashicons dashicons-admin-appearance"></i>
                            <h4><?php echo esc_html__( 'Site Editor', 'nova-autocare' ); ?></h4>
                            <p><?php echo esc_html__( 'Edit templates, patterns, and styles easily with the WordPress Site Editor.', 'nova-autocare' ); ?></p>
                            <br>
                            <a href="<?php echo esc_url( admin_url( 'site-editor.php' ) ); ?>" target="_blank"><?php echo esc_html__( 'Go to Editor', 'nova-autocare' ); ?></a>
                        </div>
                        <div class="links-card second-card">
                            <i class="dashicons dashicons-admin-users"></i>
                            <h4><?php echo esc_html__('Need Help?','nova-autocare'); ?></h4>
                            <p><?php echo esc_html__('Visit our support center for docs, tutorials and frequently asked questions.','nova-autocare'); ?></p>
                            <br>
                            <a href="<?php echo esc_url( NOVA_AUTOCARE_SUPPORT ); ?>" target="_blank"><?php echo esc_html__('Get Support','nova-autocare'); ?></a>
                        </div>
                        <div class="links-card first-card">
                            <i class="dashicons dashicons-star-filled"></i>
                            <h4><?php echo esc_html__('Leave a Review','nova-autocare'); ?></h4>
                            <p><?php echo esc_html__('Love our theme? Please consider leaving a review. It means a lot to us!','nova-autocare'); ?></p>
                            <br>
                            <a href="<?php echo esc_url( NOVA_AUTOCARE_REVIEW ); ?>" target="_blank"><?php echo esc_html__('Rate Us','nova-autocare'); ?></a>
                        </div>
                    </div>
                </div>
                <!-- Premium Sec -->
                 <div class="premium-sec">
                    <div class="premium-left-sec">
                        <h3><?php echo esc_html__('Why Go For Premium?','nova-autocare'); ?></h3>
                        <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/premium-img.png'); ?>" alt="<?php echo esc_attr( 'premium image', 'nova-autocare'); ?>"/>
                    </div>
                    <div class="premium-right-sec">
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Premium Starter Sites','nova-autocare'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Advanced Theme Options','nova-autocare'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('WooCommerce Ready','nova-autocare'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Priority Support','nova-autocare'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('Regular Updates','nova-autocare'); ?></p>
                        <p><i class="dashicons dashicons-yes-alt"></i><?php echo esc_html__('And Much More...','nova-autocare'); ?></p>
                    </div>
                 </div>
            </div>
            <div class="right-getstart-info">
              <div class="right-premium-info">
                <h3><?php echo esc_html__('👑 Go Premium','nova-autocare'); ?></h3>
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/premium-img1.png'); ?>" alt="<?php echo esc_attr( 'bundle image', 'nova-autocare'); ?>"/>
                <div class="info-list">
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('Access to All Premium Themes','nova-autocare'); ?></p>
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('One Click Demo Import','nova-autocare'); ?></p>
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('Advanced Customization','nova-autocare'); ?></p>
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('Premium Support','nova-autocare'); ?></p>
                    <p><i class="dashicons dashicons-saved"></i><?php echo esc_html__('Lifetime Updates','nova-autocare'); ?></p>
                </div>
                <h4><?php echo esc_html__('Save Big! ','nova-autocare'); ?><span class="color-word gradient-text"><?php echo esc_html__('Extra 20% OFF','nova-autocare'); ?></span><span class="small-word"></span><?php echo esc_html__(' on','nova-autocare'); ?></h4>
                <h5><?php echo esc_html__('All Premium Themes','nova-autocare'); ?></h5>
                <h5><?php echo esc_html__('Use Code: ','nova-autocare'); ?><strong><?php echo esc_html__('FLAT20','nova-autocare'); ?></strong></h5>
                <div class="premium-info-btn">
                 <a href="<?php echo esc_url( NOVA_AUTOCARE_PREMIUM_PAGE ); ?>" target="_blank">
                    <h5><?php echo esc_html__('Upgrade To Pro','nova-autocare'); ?></h5>
                    <h6><?php echo esc_html__('Just ','nova-autocare'); ?><span class="reg-price"><?php echo esc_html__('$59.00','nova-autocare'); ?></span><span class="sel-price"><?php echo esc_html__('$45.00','nova-autocare'); ?></span></h6>
                 </a>
                </div>
              </div>
              <div class="right-info-desc">
                <h3><?php echo esc_html__('Explore Our Themes','nova-autocare'); ?></h3>
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/btm-bundle-img.png'); ?>" alt="<?php echo esc_attr( 'bundle image', 'nova-autocare'); ?>"/><br><br>
                <h5><?php echo esc_html__('Beautiful, Fast & Reliable','nova-autocare'); ?></h5>
                <h5><?php echo esc_html__('WordPress Themes','nova-autocare'); ?></h5><br>
                <div class="theme-btn">
                 <a href="<?php echo esc_url( NOVA_AUTOCARE_COLLECTION_PAGE ); ?>" class="gradient-text" target="_blank"><?php echo esc_html__('View All Themes','nova-autocare'); ?></a>
                </div>
              </div>
            </div>
         </div>
        <!-- Icons Info -->
        <div class="icon-cards">
            <div class="icon-card">
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/card-img1.png'); ?>" alt="<?php echo esc_attr( 'Card Image', 'nova-autocare'); ?>"/>
                <div class="icon-desc">
                    <h4><?php echo esc_html__('Trusted by Thousands','nova-autocare'); ?></h4>
                    <p><?php echo esc_html__('Join thousands of happy customers using Nova Themes.','nova-autocare'); ?></p>
                </div>
            </div>
            <div class="icon-card">
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/card-img2.png'); ?>" alt="<?php echo esc_attr( 'Card Image', 'nova-autocare'); ?>"/>
                <div class="icon-desc">
                    <h4><?php echo esc_html__('Regular Updates','nova-autocare'); ?></h4>
                    <p><?php echo esc_html__('We update our themes regularly with new features.','nova-autocare'); ?></p>
                </div>
            </div>
            <div class="icon-card">
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/card-img3.png'); ?>" alt="<?php echo esc_attr( 'Card Image', 'nova-autocare'); ?>"/>
                <div class="icon-desc">
                    <h4><?php echo esc_html__('Secure & Reliable','nova-autocare'); ?></h4>
                    <p><?php echo esc_html__('Clean code, secure & built with best practices.','nova-autocare'); ?></p>
                </div>
            </div>
            <div class="icon-card">
                <img src="<?php echo esc_url( get_template_directory_uri().'/getstart/images/card-img4.png'); ?>" alt="<?php echo esc_attr( 'Card Image', 'nova-autocare'); ?>"/>
                <div class="icon-desc">
                    <h4><?php echo esc_html__('Dedicated Support','nova-autocare'); ?></h4>
                    <p><?php echo esc_html__('We\'re here to help you succeed. Anytime.','nova-autocare'); ?></p>
                </div>
            </div>
        </div>
    </div>
<?php
}
?>