<?php
defined('ABSPATH') || exit;

// if logout is true, then logout the user
if (isset($_GET['logout'])) {
    delete_option('ai_botkit_saas_connect_token');
}
?>

<div class="ai-botkit-new-dashboard">
    <div class="ai-botkit-dashboard-header">
        <img src="<?php echo esc_url(plugins_url('../logo.png', __FILE__)); ?>" alt="AI BotKit Logo" class="ai-botkit-logo">
    </div>
    <div class="ai-botkit-dashboard-container">
        <div class="ai-botkit-dashboard-sidebar">
            <h1 class="ai-botkit-main-title"><?php esc_html_e('Build AI Chatbots in Minutes', 'ai-botkit-for-lead-generation'); ?> <img src="<?php echo esc_url(plugins_url('../public/images/sparkle.svg', dirname(__FILE__))); ?>" alt="AI-Powered Conversations"></h1>
            <p class="ai-botkit-subtitle"><?php esc_html_e('No coding required, Just design, train and deploy.', 'ai-botkit-for-lead-generation'); ?></p>
            <div class="ai-botkit-features">
                <div class="ai-botkit-feature-item">
                    <img src="<?php echo esc_url(plugins_url('../public/images/brain.svg', dirname(__FILE__))); ?>" alt="AI-Powered Conversations">
                    <div class="ai-botkit-feature-text">
                        <h3 class="ai-botkit-feature-title"><?php esc_html_e('AI-Powered Conversations', 'ai-botkit-for-lead-generation'); ?></h3>
                        <p><?php esc_html_e('Create a natural-sounding chatbot with advanced language processing.', 'ai-botkit-for-lead-generation'); ?></p>
                    </div>
                </div>
                <div class="ai-botkit-feature-item">
                    <img src="<?php echo esc_url(plugins_url('../public/images/bulb.svg', dirname(__FILE__))); ?>" alt="Knowledge Training">
                    <div class="ai-botkit-feature-text">
                        <h3 class="ai-botkit-feature-title"><?php esc_html_e('Knowledge Training', 'ai-botkit-for-lead-generation'); ?></h3>
                        <p><?php esc_html_e('Intelligent, smart answer with knowledge training.', 'ai-botkit-for-lead-generation'); ?></p>
                    </div>
                </div>
                <div class="ai-botkit-feature-item">
                    <img src="<?php echo esc_url(plugins_url('../public/images/rocket.svg', dirname(__FILE__))); ?>" alt="Deploy Anywhere">
                    <div class="ai-botkit-feature-text">
                        <h3 class="ai-botkit-feature-title"><?php esc_html_e('Deploy Anywhere', 'ai-botkit-for-lead-generation'); ?></h3>
                        <p><?php esc_html_e('Integrate your chatbots with website, app, and messaging platforms.', 'ai-botkit-for-lead-generation'); ?></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="ai-botkit-dashboard-main">
            <div class="ai-botkit-login-box">
                <h2><?php esc_html_e('Welcome', 'ai-botkit-for-lead-generation'); ?></h2>
                <!-- <div class="ai-botkit-get-started">
                    <h3><?php esc_html_e('Ready to create your first chatbot?', 'ai-botkit-for-lead-generation'); ?></h3>
                    <p><?php esc_html_e('Get started by analyzing your website and creating your first AI-powered chatbot in just minutes.', 'ai-botkit-for-lead-generation'); ?></p>
                    <a href="<?php echo esc_url(admin_url('admin.php?page=ai-botkit&tab=onboarding')); ?>" class="ai-botkit-button-primary">
                        <?php esc_html_e('Lets get started', 'ai-botkit-for-lead-generation'); ?>
                        <img src="<?php echo esc_url(plugins_url('../public/images/icon-chevron-right.svg', dirname(__FILE__))); ?>" alt="">
                    </a>
                </div>
                <div class="ai-botkit-separator">OR</div> -->
                <div class="ai-botkit-login-form">
                    <h3><?php esc_html_e('Ready to create your first chatbot?', 'ai-botkit-for-lead-generation'); ?></h3>
                    <p><?php esc_html_e('Get started by creating your first AI-powered chatbot in just minutes.', 'ai-botkit-for-lead-generation'); ?></p>
                    <div class="ai-botkit-input-group">
                        <button class="ai-botkit-button" id="ai-botkit-saas-connect-button"><?php esc_html_e('Login', 'ai-botkit-for-lead-generation'); ?></button>
                    </div>
                </div>
                <!-- <div class="ai-botkit-login-form">
                    <h3><?php esc_html_e('Already have an account?', 'ai-botkit-for-lead-generation'); ?></h3>
                    <p><?php esc_html_e('Connect your existing AI BotKit account to access all your chatbots.', 'ai-botkit-for-lead-generation'); ?></p>
                    <div class="ai-botkit-input-group">
                        <button class="ai-botkit-button" id="ai-botkit-saas-connect-button"><?php esc_html_e('Login to Connect', 'ai-botkit-for-lead-generation'); ?></button>
                    </div>
                </div> -->
            </div>
        </div>
    </div>
</div>
<div id="ai-botkit-confirm-saas-login-modal" class="ai-botkit-modal-overlay">
    <div class="ai-botkit-kb-modal">
        <div class="ai-botkit-modal-header">
            <h3><?php esc_html_e('Login successful', 'ai-botkit-for-lead-generation'); ?></h3>
            <img src="<?php echo esc_url(plugins_url('../public/images/sparkle.svg', dirname(__FILE__))); ?>" alt="Success">
        </div>
        <div class="ai-botkit-modal-body">
            <p><?php esc_html_e('You have successfully connected your WordPress account to your AI chatbot kit website. Now you can see all your chatbots that you have made into your AI botkit website.', 'ai-botkit-for-lead-generation'); ?></p>
        </div>
        <div class="ai-botkit-modal-footer">
            <a href="<?php echo esc_url(admin_url('admin.php?page=ai-botkit&tab=chatbots')); ?>" class="ai-botkit-btn ai-botkit-btn-primary">
                <?php esc_html_e('Dashboard', 'ai-botkit-for-lead-generation'); ?>
                <i class="ti ti-chevron-right"></i>
            </a>
        </div>
    </div>
</div>
