<?php
// Add Global Colors section
$wp_customize->add_section('neatnote_theme_general_settings', array(
    'title' => __('Theme General Settings', 'neatnote'),
    'priority' => 11,
    'panel' => 'neatnote_theme_options_panel',
));

// Define color settings and controls
$globalcolors = [
    'primary' => '#072c50',
    'secondary' => '#d2d6dc',
    'body_text_color' => '#2d5c81',
    'accent_color' => '#174474',
    'accent_hover_color' => '#2d5c81',
    'theme_white_color' => '#ffffff',
];

foreach ($globalcolors as $neatnote_key => $_neatnote_default) {
    $wp_customize->add_setting("neatnote_{$neatnote_key}", array(
        'default' => $_neatnote_default,
        'transport' => 'refresh',
        'sanitize_callback' => 'sanitize_hex_color',
    ));

    $wp_customize->add_control(new WP_Customize_Color_Control(
        $wp_customize,
        "neatnote_{$neatnote_key}",
        array(
            'label' => sprintf(__('Global Color: %s', 'neatnote'), ucwords(str_replace('_', ' ', $neatnote_key))),
            'section' => 'neatnote_theme_general_settings',
            'settings' => "neatnote_{$neatnote_key}",
        )
    ));
}
