<?php
if (! defined('ABSPATH')) {
    exit; // Exit if accessed directly.
}
add_action('after_setup_theme', 'initialize_kirki_settings', 20);

function initialize_kirki_settings()
{
    if (! class_exists('Kirki')) {
        return;
    }

    // Add your Kirki panels and sections here

    new \Kirki\Panel(
        'curamedix_panel',
        [
            'priority'    => 10,
            'title'       => esc_html__('CuraMedix Panel', 'curamedix'),
            'description' => esc_html__('CuraMedix theme customization panel', 'curamedix'),
        ]
    );
    new \Kirki\Section(
        'curamedix_header',
        [
            'title'       => esc_html__('Header section', 'curamedix'),
            'description' => esc_html__('You can customize theme header here.', 'curamedix'),
            'panel'       => 'curamedix_panel',
            'priority'    => 160,
        ]
    );
    // site notice settings start here
    new \Kirki\Field\Checkbox_Switch(
        [
            'settings'    => 'curamedix_notice_switch',
            'label'       => esc_html__('Show Notice', 'curamedix'),
            'description' => esc_html__('Show/Hide site notice', 'curamedix'),
            'section'     => 'curamedix_header',
            'default'     => 'on',
            'choices'     => [
                'on'  => esc_html__('Show', 'curamedix'),
                'off' => esc_html__('Hide', 'curamedix'),
            ],
        ]
    );
    new \Kirki\Field\Color(
        [
            'settings'    => 'curamedix_notice_bg_color',
            'label'       => __('Notice Background Color', 'curamedix'),
            'description' => esc_html__('Select the background color for the notice.', 'curamedix'),
            'section'     => 'curamedix_header',
            'default'     => '#0d6efd',
        ]
    );
    new \Kirki\Field\Text(
        [
            'settings' => 'curamedix_badge_text',
            'label'    => esc_html__('Badge text', 'curamedix'),
            'section'  => 'curamedix_header',
            'default'  => esc_html__('Trusted', 'curamedix'),
            'priority' => 10,
        ]
    );
    new \Kirki\Field\Text(
        [
            'settings' => 'curamedix_notice_text',
            'label'    => esc_html__('Notice text', 'curamedix'),
            'section'  => 'curamedix_header',
            'default'  => esc_html__('Book appointments online — quick, easy, and secure.', 'curamedix'),
            'priority' => 10,
        ]
    );
    // site notice settings end here

     new \Kirki\Field\Color(
        [
            'settings'    => 'curamedix_navbar_bg_color',
            'label'       => __('Navbar Background Color', 'curamedix'),
            'description' => esc_html__('Select the background color for the navbar.', 'curamedix'),
            'section'     => 'curamedix_header',
            'default'     => '#FFFFFF',
        ]
    );
    new \Kirki\Field\Checkbox_Switch(
        [
            'settings'    => 'curamedix_button_switch',
            'label'       => esc_html__('Show Button', 'curamedix'),
            'description' => esc_html__('Show/Hide right side button', 'curamedix'),
            'section'     => 'curamedix_header',
            'default'     => 'off',
            'choices'     => [
                'on'  => esc_html__('Show', 'curamedix'),
                'off' => esc_html__('Hide', 'curamedix'),
            ],
        ]
    );

    new \Kirki\Field\Text(
        [
            'settings' => 'curamedix_button_text',
            'label'    => esc_html__('Button text', 'curamedix'),
            'section'  => 'curamedix_header',
            'default'  => esc_html__('CONTACT NOW', 'curamedix'),
            'priority' => 10,
        ]
    );
    new \Kirki\Field\URL(
        [
            'settings' => 'curamedix_button_url',
            'label'    => esc_html__('Button URL', 'curamedix'),
            'section'  => 'curamedix_header',
            'priority' => 10,
        ]
    );

    // Footer settings start here
    new \Kirki\Section(
        'curamedix_footer',
        [
            'title'       => esc_html__('Footer section', 'curamedix'),
            'description' => esc_html__('You can customize theme footer here.', 'curamedix'),
            'panel'       => 'curamedix_panel',
            'priority'    => 160,
        ]
    );
    // site copyright settings start here
    new \Kirki\Field\Checkbox_Switch(
        [
            'settings'    => 'curamedix_copyright_switch',
            'label'       => esc_html__('Show Copyright', 'curamedix'),
            'description' => esc_html__('Show/Hide copyright notice', 'curamedix'),
            'section'     => 'curamedix_footer',
            'default'     => 'on',
            'choices'     => [
                'on'  => esc_html__('Show', 'curamedix'),
                'off' => esc_html__('Hide', 'curamedix'),
            ],
        ]
    );
    new \Kirki\Field\Color(
        [
            'settings'    => 'curamedix_copyright_bg_color',
            'label'       => __('Copyright Background Color', 'curamedix'),
            'description' => esc_html__('Select the background color for the copyright.', 'curamedix'),
            'section'     => 'curamedix_footer',
            'default'     => '#0d6efd',
        ]
    );
    new \Kirki\Field\Text(
        [
            'settings' => 'curamedix_copyright_text',
            'label'    => esc_html__('Copyright text', 'curamedix'),
            'section'  => 'curamedix_footer',
            'default'  => esc_html__('© 2026 CuraMedix. All rights reserved.', 'curamedix'),
            'priority' => 10,
        ]
    );
    // site copyright settings end here

    new \Kirki\Field\Color(
        [
            'settings'    => 'curamedix_footer_bg_color',
            'label'       => __('Footer Background Color', 'curamedix'),
            'description' => esc_html__('Select the background color for the footer.', 'curamedix'),
            'section'     => 'curamedix_footer',
            'default'     => '#141a33',
        ]
    );

}
