<?php 

function fire_fighter_add_admin_menu() {
    add_menu_page(
        'Theme Settings', // Page title
        'Theme Settings', // Menu title
        'manage_options', // Capability
        'fire-fighter-theme-settings', // Menu slug
        'fire_fighter_settings_page' // Function to display the page
    );
}
add_action( 'admin_menu', 'fire_fighter_add_admin_menu' );

function fire_fighter_settings_page() {
    ?>
    <div class="wrap">
        <h1><?php esc_html_e( 'Theme Settings', 'fire-fighter' ); ?></h1>
        <form action="options.php" method="post">
            <?php
            settings_fields( 'fire_fighter_settings_group' );
            do_settings_sections( 'fire-fighter-theme-settings' );
            submit_button();
            ?>
        </form>
    </div>
    <?php
}

function fire_fighter_register_settings() {
    register_setting( 'fire_fighter_settings_group', 'fire_fighter_enable_animations' );

    add_settings_section(
        'fire_fighter_settings_section',
        __( 'Animation Settings', 'fire-fighter' ),
        null,
        'fire-fighter-theme-settings'
    );

    add_settings_field(
        'fire_fighter_enable_animations',
        __( 'Enable Animations', 'fire-fighter' ),
        'fire_fighter_enable_animations_callback',
        'fire-fighter-theme-settings',
        'fire_fighter_settings_section'
    );
}
add_action( 'admin_init', 'fire_fighter_register_settings' );

function fire_fighter_enable_animations_callback() {
    $checked = get_option( 'fire_fighter_enable_animations', true );
    ?>
    <input type="checkbox" name="fire_fighter_enable_animations" value="1" <?php checked( 1, $checked ); ?> />
    <?php
}

