<?php
/**
 * Playbooks admin page wrapper.
 *
 * @package LolaCore
 * @license GPL-2.0-or-later
 */

declare(strict_types=1);

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

use LolaCore\Admin\Settings;

?>
<div class="wrap lolacore-admin-wrap" id="lolacore-playbooks">
    <h1><?php echo esc_html__('Playbooks', 'lolacore'); ?></h1>
    <p class="description"><?php echo esc_html__('Curated domain manuals Lola consults when working in a specific area. Playbooks hold knowledge — not memory facts or behavioral skills.', 'lolacore'); ?></p>
    <?php
    Settings::echoPlaybooksDocParagraph(
        /* translators: %s: linked "playbooks guide" label */
        __('Read the %s for frontmatter fields, upload vs chat, and common save errors.', 'lolacore')
    );
    ?>
    <div id="lolacore-settings-messages"></div>
    <div id="lolacore-playbook-distill-overlay" class="lc-playbook-distill-overlay" style="display:none;" aria-live="polite">
        <div class="lc-playbook-distill-overlay-inner">
            <span class="spinner is-active" style="float:none;margin:0 8px 0 0;"></span>
            <span id="lolacore-playbook-distill-status"><?php echo esc_html__('Distilling document…', 'lolacore'); ?></span>
        </div>
    </div>
    <div class="lolacore-tab-content">
        <?php
        $lolacore_settings = new Settings();
        $lolacore_settings->renderPlaybooksSection();
        ?>
    </div>
    <?php require __DIR__ . '/partials/confirm-modal.php'; ?>
    <?php require __DIR__ . '/partials/ack-modal.php'; ?>
</div>
