<?php
// Register Logo Widget
pxl_add_custom_widget(
    array(
        'name' => 'pxl_social_icons',
        'title' => esc_html__('Case Social Icons', 'solarva' ),
        'icon' => 'eicon-social-icons',
        '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' => 'items',
                            'label' => esc_html__('Social Icons', 'solarva'),
                            'type' => \Elementor\Controls_Manager::REPEATER,
                            'controls' => array(
                                array(
                                    'name' => 'link',
                                    'label' => esc_html__('Link', 'solarva' ),
                                    'url' => '#', 
                                    'type' => \Elementor\Controls_Manager::URL,
                                ),
                                array(
                                    'name' => 'pxl_icon',
                                    'label' => esc_html__('Icon', 'solarva' ),
                                    'type' => \Elementor\Controls_Manager::ICONS,
                                    'fa4compatibility' => 'icon',
                                ),
                            ),
                        ),
                    ),
                ),

                array(
                    'name' => 'section_style',
                    'label' => esc_html__('General', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(
                        array(
                            'name' => 'style',
                            'label' => esc_html__('Style', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'default' => 'pxl-social-style1' ,
                            'options' => [
                                'pxl-social-style1' =>  esc_html__('Default', 'solarva'),
                                'pxl-social-style2' => esc_html__('Box Round White .1', 'solarva'),
                                'pxl-social-style3' => esc_html__('Box Square White .1', 'solarva'),
                            ],
                        ),
                        array(
                            'name' => 'justify_content_h',
                            'label' => esc_html__('Justify Content', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::CHOOSE,
                            'label_block' => true,
                            'control_type' => 'responsive', 
                            'options' => [
                                'start' =>  [
                                    'title' => esc_html__('Start', 'solarva'),
                                    'icon' => 'eicon-align-start-h',
                                ],
                                'center' =>  [
                                    'title' => esc_html__('Center', 'solarva'),
                                    'icon' => 'eicon-align-center-h',
                                ],
                                'end' =>  [
                                    'title' => esc_html__('End', 'solarva'),
                                    'icon' => 'eicon-align-end-h',
                                ],
                                'space-around' =>  [
                                    'title' => esc_html__('Space Around', 'solarva'),
                                    'icon' => 'eicon-justify-space-around-h',
                                ],
                                'space-between' =>  [
                                    'title' => esc_html__('Space Between', 'solarva'),
                                    'icon' => 'eicon-justify-space-between-h',
                                ],
                                'space-evenly' =>  [
                                    'title' => esc_html__('Space Evenly', 'solarva'),
                                    'icon' => 'eicon-justify-space-evenly-h',
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--list' => 'justify-content: {{VALUE}};'
                            ],
                        ),
                        array(
                            'name' => 'gap',
                            'label' => esc_html__('Gap', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive' ,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--list' => 'gap: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                    ),
                ),
                array(
                    'name' => 'section_style_icon',
                    'label' => esc_html__('Item', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(   
                        array(
                            'name' => 'icon_normal_options',
                            'label' => esc_html__( 'NORMAL', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::HEADING,
                            'separator' => 'after',
                        ),    
                        array(
                            'name' => 'icon_color',
                            'label' => esc_html__( 'Color', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link' => 'color: {{VALUE}}',
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link svg path' => 'fill: {{VALUE}}',
                            ],
                        ),
                        array(
                            'name' => 'icon_bg_color',
                            'label' => esc_html__( 'Background Color', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link' => 'background-color: {{VALUE}}',
                            ],
                        ),
                        array(
                            'name' => 'icon_box_border',
                            'label' => esc_html__('Border', 'solarva'),
                            'type' => \Elementor\Group_Control_Border::get_type(),
                            'control_type' => 'group',
                            'selector' => '{{WRAPPER}} .pxl-social-icons .pxl-item--link',
                        ),
                        array(
                            'name' => 'icon_size',
                            'label' => esc_html__('Font Size', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'control_type' => 'responsive',
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 1000,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link' => 'font-size: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'icon_box_size',
                            'label' => esc_html__('Box Size', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'control_type' => 'responsive',
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 1000,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link' => '--size: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'icon_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-social-icons .pxl-item--link' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'divider2',
                            'type' => \Elementor\Controls_Manager::DIVIDER,
                        ),
                        array(
                            'name' => 'svg_options',
                            'label' => esc_html__( 'SVG', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::HEADING,
                            'separator' => 'after',
                        ),
                        array(
                            'name' => 'svg_width',
                            'label' => esc_html__('Width', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'control_type' => 'responsive',
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 1000,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link svg' => 'width: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        array(
                            'name' => 'svg_height',
                            'label' => esc_html__('Height', 'solarva'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'size_units' => ['px', '%', 'rem', 'em', 'custom'],
                            'control_type' => 'responsive',
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 1000,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link svg' => 'height: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                    ),
                ),
                array(
                    'name' => 'section_style_hover',
                    'label' => esc_html__('Hover', 'solarva' ),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(
                        array(
                            'name' => 'hover_style',
                            'label' => esc_html__('Style', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'default' => 'pxl-hover-fade', 
                            'options' => [
                                'pxl-hover-fade' => esc_html__('Fade', 'solarva'),
                                'pxl-hover-scale-bg' => esc_html__('Scale Background', 'solarva'),
                                'pxl-hover-zoom-in' => esc_html__('Zoom In', 'solarva'),
                            ]
                        ),
                        array(
                            'name' => 'icon_hover_color',
                            'label' => esc_html__( 'Color', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link:hover' => '--color: {{VALUE}}',
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link:hover svg path' => 'fill: {{VALUE}}',
                            ],
                        ),
                        array(
                            'name' => 'icon_hover_bg_color',
                            'label' => esc_html__( 'Background Color', 'solarva' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-social-icons .pxl-item--link' => '--hover-bg-color: {{VALUE}}',
                            ],
                        ),
                    ),
                ),
                solarva_widget_animation_settings(),
            ),
        ),
    ),
    solarva_get_class_widget_path()
);