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


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

$wp_customize->add_section(
	'aster_portfolio_header_options',
	array(
		'panel' => 'aster_portfolio_front_page_options',
		'title' => esc_html__( 'Header Options', 'aster-portfolio' ),
        'priority' => 1,
	)
);


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

// Add control for sticky header setting
$wp_customize->add_control(
	new Aster_Portfolio_Toggle_Switch_Custom_Control(
		$wp_customize,
		'aster_portfolio_enable_sticky_header',
		array(
			'label'   => esc_html__( 'Enable Sticky Header', 'aster-portfolio' ),
			'section' => 'aster_portfolio_header_options',
		)
	)
);

// Header Section - Button Label.
$wp_customize->add_setting(
	'aster_portfolio_topheader_button_text',
	array(
		'default'           => '',
		'sanitize_callback' => 'sanitize_text_field',
	)
);

$wp_customize->add_control(
	'aster_portfolio_topheader_button_text',
	array(
		'label'           => esc_html__( 'Button Label', 'aster-portfolio'  ),
		'section'         => 'aster_portfolio_header_options',
		'settings'        => 'aster_portfolio_topheader_button_text',
		'type'            => 'text',
	)
);

// Header Section - Button Link.
$wp_customize->add_setting(
	'aster_portfolio_topheader_button_url',
	array(
		'default'           => '',
		'sanitize_callback' => 'esc_url_raw',
	)
);

$wp_customize->add_control(
	'aster_portfolio_topheader_button_url',
	array(
		'label'           => esc_html__( 'Button Link', 'aster-portfolio' ),
		'section'         => 'aster_portfolio_header_options',
		'settings'        => 'aster_portfolio_topheader_button_url',
		'type'            => 'url',
	)
);

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

$wp_customize->add_control( new Aster_Portfolio_Separator_Custom_Control( $wp_customize, 'aster_portfolio_menu_separator', array(
	'label' => __( 'Menu Settings', 'aster-portfolio' ),
	'section' => 'aster_portfolio_header_options',
	'settings' => 'aster_portfolio_menu_separator',
)));

$wp_customize->add_setting( 'aster_portfolio_menu_font_size', array(
    'default'           => 15,
    'sanitize_callback' => 'absint',
));

// Add control for site title size
$wp_customize->add_control( 'aster_portfolio_menu_font_size', array(
    'type'        => 'number',
    'section'     => 'aster_portfolio_header_options',
    'label'       => __( 'Menu Font Size ', 'aster-portfolio' ),
    'input_attrs' => array(
        'min'  => 10,
        'max'  => 100,
        'step' => 1,
    ),
));

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

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

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

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

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'aster_portfolio_menu_text_color', 
		array(
			'label' => __('Menu Color', 'aster-portfolio'),
			'section' => 'aster_portfolio_header_options',
		)
	)
);

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

$wp_customize->add_control(
	new WP_Customize_Color_Control(
		$wp_customize, 
		'aster_portfolio_sub_menu_text_color', 
		array(
			'label' => __('Sub Menu Color', 'aster-portfolio'),
			'section' => 'aster_portfolio_header_options',
		)
	)
);

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

$wp_customize->add_control(
	'aster_portfolio_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(ASTER_PORTFOLIO_PREMIUM_PAGE) ." '>Upgrade Pro</a>
				</div>
			</div>
		",
		'section' => 'aster_portfolio_header_options'
	)
);