<?php
/**
 * Admin bootstrap: registers WP admin hooks and delegates to the main plugin class.
 *
 * This is the first refactor step to keep `chess-podium.php` smaller and to separate
 * admin wiring from front-end routing/rendering.
 *
 * @package Chess_Podium
 */
if (!defined('ABSPATH')) {
    exit;
}

final class ChessPodium_Admin
{
    public static function init(): void
    {
        // Menu + assets.
        add_action('admin_menu', [ChessPodiumPlugin::class, 'register_admin_menu']);
        add_action('admin_enqueue_scripts', [ChessPodiumPlugin::class, 'enqueue_admin_assets']);
        add_action('admin_head', [ChessPodiumPlugin::class, 'admin_menu_icon_style']);
        add_action('admin_enqueue_scripts', [ChessPodiumPlugin::class, 'enqueue_external_tournaments_scripts']);

        // Request handlers.
        add_action('admin_init', [ChessPodiumPlugin::class, 'handle_admin_actions']);
        add_action('admin_init', [ChessPodiumPlugin::class, 'maybe_redirect_to_onboarding']);
        add_action('admin_init', [ChessPodiumPlugin::class, 'handle_export_requests']);

        // UI integrations.
        add_action('customize_register', [ChessPodiumPlugin::class, 'register_customizer_settings']);
        add_action('media_buttons', [ChessPodiumPlugin::class, 'render_classic_shortcode_button'], 15);
        add_action('admin_footer', [ChessPodiumPlugin::class, 'render_classic_shortcode_modal']);

        // Notices.
        add_action('admin_notices', [ChessPodiumPlugin::class, 'maybe_show_demo_notice']);
        add_action('admin_notices', [ChessPodiumPlugin::class, 'maybe_show_dgt_upsell_notice']);
    }
}

