<?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
<div class="sbpai-app">
    <div class="sbpai-header">
        <div class="sbpai-logo">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" style="width:28px;height:28px;flex-shrink:0;vertical-align:middle;margin-right:0px;" aria-hidden="true"><rect x="11.25" y="2" width="1.5" height="4.5" fill="#8b5cf6" rx="0.75"/><circle cx="12" cy="2" r="1.5" fill="#8b5cf6"/><rect x="3" y="6" width="18" height="15" rx="5" fill="#7c3aed"/><rect x="5.5" y="8.5" width="13" height="6.5" rx="3.25" fill="#ffffff"/><circle cx="9.5" cy="11.75" r="1.25" fill="#130f26"/><circle cx="14.5" cy="11.75" r="1.25" fill="#130f26"/><path d="M 10.5 16.2 Q 10.5 17.5 11.8 17.5 Q 10.5 17.5 10.5 18.8 Q 10.5 17.5 9.2 17.5 Q 10.5 17.5 10.5 16.2 Z" fill="#ffffff"/><path d="M 14.5 17.5 Q 14.5 18.5 15.5 18.5 Q 14.5 18.5 14.5 19.5 Q 14.5 18.5 13.5 18.5 Q 14.5 18.5 14.5 17.5 Z" fill="#ffffff"/></svg> SandboxPress AI
        </div>
        <div class="sbpai-nav">
            <a href="?page=sbpai-dashboard" class="<?php echo ($view_name === 'dashboard') ? 'active' : ''; ?>">Dashboard</a>
            <a href="?page=sbpai-content" class="<?php echo ($view_name === 'content') ? 'active' : ''; ?>">Content</a>
            <a href="?page=sbpai-users" class="<?php echo ($view_name === 'users') ? 'active' : ''; ?>">Users</a>
            <a href="?page=sbpai-woocommerce" class="<?php echo ($view_name === 'woocommerce') ? 'active' : ''; ?>">WooCommerce</a>
            <a href="?page=sbpai-settings" class="<?php echo ($view_name === 'settings') ? 'active' : ''; ?>">Settings</a>
        </div>
    </div>

    <!-- Live Status Poller Global Bar -->
    <div class="sbpai-global-poller" id="sbpai-polling-area" style="display:none;">
        <div class="poller-text">⚡ <span id="sbpai-pending-count">0</span> Jobs processing in Action Scheduler</div>
        <div class="poller-bar"><div class="poller-progress"></div></div>
    </div>

    <div class="sbpai-view-container">
        <?php include SBPAI_PLUGIN_DIR . 'admin/views/' . $view_name . '.php'; ?>
    </div>
</div>
