<section class="carkit-onboard-area-wrapper">
    <div class="carkit-onboard-wrapper">

        <div class="carkit-onboard-slider">
            <!-- STEP 1 -->
            <div class="carkit-onboard-slide is-current">
                <div class="carkit-onboard-slide-wrapper">
                    <div class="carkit-content-large">
                        <div class="carkit-section-title">
                            <h2>
                                <?php esc_html_e( 'Welcome to Car Dealership CarKit!', 'car-dealership-carkit' ); ?>
                            </h2>
                            <p>
                                <?php esc_html_e( 'You’re just a few clicks away from a beautiful, conversion-focused auto dealership site.', 'car-dealership-carkit' ); ?>
                            </p>
                            <?php
                                if(file_exists(get_stylesheet_directory() .'/includes/theme-help/links.php')) {
                                    locate_template( '/includes/theme-help/links.php', true, true );
                                }
                            ?>
                        </div>
                    </div>
                    <div class="carkit-dash-notice">
                        <span>
                            <span class="dashicons dashicons-yes-alt"></span>
                        </span>
                        <span>
                        <?php esc_html_e('Click below to install and active Themes Demo Importer Plugin.', 'car-dealership-carkit'); ?>
                        </span>
                    </div>
                    <div class="carkit-button-well">
                    <p></p>
                                <?php
                                    $plugin = 'elementor/elementor.php';
                                    $installed_plugins = get_plugins();
                                    $is_elementor_installed = isset( $installed_plugins[ $plugin ] );
                                    $elementor_version = NULL;
                                    if($is_elementor_installed) {
                                        $plugin_data = get_file_data(WP_PLUGIN_DIR.'/'.$plugin, array('Version' => 'Version'), false);
                                        $elementor_version = $plugin_data['Version'];
                                    }
                                ?>
                                <?php if ( version_compare( PHP_VERSION, '7.0', '>=' ) || ($elementor_version && version_compare( $elementor_version, '3.7', '<') )) :?>
                                    <?php if ( file_exists(ABSPATH . 'wp-content/plugins/one-click-demo-import/one-click-demo-import.php') && !in_array( 'one-click-demo-import/one-click-demo-import.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ):?>
                                        <p><a data-slug="one-click-demo-import,directorykit-car-dealer-addon" data-filename="one-click-demo-import" href="#" class="button button-primary car-dealership-carkit-install-activate-plugin"><?php esc_html_e('Activate Demo Importer Plugin', 'car-dealership-carkit'); ?></a></p>
                                    <?php elseif ( file_exists(ABSPATH . 'wp-content/plugins/one-click-demo-import/one-click-demo-import.php') && in_array( 'one-click-demo-import/one-click-demo-import.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) )):?>
                                        <p><a href="<?php echo esc_url(get_admin_url() . "themes.php?page=one-click-demo-import");?>" class="button button-primary"><?php esc_html_e('Go to Demo Importer Page', 'car-dealership-carkit'); ?></a></p>
                                    <?php else:?>
                                        <p><a data-slug="one-click-demo-import,directorykit-car-dealer-addon" data-filename="one-click-demo-import" href="<?php echo esc_url(admin_url('themes.php?page=one-click-demo-import'));?>" class="button button-primary car-dealership-carkit-install-activate-plugin"><?php esc_html_e('Install Demo Importer Plugin', 'car-dealership-carkit'); ?></a></p>
                                    <?php endif;?>
                                <?php else: ?>
                                    <p class="welcome-theme-alert-error"><?php esc_html_e('Your php version not support latest Elementor Plugin, in such case eventually you can try older upload Elementor Version (<3.7) or Update PHP on your server', 'car-dealership-carkit'); ?></p>
                                <?php endif; ?>
                                </div>       
                </div>

                <div class="carkit-demo-visual">
                    <img src="<?php echo esc_url( get_stylesheet_directory_uri() . '/assets/images/help.jpg' ); ?>" alt="<?php esc_attr_e('Theme dashboard welcome illustration', 'car-dealership-carkit'); ?>" loading="lazy"/>
                </div>
            </div>
        </div>
    </div>
</section>

<?php

// Enqueue dashboard-specific styles
wp_enqueue_style(
    'carkit-dash',
    get_template_directory_uri() . '/assets/css/dash.css',
    array(),
    '1.0'
);
?>