<?php
/**
 * Forumax Dashboard Template
 *
 * Displays comprehensive forum statistics, quick actions, and system status.
 *
 * @package Forumax
 * @since   2.1.0
 */

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

?>
<style>
.forumax-stat-unanswered .forumax-stat-number {
    color: #f59e0b;
}
.forumax-recent-unanswered .forumax-empty-state .dashicons {
    color: #4ade80;
}
</style>
<?php

if (!class_exists('bbPress')) {
    ?>
    <div class="wrap">
        <div class="forumax-dashboard-error">
            <h2>
                <?php esc_html_e('bbPress is Required', 'forumax'); ?>
            </h2>
            <p>
                <?php esc_html_e('The Forumax Dashboard requires bbPress to be installed and activated.', 'forumax'); ?>
            </p>
        </div>
    </div>
    <?php
    return;
}

// Get forum statistics.
$stats = bbp_get_statistics();

// Extract statistics with defaults.
$forum_count = isset($stats['forum_count_int']) ? (int) $stats['forum_count_int'] : 0;
$topic_count = isset($stats['topic_count_int']) ? (int) $stats['topic_count_int'] : 0;
$topic_count_hidden = isset($stats['topic_count_hidden_int']) ? (int) $stats['topic_count_hidden_int'] : 0;
$reply_count = isset($stats['reply_count_int']) ? (int) $stats['reply_count_int'] : 0;
$reply_count_hidden = isset($stats['reply_count_hidden_int']) ? (int) $stats['reply_count_hidden_int'] : 0;
$topic_tag_count = isset($stats['topic_tag_count_int']) ? (int) $stats['topic_tag_count_int'] : 0;
$user_count = isset($stats['user_count_int']) ? (int) $stats['user_count_int'] : 0;

// Get additional statistics.
$published_topics = $topic_count - $topic_count_hidden;
$published_replies = $reply_count - $reply_count_hidden;

// Get recent topics.
$recent_topics = new WP_Query(array(
    'post_type' => bbp_get_topic_post_type(),
    'posts_per_page' => 5,
    'post_status' => 'publish',
    'orderby' => 'date',
    'order' => 'DESC',
));

// Get recent replies.
$recent_replies = new WP_Query(array(
    'post_type' => bbp_get_reply_post_type(),
    'posts_per_page' => 5,
    'post_status' => 'publish',
    'orderby' => 'date',
    'order' => 'DESC',
));

// Get pending/spam topics.
$pending_topics = new WP_Query(array(
    'post_type' => bbp_get_topic_post_type(),
    'posts_per_page' => -1,
    'post_status' => array('pending', 'spam'),
));
$pending_count = $pending_topics->found_posts;

// Calculate engagement metrics.
$avg_replies_per_topic = $published_topics > 0 ? round($published_replies / $published_topics, 1) : 0;

?>
<div class="wrap forumax-dashboard-wrap">
    <div class="forumax-dashboard">
        <!-- Dashboard Header -->
        <header class="forumax-dashboard-header">
            <div class="forumax-dashboard-header-left">
                <div class="forumax-logo">
                    <img src="<?php echo esc_url(FORUMAX_IMG . 'logo.svg'); ?>"
                        alt="<?php esc_attr_e('Forumax Logo', 'forumax'); ?>">
                </div>
                <div class="forumax-header-text">
                    <h1>
                        <?php esc_html_e('Dashboard', 'forumax'); ?>
                    </h1>
                    <p>
                        <?php esc_html_e('Your forum overview at a glance', 'forumax'); ?>
                    </p>
                </div>
            </div>
            <div class="forumax-dashboard-header-right">
                <span class="forumax-version">
                    <?php echo esc_html('v' . FORUMAX_VERSION); ?>
                </span>
                <a href="<?php echo esc_url(admin_url('admin.php?page=forumax-settings')); ?>"
                    class="forumax-btn forumax-btn-secondary">
                    <span class="dashicons dashicons-admin-generic"></span>
                    <?php esc_html_e('Settings', 'forumax'); ?>
                </a>
            </div>
        </header>

        <!-- Statistics Cards -->
        <section class="forumax-stats-section">
            <div class="forumax-stats-grid">
                <!-- Forums Card -->
                <div class="forumax-stat-card forumax-stat-forums">
                    <div class="forumax-stat-icon">
                        <span class="dashicons dashicons-buddicons-forums"></span>
                    </div>
                    <div class="forumax-stat-content">
                        <span class="forumax-stat-number">
                            <?php echo esc_html(number_format_i18n($forum_count)); ?>
                        </span>
                        <span class="forumax-stat-label">
                            <?php esc_html_e('Forums', 'forumax'); ?>
                        </span>
                    </div>
                    <a href="<?php echo esc_url(admin_url('edit.php?post_type=forum')); ?>"
                        class="forumax-stat-link">
                        <?php esc_html_e('View All', 'forumax'); ?>
                        <span class="dashicons dashicons-arrow-right-alt2"></span>
                    </a>
                </div>

                <!-- Unanswered Topics Card -->
                <div class="forumax-stat-card forumax-stat-unanswered">
                    <div class="forumax-stat-icon">
                        <span class="dashicons dashicons-format-status"></span>
                    </div>
                    <div class="forumax-stat-content">
                        <span class="forumax-stat-number">
                            <?php echo esc_html(number_format_i18n(forumax_get_unanswered_topics_count())); ?>
                        </span>
                        <span class="forumax-stat-label">
                            <?php esc_html_e('Unanswered', 'forumax'); ?>
                        </span>
                    </div>
                    <a href="<?php echo esc_url(admin_url('edit.php?post_type=topic&post_status=publish&forumax_filter=unanswered')); ?>"
                        class="forumax-stat-link">
                        <?php esc_html_e('View All', 'forumax'); ?>
                        <span class="dashicons dashicons-arrow-right-alt2"></span>
                    </a>
                </div>

                <!-- Topics Card -->
                <div class="forumax-stat-card forumax-stat-topics">
                    <div class="forumax-stat-icon">
                        <span class="dashicons dashicons-buddicons-topics"></span>
                    </div>
                    <div class="forumax-stat-content">
                        <span class="forumax-stat-number">
                            <?php echo esc_html(number_format_i18n($published_topics)); ?>
                        </span>
                        <span class="forumax-stat-label">
                            <?php esc_html_e('Topics', 'forumax'); ?>
                        </span>
                    </div>
                    <?php if ($topic_count_hidden > 0): ?>
                        <span class="forumax-stat-badge forumax-badge-warning"
                            title="<?php esc_attr_e('Hidden Topics', 'forumax'); ?>">
                            +
                            <?php echo esc_html($topic_count_hidden); ?>
                            <?php esc_html_e('hidden', 'forumax'); ?>
                        </span>
                    <?php endif; ?>
                    <a href="<?php echo esc_url(admin_url('edit.php?post_type=topic')); ?>"
                        class="forumax-stat-link">
                        <?php esc_html_e('View All', 'forumax'); ?>
                        <span class="dashicons dashicons-arrow-right-alt2"></span>
                    </a>
                </div>

                <!-- Replies Card -->
                <div class="forumax-stat-card forumax-stat-replies">
                    <div class="forumax-stat-icon">
                        <span class="dashicons dashicons-buddicons-replies"></span>
                    </div>
                    <div class="forumax-stat-content">
                        <span class="forumax-stat-number">
                            <?php echo esc_html(number_format_i18n($published_replies)); ?>
                        </span>
                        <span class="forumax-stat-label">
                            <?php esc_html_e('Replies', 'forumax'); ?>
                        </span>
                    </div>
                    <a href="<?php echo esc_url(admin_url('edit.php?post_type=reply')); ?>"
                        class="forumax-stat-link">
                        <?php esc_html_e('View All', 'forumax'); ?>
                        <span class="dashicons dashicons-arrow-right-alt2"></span>
                    </a>
                </div>

                <!-- Users Card -->
                <div class="forumax-stat-card forumax-stat-users">
                    <div class="forumax-stat-icon">
                        <span class="dashicons dashicons-groups"></span>
                    </div>
                    <div class="forumax-stat-content">
                        <span class="forumax-stat-number">
                            <?php echo esc_html(number_format_i18n($user_count)); ?>
                        </span>
                        <span class="forumax-stat-label">
                            <?php esc_html_e('Users', 'forumax'); ?>
                        </span>
                    </div>
                    <a href="<?php echo esc_url(admin_url('users.php')); ?>" class="forumax-stat-link">
                        <?php esc_html_e('View All', 'forumax'); ?>
                        <span class="dashicons dashicons-arrow-right-alt2"></span>
                    </a>
                </div>

                <!-- Topic Tags Card -->
                <div class="forumax-stat-card forumax-stat-tags">
                    <div class="forumax-stat-icon">
                        <span class="dashicons dashicons-tag"></span>
                    </div>
                    <div class="forumax-stat-content">
                        <span class="forumax-stat-number">
                            <?php echo esc_html(number_format_i18n($topic_tag_count)); ?>
                        </span>
                        <span class="forumax-stat-label">
                            <?php esc_html_e('Topic Tags', 'forumax'); ?>
                        </span>
                    </div>
                    <a href="<?php echo esc_url(admin_url('edit-tags.php?taxonomy=topic-tag')); ?>"
                        class="forumax-stat-link">
                        <?php esc_html_e('View All', 'forumax'); ?>
                        <span class="dashicons dashicons-arrow-right-alt2"></span>
                    </a>
                </div>

                <!-- Pending Moderation Card -->
                <div
                    class="forumax-stat-card forumax-stat-pending <?php echo $pending_count > 0 ? 'has-pending' : ''; ?>">
                    <div class="forumax-stat-icon">
                        <span class="dashicons dashicons-visibility"></span>
                    </div>
                    <div class="forumax-stat-content">
                        <span class="forumax-stat-number">
                            <?php echo esc_html(number_format_i18n($pending_count)); ?>
                        </span>
                        <span class="forumax-stat-label">
                            <?php esc_html_e('Pending Review', 'forumax'); ?>
                        </span>
                    </div>
                    <?php if ($pending_count > 0): ?>
                        <span class="forumax-stat-badge forumax-badge-alert">
                            <?php esc_html_e('Needs Attention', 'forumax'); ?>
                        </span>
                    <?php endif; ?>
                    <a href="<?php echo esc_url(admin_url('edit.php?post_type=topic&post_status=pending')); ?>"
                        class="forumax-stat-link">
                        <?php esc_html_e('View All', 'forumax'); ?>
                        <span class="dashicons dashicons-arrow-right-alt2"></span>
                    </a>
                </div>
            </div>
        </section>

        <!-- Main Dashboard Content -->
        <div class="forumax-dashboard-content">
            <!-- Left Column -->
            <div class="forumax-dashboard-main">
                <!-- Quick Actions -->
                <section class="forumax-card forumax-quick-actions">
                    <div class="forumax-card-header">
                        <h2><span class="dashicons dashicons-superhero"></span>
                            <?php esc_html_e('Quick Actions', 'forumax'); ?>
                        </h2>
                    </div>
                    <div class="forumax-card-body">
                        <div class="forumax-actions-grid">
                            <a href="<?php echo esc_url(admin_url('admin.php?page=forumax-builder')); ?>"
                                class="forumax-action-item">
                                <div class="forumax-action-icon">
                                    <span class="dashicons dashicons-welcome-widgets-menus"></span>
                                </div>
                                <span class="forumax-action-label">
                                    <?php esc_html_e('Forum Builder', 'forumax'); ?>
                                </span>
                            </a>
                            <a href="<?php echo esc_url(admin_url('post-new.php?post_type=forum')); ?>"
                                class="forumax-action-item">
                                <div class="forumax-action-icon">
                                    <span class="dashicons dashicons-plus-alt"></span>
                                </div>
                                <span class="forumax-action-label">
                                    <?php esc_html_e('New Forum', 'forumax'); ?>
                                </span>
                            </a>
                            <a href="<?php echo esc_url(admin_url('post-new.php?post_type=topic')); ?>"
                                class="forumax-action-item">
                                <div class="forumax-action-icon">
                                    <span class="dashicons dashicons-edit-page"></span>
                                </div>
                                <span class="forumax-action-label">
                                    <?php esc_html_e('New Topic', 'forumax'); ?>
                                </span>
                            </a>
                            <a href="<?php echo esc_url(admin_url('admin.php?page=forumax-settings')); ?>"
                                class="forumax-action-item">
                                <div class="forumax-action-icon">
                                    <span class="dashicons dashicons-admin-settings"></span>
                                </div>
                                <span class="forumax-action-label">
                                    <?php esc_html_e('Settings', 'forumax'); ?>
                                </span>
                            </a>
                        </div>
                    </div>
                </section>

                <!-- Recent Topics -->
                <section class="forumax-card forumax-recent-topics">
                    <div class="forumax-card-header">
                        <h2><span class="dashicons dashicons-buddicons-topics"></span>
                            <?php esc_html_e('Recent Topics', 'forumax'); ?>
                        </h2>
                        <a href="<?php echo esc_url(admin_url('edit.php?post_type=topic')); ?>"
                            class="forumax-view-all">
                            <?php esc_html_e('View All', 'forumax'); ?>
                        </a>
                    </div>
                    <div class="forumax-card-body">
                        <?php if ($recent_topics->have_posts()): ?>
                            <ul class="forumax-activity-list">
                                <?php
                                while ($recent_topics->have_posts()):
                                    $recent_topics->the_post();
                                    $topic_id = get_the_ID();
                                    $author_id = get_the_author_meta('ID');
                                    $author_name = get_the_author();
                                    $topic_forum = bbp_get_topic_forum_id($topic_id);
                                    $forum_title = get_the_title($topic_forum);
                                    $reply_count_topic = bbp_get_topic_reply_count($topic_id);
                                    ?>
                                    <li class="forumax-activity-item">
                                        <div class="forumax-activity-avatar">
                                            <?php echo get_avatar($author_id, 40); ?>
                                        </div>
                                        <div class="forumax-activity-content">
                                            <a href="<?php echo esc_url(get_edit_post_link($topic_id)); ?>"
                                                class="forumax-activity-title">
                                                <?php the_title(); ?>
                                            </a>
                                            <div class="forumax-activity-meta">
                                                <span class="forumax-activity-author">
                                                    <?php echo esc_html($author_name); ?>
                                                </span>
                                                <span class="forumax-activity-separator">•</span>
                                                <span class="forumax-activity-forum">
                                                    <?php echo esc_html($forum_title); ?>
                                                </span>
                                                <span class="forumax-activity-separator">•</span>
                                                <span class="forumax-activity-date">
                                                    <?php echo esc_html(human_time_diff(get_the_time('U'), current_time('timestamp'))); ?>
                                                    <?php esc_html_e('ago', 'forumax'); ?>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="forumax-activity-stats">
                                            <span class="forumax-reply-count"
                                                title="<?php esc_attr_e('Replies', 'forumax'); ?>">
                                                <span class="dashicons dashicons-admin-comments"></span>
                                                <?php echo esc_html($reply_count_topic); ?>
                                            </span>
                                        </div>
                                    </li>
                                <?php endwhile; ?>
                                <?php wp_reset_postdata(); ?>
                            </ul>
                        <?php else: ?>
                            <div class="forumax-empty-state">
                                <span class="dashicons dashicons-format-chat"></span>
                                <p>
                                    <?php esc_html_e('No topics yet. Create your first topic!', 'forumax'); ?>
                                </p>
                            </div>
                        <?php endif; ?>
                    </div>
                </section>

                <!-- Recent Unanswered Topics -->
                <section class="forumax-card forumax-recent-unanswered">
                    <div class="forumax-card-header">
                        <h2><span class="dashicons dashicons-flag"></span>
                            <?php esc_html_e('Unanswered Topics', 'forumax'); ?>
                        </h2>
                        <a href="<?php echo esc_url(admin_url('edit.php?post_type=topic&post_status=publish&forumax_filter=unanswered')); ?>"
                            class="forumax-view-all">
                            <?php esc_html_e('View All', 'forumax'); ?>
                        </a>
                    </div>
                    <div class="forumax-card-body">
                        <?php
                        $recent_unanswered = forumax_get_recent_unanswered_topics( 5 );
                        if ($recent_unanswered): ?>
                            <ul class="forumax-activity-list">
                                <?php
                                foreach ($recent_unanswered as $unanswered_topic):
                                    $topic_id = $unanswered_topic->ID;
                                    $author_id = $unanswered_topic->post_author;
                                    $author_name = get_the_author_meta('display_name', $author_id);
                                    $topic_forum = bbp_get_topic_forum_id($topic_id);
                                    $forum_title = get_the_title($topic_forum);
                                    ?>
                                    <li class="forumax-activity-item">
                                        <div class="forumax-activity-avatar">
                                            <?php echo get_avatar($author_id, 40); ?>
                                        </div>
                                        <div class="forumax-activity-content">
                                            <a href="<?php echo esc_url(get_edit_post_link($topic_id)); ?>"
                                                class="forumax-activity-title">
                                                <?php echo esc_html($unanswered_topic->post_title); ?>
                                            </a>
                                            <div class="forumax-activity-meta">
                                                <span class="forumax-activity-author">
                                                    <?php echo esc_html($author_name); ?>
                                                </span>
                                                <span class="forumax-activity-separator">•</span>
                                                <span class="forumax-activity-forum">
                                                    <?php echo esc_html($forum_title); ?>
                                                </span>
                                                <span class="forumax-activity-separator">•</span>
                                                <span class="forumax-activity-date">
                                                    <?php echo esc_html(human_time_diff(strtotime($unanswered_topic->post_date), current_time('timestamp'))); ?>
                                                    <?php esc_html_e('ago', 'forumax'); ?>
                                                </span>
                                            </div>
                                        </div>
                                    </li>
                                <?php endforeach; ?>
                            </ul>
                        <?php else: ?>
                            <div class="forumax-empty-state">
                                <span class="dashicons dashicons-yes"></span>
                                <p>
                                    <?php esc_html_e('Great job! No unanswered topics.', 'forumax'); ?>
                                </p>
                            </div>
                        <?php endif; ?>
                    </div>
                </section>

                <!-- Recent Replies -->
                <section class="forumax-card forumax-recent-replies">
                    <div class="forumax-card-header">
                        <h2><span class="dashicons dashicons-buddicons-replies"></span>
                            <?php esc_html_e('Recent Replies', 'forumax'); ?>
                        </h2>
                        <a href="<?php echo esc_url(admin_url('edit.php?post_type=reply')); ?>"
                            class="forumax-view-all">
                            <?php esc_html_e('View All', 'forumax'); ?>
                        </a>
                    </div>
                    <div class="forumax-card-body">
                        <?php if ($recent_replies->have_posts()): ?>
                            <ul class="forumax-activity-list">
                                <?php
                                while ($recent_replies->have_posts()):
                                    $recent_replies->the_post();
                                    $reply_id = get_the_ID();
                                    $author_id = get_the_author_meta('ID');
                                    $author_name = get_the_author();
                                    $reply_topic = bbp_get_reply_topic_id($reply_id);
                                    $topic_title = get_the_title($reply_topic);
                                    $reply_content = wp_trim_words(get_the_content(), 15, '...');
                                    ?>
                                    <li class="forumax-activity-item">
                                        <div class="forumax-activity-avatar">
                                            <?php echo get_avatar($author_id, 40); ?>
                                        </div>
                                        <div class="forumax-activity-content">
                                            <div class="forumax-activity-excerpt">
                                                <?php echo esc_html($reply_content); ?>
                                            </div>
                                            <div class="forumax-activity-meta">
                                                <span class="forumax-activity-author">
                                                    <?php echo esc_html($author_name); ?>
                                                </span>
                                                <span class="forumax-activity-separator">•</span>
                                                <span class="forumax-activity-topic">
                                                    <?php esc_html_e('on', 'forumax'); ?> <a
                                                        href="<?php echo esc_url(get_edit_post_link($reply_topic)); ?>">
                                                        <?php echo esc_html($topic_title); ?>
                                                    </a>
                                                </span>
                                                <span class="forumax-activity-separator">•</span>
                                                <span class="forumax-activity-date">
                                                    <?php echo esc_html(human_time_diff(get_the_time('U'), current_time('timestamp'))); ?>
                                                    <?php esc_html_e('ago', 'forumax'); ?>
                                                </span>
                                            </div>
                                        </div>
                                    </li>
                                <?php endwhile; ?>
                                <?php wp_reset_postdata(); ?>
                            </ul>
                        <?php else: ?>
                            <div class="forumax-empty-state">
                                <span class="dashicons dashicons-format-chat"></span>
                                <p>
                                    <?php esc_html_e('No replies yet.', 'forumax'); ?>
                                </p>
                            </div>
                        <?php endif; ?>
                    </div>
                </section>
            </div>

            <!-- Right Column / Sidebar -->
            <div class="forumax-dashboard-sidebar">
                <!-- Engagement Stats -->
                <section class="forumax-card forumax-engagement-stats">
                    <div class="forumax-card-header">
                        <h2><span class="dashicons dashicons-chart-bar"></span>
                            <?php esc_html_e('Engagement', 'forumax'); ?>
                        </h2>
                    </div>
                    <div class="forumax-card-body">
                        <div class="forumax-engagement-item">
                            <span class="forumax-engagement-label">
                                <?php esc_html_e('Avg. Replies per Topic', 'forumax'); ?>
                            </span>
                            <span class="forumax-engagement-value">
                                <?php echo esc_html($avg_replies_per_topic); ?>
                            </span>
                        </div>
                        <div class="forumax-engagement-item">
                            <span class="forumax-engagement-label">
                                <?php esc_html_e('Total Discussions', 'forumax'); ?>
                            </span>
                            <span class="forumax-engagement-value">
                                <?php echo esc_html(number_format_i18n($published_topics + $published_replies)); ?>
                            </span>
                        </div>
                    </div>
                </section>

                <!-- Pro Features / Upgrade -->
                <?php if (!forumax_is_premium()): ?>
                    <section class="forumax-card forumax-pro-upgrade">
                        <div class="forumax-card-header forumax-gradient-header">
                            <h2><span class="dashicons dashicons-star-filled"></span>
                                <?php esc_html_e('Upgrade to Pro', 'forumax'); ?>
                            </h2>
                        </div>
                        <div class="forumax-card-body">
                            <ul class="forumax-pro-features">
                                <li><span class="dashicons dashicons-yes-alt"></span>
                                    <?php esc_html_e('Private Replies (Pro)', 'forumax'); ?>
                                </li>
                                <li><span class="dashicons dashicons-yes-alt"></span>
                                    <?php esc_html_e('Topic Voting System', 'forumax'); ?>
                                </li>
                                <li><span class="dashicons dashicons-yes-alt"></span>
                                    <?php esc_html_e('Advanced Attachments', 'forumax'); ?>
                                </li>
                                <li><span class="dashicons dashicons-yes-alt"></span>
                                    <?php esc_html_e('Notifications', 'forumax'); ?>
                                </li>
                                <li><span class="dashicons dashicons-yes-alt"></span>
                                    <?php esc_html_e('Elementor Templates', 'forumax'); ?>
                                </li>
                            </ul>
                            <a href="<?php echo esc_url(bc_fs()->get_upgrade_url()); ?>"
                                class="forumax-btn forumax-btn-upgrade">
                                <?php esc_html_e('Upgrade Now', 'forumax'); ?>
                                <span class="dashicons dashicons-arrow-right-alt"></span>
                            </a>
                        </div>
                    </section>
                <?php endif; ?>

                <!-- System Info -->
                <section class="forumax-card forumax-system-info">
                    <div class="forumax-card-header">
                        <h2><span class="dashicons dashicons-info-outline"></span>
                            <?php esc_html_e('System Info', 'forumax'); ?>
                        </h2>
                    </div>
                    <div class="forumax-card-body">
                        <div class="forumax-info-item">
                            <span class="forumax-info-label">
                                <?php esc_html_e('Forumax Version', 'forumax'); ?>
                            </span>
                            <span class="forumax-info-value">
                                <?php echo esc_html(FORUMAX_VERSION); ?>
                            </span>
                        </div>
                        <div class="forumax-info-item">
                            <span class="forumax-info-label">
                                <?php esc_html_e('bbPress Version', 'forumax'); ?>
                            </span>
                            <span class="forumax-info-value">
                                <?php echo esc_html(bbp_get_version()); ?>
                            </span>
                        </div>
                        <div class="forumax-info-item">
                            <span class="forumax-info-label">
                                <?php esc_html_e('WordPress Version', 'forumax'); ?>
                            </span>
                            <span class="forumax-info-value">
                                <?php echo esc_html(get_bloginfo('version')); ?>
                            </span>
                        </div>
                        <div class="forumax-info-item">
                            <span class="forumax-info-label">
                                <?php esc_html_e('PHP Version', 'forumax'); ?>
                            </span>
                            <span class="forumax-info-value">
                                <?php echo esc_html(phpversion()); ?>
                            </span>
                        </div>
                        <div class="forumax-info-item">
                            <span class="forumax-info-label">
                                <?php esc_html_e('Plan', 'forumax'); ?>
                            </span>
                            <span
                                class="forumax-info-value forumax-plan-badge <?php echo forumax_is_premium() ? 'pro' : 'free'; ?>">
                                <?php echo forumax_is_premium() ? esc_html__('Pro', 'forumax') : esc_html__('Free', 'forumax'); ?>
                            </span>
                        </div>
                    </div>
                </section>

                <!-- Helpful Links -->
                <section class="forumax-card forumax-helpful-links">
                    <div class="forumax-card-header">
                        <h2><span class="dashicons dashicons-editor-help"></span>
                            <?php esc_html_e('Helpful Links', 'forumax'); ?>
                        </h2>
                    </div>
                    <div class="forumax-card-body">
                        <ul class="forumax-links-list">
                            <li>
                                <a href="https://helpdesk.spider-themes.net/docs/forumax-wordpress-plugin/"
                                    target="_blank" rel="noopener noreferrer">
                                    <span class="dashicons dashicons-book"></span>
                                    <?php esc_html_e('Documentation', 'forumax'); ?>
                                </a>
                            </li>
                            <li>
                                <a href="https://wordpress.org/support/plugin/bbp-core" target="_blank" rel="noopener noreferrer">
                                    <span class="dashicons dashicons-sos"></span>
                                    <?php esc_html_e('Support', 'forumax'); ?>
                                </a>
                            </li>
                            <li>
                                <a href="https://forumax.spider-themes.net/" target="_blank" rel="noopener noreferrer">
                                    <span class="dashicons dashicons-desktop"></span>
                                    <?php esc_html_e('Live Demo', 'forumax'); ?>
                                </a>
                            </li>
                            <li>
                                <a href="https://wordpress.org/support/plugin/bbp-core/reviews/#new-post" target="_blank"
                                    rel="noopener noreferrer">
                                    <span class="dashicons dashicons-star-filled"></span>
                                    <?php esc_html_e('Leave a Review', 'forumax'); ?>
                                </a>
                            </li>
                        </ul>
                    </div>
                </section>
            </div>
        </div>
    </div>
</div>