<?php
pxl_add_custom_widget(
    array(
        'name' => 'pxl_search_form',
        'title' => esc_html__('Case Search Form', 'solarva' ),
        'icon' => 'eicon-site-search',
        'categories' => array('pxltheme-core'),
        'params' => array(
            'sections' => array(
                array(
                    'name' => 'section_content',
                    'label' => esc_html__('Content', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
                    'controls' => array(
                        array(
                            'name' => 'justify_content',
                            'label' => esc_html__('Justify Content', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::CHOOSE,
                            'default' => '',
                            'options' => [
                                'start' =>  [
                                    'title' => esc_html__('Start', 'solarva'),
                                    'icon' => 'eicon-justify-start-h',
                                ],
                                'center' =>  [
                                    'title' => esc_html__('Center', 'solarva'),
                                    'icon' => 'eicon-justify-center-h',
                                ],
                                'end' =>  [
                                    'title' => esc_html__('End', 'solarva'),
                                    'icon' => 'eicon-justify-end-h',
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form.pxl-search-form1 .pxl-form-container' => 'justify-content: {{VALUE}}'
                            ],
                        ),
                        array(
                            'name' => 'max_width',
                            'label' => esc_html__('Max Width', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'size_units' => [ 'px', '%' ],
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .pxl-form-inner' => 'max-width: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'spacing_bottom',
                            'label' => esc_html__('Max Width', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'size_units' => [ 'px', '%' ],
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                    ),
                ),
                array(
                    'name' => 'tab_style_input',
                    'label' => esc_html__('Input', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(
                        array (
                            'name' => 'input_color', 
                            'label' => esc_html__('Color', 'solarva'),
                            'type' => \Elementor\Controls_Manager::COLOR, 
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap input' => 'color: {{VALUE}};'
                            ] 
                        ),
                        array (
                            'name' => 'input_color_focus', 
                            'label' => esc_html__('Color Focus', 'solarva'),
                            'type' => \Elementor\Controls_Manager::COLOR, 
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap input:focus' => 'color: {{VALUE}};'
                            ] 
                        ),
                        array (
                            'name' => 'input_bg_color', 
                            'label' => esc_html__('Background Color', 'solarva'),
                            'type' => \Elementor\Controls_Manager::COLOR, 
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap input' => 'background-color: {{VALUE}};'
                            ] 
                        ),
                        array(
                            'name' => 'input_typography',
                            'label' => esc_html__('Typography', 'solarva' ),
                            'type' => \Elementor\Group_Control_Typography::get_type(),
                            'control_type' => 'group',
                            'selector' => '{{WRAPPER}} .pxl-search-form .searchform-wrap input',
                        ),
                        array(
                            'name' => 'input_border',
                            'label' => esc_html__('Border', 'solarva'),
                            'type' => \Elementor\Group_Control_Border::get_type(),
                            'control_type' => 'group',
                            'selector' => '{{WRAPPER}} .pxl-search-form .searchform-wrap input',
                        ),
                        array(
                            'name' => 'input_padding',
                            'label' => esc_html__( 'Padding', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::DIMENSIONS,
                            'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
                            'control_type' => 'responsive',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap input' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'input_border_radius',
                            'label' => esc_html__( 'Border Radius', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::DIMENSIONS,
                            'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
                            'control_type' => 'responsive',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                            ],
                        ),
                    ),
                ),

                array(
                    'name' => 'tab_style_button',
                    'label' => esc_html__('Button', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(
                        array (
                            'name' => 'button_color', 
                            'label' => esc_html__('Color', 'solarva'),
                            'type' => \Elementor\Controls_Manager::COLOR, 
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap button' => 'color: {{VALUE}};',
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap button path' => 'fill: {{VALUE}}',
                            ] 
                        ),
                        array (
                            'name' => 'button_color_hover', 
                            'label' => esc_html__('Color Hover', 'solarva'),
                            'type' => \Elementor\Controls_Manager::COLOR, 
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap button:focus' => 'color: {{VALUE}};',
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap button path' => 'fill: {{VALUE}}'
                            ] 
                        ),
                        array (
                            'name' => 'button_bg_color', 
                            'label' => esc_html__('Background Color', 'solarva'),
                            'type' => \Elementor\Controls_Manager::COLOR, 
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap button' => '--bg-color: {{VALUE}};'
                            ] 
                        ),
                        array (
                            'name' => 'button_bg_color_hover', 
                            'label' => esc_html__('Background Color Hover', 'solarva'),
                            'type' => \Elementor\Controls_Manager::COLOR, 
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap button' => '--hover-bg-color: {{VALUE}};'
                            ] 
                        ),
                        array(
                            'name' => 'button_typography',
                            'label' => esc_html__('Typography', 'solarva' ),
                            'type' => \Elementor\Group_Control_Typography::get_type(),
                            'control_type' => 'group',
                            'selector' => '{{WRAPPER}} .pxl-search-form .searchform-wrap button',
                        ),
                        array(
                            'name' => 'button_border',
                            'label' => esc_html__('Border', 'solarva'),
                            'type' => \Elementor\Group_Control_Border::get_type(),
                            'control_type' => 'group',
                            'selector' => '{{WRAPPER}} .pxl-search-form .searchform-wrap button',
                        ),
                        array(
                            'name' => 'button_padding',
                            'label' => esc_html__( 'Padding', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::DIMENSIONS,
                            'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
                            'control_type' => 'responsive',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'button_border_radius',
                            'label' => esc_html__( 'Border Radius', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::DIMENSIONS,
                            'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
                            'control_type' => 'responsive',
                            'selectors' => [
                                '{{WRAPPER}} .pxl-search-form .searchform-wrap button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                            ],
                        ),
                    ),
                ),
                solarva_widget_animation_settings(),
            ),
        ),
    ),
    solarva_get_class_widget_path()
);