<?php 

Kirki::add_section( 'header_top_section', array(
	'title'    => esc_html__( 'Header Top', 'newshit' ),
	'panel'    => 'header_options',
) );

new \Kirki\Field\Color(
	[
		'settings'    => 'header_top_bg',
		'label'       => __( 'Header Top Background', 'newshit' ),
		'description' => esc_html__( 'Add Header Top Background Color', 'newshit' ),
		'section'     => 'header_top_section',
        'transport' => 'auto',
        'default'   => '#18181B',
        'output' => array(
            array(
                'element'  => '.header-top-wrapper',
                'property' => 'background-color',
            ),
        ),
	]
);

//----------------------------------//
//------- START MENU OPTIONS ------//
//--------------------------------//

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'header_top_menu',
	'label'       => esc_html__( 'Enable menu', 'newshit' ),
	'description' => esc_html__( 'Enable Header Top Section Menu', 'newshit' ),
	'section'     => 'header_top_section',
	'default'     => 'on',
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
] );


// Header Top Menu Color Options

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'top_header_note',
		'label'       => esc_html__( 'Header Top Menu Color Options', 'newshit' ),
		'description' => esc_html__( 'Add Top Menu Color and Background Color', 'newshit' ),
		'section'     => 'header_top_section',
		'transport'   => 'auto',
		'active_callback' => [
			[
				'setting'  => 'header_top_menu',
				'operator' => '==',
				'value'    => true,
			]
		],
	]
);

new \Kirki\Field\Radio_Buttonset(
	[
		'settings'    => 'header_top_color_select',
		'label'       => esc_html__( 'Header Top Color options', 'newshit' ),
		'section'     => 'header_top_section',
		'default'     => 'one',
		'transport'   => 'auto',
		'choices'     => [
			'one'   => esc_html__( 'Perent Menu', 'newshit' ),
			'two' => esc_html__( 'Sub Menu', 'newshit' ),
		],
		'active_callback' => [
			[
				'setting'  => 'header_top_menu',
				'operator' => '==',
				'value'    => true,
			]
		],
	]
);


Kirki::add_field( 'theme_config', array(
	'type'        => 'color',
	'settings'    => 'header_menu_color',
	'label'       => __( 'Menu Color', 'newshit' ),
	'description' => esc_html__( 'Add perent menu Color Here', 'newshit' ),
	'section'     => 'header_top_section',
	'transport'   => 'auto',
	'active_callback' => [
		[
			'setting'  => 'header_top_menu',
			'operator' => '==',
			'value'    => true,
		],
		[
			'setting'  => 'header_top_color_select',
			'operator' => '==',
			'value'    => 'one',
		]
	],
	'output' => array(
		array(
			'element'  => '.header-top-wrapper .header-top-inner .header-top-menu > ul > li >a',
			'property' => 'color',
		),
	),
) );
Kirki::add_field( 'theme_config', array(
	'type'        => 'color',
	'settings'    => 'header_menu_hover',
	'label'       => __( 'Menu hover Color', 'newshit' ),
	'description' => esc_html__( 'Add perent menu hover Color Here', 'newshit' ),
	'section'     => 'header_top_section',
	'transport'   => 'auto',
	'active_callback' => [
		[
			'setting'  => 'header_top_menu',
			'operator' => '==',
			'value'    => true,
		],
		[
			'setting'  => 'header_top_color_select',
			'operator' => '==',
			'value'    => 'one',
		]
	],
	'output' => array(
		array(
			'element'  => '.header-top-wrapper .header-top-inner .header-top-menu > ul > li >a:hover',
			'property' => 'color',
		),
	),
) );

Kirki::add_field( 'theme_config', array(
	'type'        => 'color',
	'settings'    => 'header_menu_hbg',
	'label'       => __( 'hover BG Color', 'newshit' ),
	'description' => esc_html__( 'Add perent menu hover Backgrond Color Here', 'newshit' ),
	'section'     => 'header_top_section',
	'transport'   => 'auto',
	'default' 		=> '#ffffff',
	'active_callback' => [
		[
			'setting'  => 'header_top_menu',
			'operator' => '==',
			'value'    => true,
		],
		[
			'setting'  => 'header_top_color_select',
			'operator' => '==',
			'value'    => 'one',
		]
	],
	'output' => array(
		array(
			'element'  => '.header-top-wrapper .header-top-inner .header-top-menu > ul > li >a:hover',
			'property' => 'background-color',
		),
	),
) );

// header Top Sub Menu Color Options

Kirki::add_field( 'theme_config', array(
	'type'        => 'color',
	'settings'    => 'header_sub_menu_color',
	'label'       => __( 'Sub Menu Color', 'newshit' ),
	'description' => esc_html__( 'Add Sub menu Color Here', 'newshit' ),
	'section'     => 'header_top_section',
	'transport'   => 'auto',
	'active_callback' => [
		[
			'setting'  => 'header_top_menu',
			'operator' => '==',
			'value'    => true,
		],
		[
			'setting'  => 'header_top_color_select',
			'operator' => '==',
			'value'    => 'two',
		]
	],
	'output' => array(
		array(
			'element'  => '.header-top-wrapper .header-top-inner .header-top-menu ul ul li a',
			'property' => 'color',
		),
	),
) );

Kirki::add_field( 'theme_config', array(
	'type'        => 'color',
	'settings'    => 'header_sub_menu_bg',
	'label'       => __( 'Sub Menu BG Color', 'newshit' ),
	'description' => esc_html__( 'Add Sub menu Backgrond Color Here', 'newshit' ),
	'section'     => 'header_top_section',
	'transport'   => 'auto',
	'default' 		=> '#2816F8',
	'active_callback' => [
		[
			'setting'  => 'header_top_menu',
			'operator' => '==',
			'value'    => true,
		],
		[
			'setting'  => 'header_top_color_select',
			'operator' => '==',
			'value'    => 'two',
		]
	],
	'output' => array(
		array(
			'element'  => '.header-top-wrapper .header-top-inner .header-top-menu ul ul li a',
			'property' => 'background-color',
		),
	),
) );


Kirki::add_field( 'theme_config', array(
	'type'        => 'color',
	'settings'    => 'header_sub_menu_hcolor',
	'label'       => __( 'Sub Menu Color', 'newshit' ),
	'description' => esc_html__( 'Add Sub menu Color Here', 'newshit' ),
	'section'     => 'header_top_section',
	'transport'   => 'auto',
	'active_callback' => [
		[
			'setting'  => 'header_top_menu',
			'operator' => '==',
			'value'    => true,
		],
		[
			'setting'  => 'header_top_color_select',
			'operator' => '==',
			'value'    => 'two',
		]
	],
	'output' => array(
		array(
			'element'  => '.header-top-wrapper .header-top-inner .header-top-menu ul ul li a:hover',
			'property' => 'color',
		),
	),
) );

Kirki::add_field( 'theme_config', array(
	'type'        => 'color',
	'settings'    => 'header_sub_menu_hbg',
	'label'       => __( 'Sub Menu BG Color', 'newshit' ),
	'description' => esc_html__( 'Add Sub menu Backgrond Color Here', 'newshit' ),
	'section'     => 'header_top_section',
	'transport'   => 'auto',
	'default' 		=> '#ffffff',
	'active_callback' => [
		[
			'setting'  => 'header_top_menu',
			'operator' => '==',
			'value'    => true,
		],
		[
			'setting'  => 'header_top_color_select',
			'operator' => '==',
			'value'    => 'two',
		]
	],
	'output' => array(
		array(
			'element'  => '.header-top-wrapper .header-top-inner .header-top-menu ul ul li a:hover',
			'property' => 'background-color',
		),
	),
) );


//----------------------------------//
//------ START SOCIAL OPTIONS -----//
//--------------------------------//

Kirki::add_field( 'theme_config', [
	'type'        => 'switch',
	'settings'    => 'header_top_social',
	'label'       => esc_html__( 'Enable Social Icon', 'newshit' ),
	'description' => esc_html__( 'Enable Header Top Social Icons', 'newshit' ),
	'section'     => 'header_top_section',
	'default'     => 'on',
	'choices'     => [
		'on'  => esc_html__( 'Enable', 'newshit' ),
		'off' => esc_html__( 'Disable', 'newshit' ),
	],
	'partial_refresh'    => [
		'header_top_social_refresh' => [
			'selector'        => '.header-top-social ul',
			'render_callback' => 'newshit_customizer_quickedit',
		],
	],
] );

Kirki::add_field( 'theme_config', [
	'type'            => 'Repeater',
	'settings'        => 'header_social_icons',
	'label'           => esc_html__( 'Socials Icon', 'newshit' ),
	'section'         => 'header_top_section',
	'row_label'       => [
		'type'  => 'field',
		'field' => 'name',
	],
	
	'button_label'    => esc_html__( '"Add Social Icon', 'newshit' ),
	'choices' => [
		'limit' => 4,
	],
	'default'         => [
		[
			'name'     => esc_html__( 'Facebook', 'newshit' ),
			'icon'     => 'fab fa-facebook-f',
			'link'     => '#',
			'target'   => '_self',
			'color'    => '#175BEB',
		],
		[
			'name'     => esc_html__( 'Twitter', 'newshit' ),
			'icon'     => 'fab fa-twitter',
			'link'     => '#',
			'target'   => '_self',
			'color'    => '#1DA1F2',
		],
		[
			'name'     => esc_html__( 'Linkedin', 'newshit' ),
			'icon'     => 'fab fa-linkedin-in',
			'link'     => '#',
			'target'   => '_self',
			'color'    => '#0072B1',
		],
		[
			'name'     => esc_html__( 'Instagram', 'newshit' ),
			'icon'     => 'fab fa-instagram',
			'link'     => '#',
			'target'   => '_self',
			'color'    => '#d62976',
		]
	],
	'fields'          => [
		'name'     => [
			'type'        => 'text',
			'label'       => esc_html__( 'Social Name', 'newshit' ),
			'description' => esc_html__( 'Add Social Media Name', 'newshit' ),
			'default'     => esc_html__( 'Facebook', 'newshit' ),
		],

		'icon'     => [
			'type'        => 'select',
			'label'       => esc_html__( 'Social Icon', 'newshit' ),
			'description' => esc_html__( 'Add Social Icon Here', 'newshit' ),
			'default'     => 'fab fa-facebook-f',
			'choices'     => [
				'fab fa-facebook-f'     => esc_attr__( 'Facebook', 'newshit' ),
				'fab fa-twitter'        => esc_attr__( 'Twitter', 'newshit' ),
				'fab fa-linkedin-in'    => esc_attr__( 'Linkedin', 'newshit' ),
				'fab fa-instagram'      => esc_attr__( 'Instagram', 'newshit' ),
				'fab fa-pinterest'      => esc_attr__( 'Pinterest', 'newshit' ),
				'fab fa-dribbble'       => esc_attr__( 'Dribbble', 'newshit' ),
				'fab fa-behance'        => esc_attr__( 'Behance', 'newshit' ),
				'fab fa-tiktok'         => esc_attr__( 'Tiktok', 'newshit' ),
				'fab fa-snapchat-ghost' => esc_attr__( 'Snapchat', 'newshit' ),
				'fab fa-youtube'        => esc_attr__( 'Youtube', 'newshit' ),
				'fab fa-weixin'         => esc_attr__( 'Weixin', 'newshit' ),
				'fab fa-telegram'       => esc_attr__( 'Telegram', 'newshit' ),
				'fab fa-reddit'         => esc_attr__( 'Reddit', 'newshit' ),
				'fab fa-quora'          => esc_attr__( 'Quora', 'newshit' ),
				'fab fa-discord'        => esc_attr__( 'Discord', 'newshit' ),
				'fab fa-whatsapp'       => esc_attr__( 'Whatsapp', 'newshit' ),
			],
		],
		'link'     => [
			'type'        => 'text',
			'label'       => esc_html__( 'Link URL', 'newshit' ),
			'description' => esc_html__( 'Add Social Link Here', 'newshit' ),
			'default'     => '#',
		],
		'target'   => [
			'type'        => 'select',
			'label'       => esc_html__( 'Link Target', 'newshit' ),
			'description' => esc_html__( 'Select Target Option', 'newshit' ),
			'default'     => '_self',
			'choices'     => [
				'_blank' => esc_html__( 'New Window', 'newshit' ),
				'_self'  => esc_html__( 'Same Frame', 'newshit' ),
			],
		],
		'color'    => [
			'type'        => 'color',
			'label'       => esc_html__( 'Icon Color', 'newshit' ),
			'description' => esc_html__( 'Add Social Icon Color', 'newshit' ),
			'alpha'       => true,
			'transport'   => 'auto',
		]
	],
	'active_callback' => [
		[
			'setting'  => 'header_top_social',
			'operator' => '===',
			'value'    => true,
		],
	],
	
] );

new \Kirki\Field\Radio_Image(
	[
		'settings'    => 'unlimited_social_pro',
		'label'       => esc_html__( 'Purchase The pro Version to Add More Social Icon', 'newshit' ),
		'description' => newshit_purchase_link(),
		'section'     => 'header_top_section',
		'default'     => '',
		'transport'   => 'auto',
		'active_callback' => [
			[
				'setting'  => 'header_top_social',
				'operator' => '===',
				'value'    => true,
			],
		],
	]
);