<?php
/**
 * Header Section Settings
 *
 * @package wedding_event_management
 */

// ---------------------------------------- HEADER OPTIONS ----------------------------------------------------

$wp_customize->add_section(
	'wedding_event_management_header_options',
	array(
		'panel' => 'wedding_event_management_front_page_options',
		'title' => esc_html__( 'Header Options', 'wedding-event-management' ),
        'priority' => 1,
	)
);

// Add setting for sticky header
$wp_customize->add_setting(
	'wedding_event_management_enable_sticky_header',
	array(
		'sanitize_callback' => 'wedding_event_management_sanitize_switch',
		'default'           => false,
	)
);

// Add control for sticky header setting
$wp_customize->add_control(
	new Wedding_Event_Management_Toggle_Switch_Custom_Control(
		$wp_customize,
		'wedding_event_management_enable_sticky_header',
		array(
			'label'   => esc_html__( 'Enable Sticky Header', 'wedding-event-management' ),
			'section' => 'wedding_event_management_header_options',
		)
	)
);

// Header Options - Enable Search Icon.
$wp_customize->add_setting(
	'wedding_event_management_enable_search_icon',
	array(
		'sanitize_callback' => 'wedding_event_management_sanitize_switch',
		'default'           => true,
	)
);

$wp_customize->add_control(
	new Wedding_Event_Management_Toggle_Switch_Custom_Control(
		$wp_customize,
		'wedding_event_management_enable_search_icon',
		array(
			'label'   => esc_html__( 'Enable Search Icon', 'wedding-event-management' ),
			'section' => 'wedding_event_management_header_options',
		)
	)
);

// Add Separator Custom Control
$wp_customize->add_setting( 'wedding_event_management_menu_separator', array(
	'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control( new Wedding_Event_Management_Separator_Custom_Control( $wp_customize, 'wedding_event_management_menu_separator', array(
	'label' => __( 'Menu Settings', 'wedding-event-management' ),
	'section' => 'wedding_event_management_header_options',
	'settings' => 'wedding_event_management_menu_separator',
)));

$wp_customize->add_setting( 'wedding_event_management_menu_font_size', array(
    'default'           => 16,
    'sanitize_callback' => 'absint',
) );

// Add control for site title size
$wp_customize->add_control( 'wedding_event_management_menu_font_size', array(
    'type'        => 'number',
    'section'     => 'wedding_event_management_header_options',
    'label'       => __( 'Menu Font Size ', 'wedding-event-management' ),
    'input_attrs' => array(
        'min'  => 10,
        'max'  => 100,
        'step' => 1,
    ),
));


// Add setting for menu font weight
$wp_customize->add_setting('wedding_event_management_menu_font_weight', array(
    'default'           => '400',
    'sanitize_callback' => 'sanitize_text_field',
));

// Add control for menu font weight
$wp_customize->add_control('wedding_event_management_menu_font_weight', array(
    'type'     => 'select',
    'section'  => 'wedding_event_management_header_options', 
    'label'    => __('Menu Font Weight', 'wedding-event-management'),
    'choices'  => array(
		'100' => __('100','wedding-event-management'),
		'200' => __('200','wedding-event-management'),
		'300' => __('300','wedding-event-management'),
		'400' => __('400','wedding-event-management'),
		'500' => __('500','wedding-event-management'),
		'600' => __('600','wedding-event-management'),
		'700' => __('700','wedding-event-management'),
		'800' => __('800','wedding-event-management'),
		'900' => __('900','wedding-event-management'),
    ),
));

$wp_customize->add_setting( 'wedding_event_management_menu_text_transform', array(
    'default'           => 'none', // Default value for text transform
    'sanitize_callback' => 'sanitize_text_field',
) );

// Add control for menu text transform
$wp_customize->add_control( 'wedding_event_management_menu_text_transform', array(
    'type'     => 'select',
    'section'  => 'wedding_event_management_header_options', // Adjust the section as needed
    'label'    => __( 'Menu Text Transform', 'wedding-event-management' ),
    'choices'  => array(
        'none'       => __( 'None', 'wedding-event-management' ),
        'capitalize' => __( 'Capitalize', 'wedding-event-management' ),
        'uppercase'  => __( 'Uppercase', 'wedding-event-management' ),
        'lowercase'  => __( 'Lowercase', 'wedding-event-management' ),
    ),
) );

// Menu Text Color 
$wp_customize->add_setting(
	'wedding_event_management_menu_text_color', 
	array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'wedding_event_management_menu_text_color', 
		array(
			'label' => __('Menu Color', 'wedding-event-management'),
			'section' => 'wedding_event_management_header_options',
		)
	)
);

// Sub Menu Text Color 
$wp_customize->add_setting(
	'wedding_event_management_sub_menu_text_color', 
	array(
		'default' => '',
		'sanitize_callback' => 'sanitize_hex_color',
	)
);

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'wedding_event_management_sub_menu_text_color', 
		array(
			'label' => __('Sub Menu Color', 'wedding-event-management'),
			'section' => 'wedding_event_management_header_options',
		)
	)
);

$wp_customize->add_setting( 
	'wedding_event_management_header_settings_upgraded_features',
	array(
		'sanitize_callback' => 'sanitize_text_field'
	)
);

$wp_customize->add_control(
	'wedding_event_management_header_settings_upgraded_features', 
	array(
		'type'=> 'hidden',
		'description' => "
			<div class='customizer-upgraded-features'>
				<i class='fas fa-info-circle'></i>
				<span class='pro-text'>
					Unlock Premium <strong>Features</strong> ?<br>
					<a target='_blank' href='". esc_url(WEDDING_EVENT_MANAGEMENT_PREMIUM_PAGE) ." '>Upgrade Pro</a>
				</div>
			</div>
		",
		'section' => 'wedding_event_management_header_options'
	)
);