<?php

$default = prime_spa_center_get_default_theme_options();
/**
* Add Header Top Panel
*/
$wp_customize->add_panel( 'header_top_panel', array(
    'title'          => __( 'Header Top', 'prime-spa-center' ),
    'priority'       => 20,
    'capability'     => 'edit_theme_options',
) );
$wp_customize->add_setting('logo_width', array(
    'sanitize_callback' => 'absint', 
    'default' => '100', 
));
$wp_customize->add_setting('show_site_description', array(
    'default' => false, // Set default to true (show site description)
    'transport' => 'refresh',
    'sanitize_callback' => 'prime_spa_center_sanitize_checkbox',
));

$wp_customize->add_control('show_site_description_control', array(
    'label' => __('Show Site Description', 'prime-spa-center'),
    'section' => 'title_tagline',
    'settings' => 'show_site_description',
    'type' => 'checkbox',
));
// Add a control for logo width
$wp_customize->add_control('logo_width', array(
    'label' => __('Logo Width', 'prime-spa-center'),
    'section' => 'title_tagline',
    'type' => 'number',
    'input_attrs' => array(
        'min' => '50', 
        'max' => '500', 
        'step' => '5', 
    ),
    'default' => '100', 
));

$wp_customize->add_setting( 'prime_spa_center_site_title_size', array(
    'default'           => 30, 
    'sanitize_callback' => 'absint',
) );

// Add control for site title size
$wp_customize->add_control( 'prime_spa_center_site_title_size', array(
    'type'        => 'number',
    'section'     => 'title_tagline', 
    'label'       => __( 'Site Title Font Size (px)', 'prime-spa-center' ),
    'input_attrs' => array(
        'min'  => 10,
        'max'  => 100,
        'step' => 1,
    ),
) );
/** Header contact info section */
$wp_customize->add_section(
    'header_contact_info_section',
    array(
        'title'    => __( 'Contact Info', 'prime-spa-center' ),
        'panel'    => 'header_top_panel',
        'priority' => 10,
    )
);

$wp_customize->add_setting( 'theme_options[header_donate_btn_text]', array(
    'default'   => 'Appoinments',
    'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control(
    'theme_options[header_donate_btn_text]',
    array(
        'label'           => __( 'Button Text', 'prime-spa-center' ),
        'description'     => __( 'Enter Button Text.', 'prime-spa-center' ),
        'section'         => 'header_contact_info_section',
    )
);
$wp_customize->add_setting('prime_spa_center_button_icon',array(
    'default'   => 'fas fas fa-calendar-alt',
    'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control(new Prime_Spaenter_Changeable_Icon(
    $wp_customize,'prime_spa_center_button_icon',array(
    'label' => __('Button Icon','prime-spa-center'),
    'transport' => 'refresh',
    'section'   => 'header_contact_info_section',
    'type'      => 'icon'
)));

$wp_customize->add_setting( 'theme_options[header_donate_btn_url]', array(
    'sanitize_callback' => 'sanitize_text_field',
) );

$wp_customize->add_control(
    'theme_options[header_donate_btn_url]',
    array(
        'label'           => __( 'Button URL', 'prime-spa-center' ),
        'description'     => __( 'Enter Button URL.', 'prime-spa-center' ),
        'section'         => 'header_contact_info_section',
    )
);

$wp_customize->add_setting('prime_spa_center_menus_style',array(
    'default' => '',
    'sanitize_callback' => 'prime_spa_center_sanitize_choices',
));
$wp_customize->add_control('prime_spa_center_menus_style',array(
    'type' => 'select',
    'label' => __('Menu Hover Style','prime-spa-center'),
    'section' => 'header_contact_info_section',
    'choices' => array(
     'None' => __('None','prime-spa-center'),
     'Zoom In' => __('Zoom In','prime-spa-center'),
  ),
));

/** Header social links section */
$wp_customize->add_section(
    'header_social_links_section',
    array(
        'title'    => __( 'Social Links', 'prime-spa-center' ),
        'panel'    => 'header_top_panel',
        'priority' => 20,
    )
);

/** Header social links control */
$wp_customize->add_setting( 
    'theme_options[show_header_social_links]', 
    array(
        'default'           => $default['show_header_social_links'],
        'sanitize_callback' => 'prime_spa_center_sanitize_checkbox',
    ) 
);

$wp_customize->add_control(
    'theme_options[show_header_social_links]',
    array(
        'label'       => __( 'Show Social Links', 'prime-spa-center' ),
        'description'     => __( 'This Social Icon Show In Slider.', 'prime-spa-center' ),
        'section'     => 'header_social_links_section',
        'type'        => 'checkbox',
    )
);

// Setting social_links.
$wp_customize->add_setting( 
    'theme_options[social_link_1]', 
    array(
        'default'           => 'https://www.instagram.com',
        
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[social_link_1]',
    array(
        'label'           => __( 'Social Link 1', 'prime-spa-center' ),
        'description'     => __( 'Enter valid url.', 'prime-spa-center' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
        'active_callback' => 'prime_spa_center_social_links_active',
    )
);

$wp_customize->add_setting( 
    'theme_options[social_link_2]', 
    array(
        'default'           => 'https://www.twitter.com',
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[social_link_2]',
    array(
        'label'           => __( 'Social Link 2', 'prime-spa-center' ),
        'description'     => __( 'Enter valid url.', 'prime-spa-center' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
        'active_callback' => 'prime_spa_center_social_links_active',
    )
);

$wp_customize->add_setting( 
    'theme_options[social_link_3]', 
    array(
        'default'           => 'https://www.facebook.com',
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[social_link_3]',
    array(
        'label'           => __( 'Social Link 3', 'prime-spa-center' ),
        'description'     => __( 'Enter valid url.', 'prime-spa-center' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
        'active_callback' => 'prime_spa_center_social_links_active',
    )
);

$wp_customize->add_setting( 
    'theme_options[social_link_4]', 
    array(
        'default'           => 'https://www.linkedin.com',
        'sanitize_callback' => 'esc_url_raw',
    ) 
);

$wp_customize->add_control(
    'theme_options[social_link_4]',
    array(
        'label'           => __( 'Social Link 4', 'prime-spa-center' ),
        'description'     => __( 'Enter valid url.', 'prime-spa-center' ),
        'section'         => 'header_social_links_section',
        'type'            => 'url',
        'active_callback' => 'prime_spa_center_social_links_active',
    )
);