<?php
// Register Icon Box Widget
pxl_add_custom_widget(
    array(
        'name' => 'pxl_line_icon',
        'title' => esc_html__('Case Line Icon', 'aimo' ),
        'icon' => 'eicon-icon-box',
        'categories' => array('pxltheme-core'),
        'params' => array(
            'sections' => array(
                array(
                    'name' => 'section_style_text',
                    'label' => esc_html__('Style', 'aimo'),
                    'tab' => \Elementor\Controls_Manager::TAB_STYLE,
                    'controls' => array(   
                        array(
                            'name' => 'layout',
                            'label' => esc_html__('Layout', 'aimo' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'options' => [
                                '1' => 'Layout 1',
                                '2' => 'Layout 2',
                            ],
                            'default' => '1',
                        ),
                        array(
                            'name' => 'pxl_icon',
                            'label' => esc_html__('Icon', 'aimo' ),
                            'type' => \Elementor\Controls_Manager::ICONS,
                            'fa4compatibility' => 'icon',
                        ), 
                        array(
                            'name' => 'icon_font_size',
                            'label' => esc_html__('Font Size', 'aimo' ),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'size_units' => [ 'px' ],
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 300,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-line-icon i' => 'font-size: {{SIZE}}{{UNIT}};','{{WRAPPER}} .pxl-line-icon svg' => 'height: {{SIZE}}{{UNIT}};'
                            ],
                        ),   
                        array(
                            'name' => 'icon_color',
                            'label' => esc_html__('Icon Color', 'aimo' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-line-icon .pxl-item--icon ' => 'color: {{VALUE}};','{{WRAPPER}} .pxl-line-icon .pxl-item--icon ' => 'fill: {{VALUE}};',
                            ],
                        ),    
                        array(
                            'name' => 'style_l1',
                            'label' => esc_html__('Style', 'aimo' ),
                            'type' => \Elementor\Controls_Manager::SELECT,
                            'default' => 'style-2',
                            'options' => [
                                'style-1' => 'Hide Circle',
                                'style-2' => 'Show Circle',
                            ],
                        ),   
                        array(
                            'name' => 'background',
                            'label' => esc_html__('Background Circle', 'aimo' ),
                            'type' => \Elementor\Controls_Manager::TEXT,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::after, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::after' => 'background: {{VALUE}};',
                            ],
                            'condition' => [
                                'style_l1' => 'style-2',
                            ],
                        ),
                        array(
                            'name' => 'pos_top',
                            'label' => esc_html__('Top', 'aimo'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'condition' => [
                                'style_l1' => 'style-2',
                            ],
                            'range' => [
                                'px' => [
                                    'min' => -500,
                                    'max' => 500,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::after, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::after' => 'top: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        
                        array(
                            'name' => 'pos_right',
                            'label' => esc_html__('Right', 'aimo'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'condition' => [
                                'style_l1' => 'style-2',
                            ],
                            'range' => [
                                'px' => [
                                    'min' => -500,
                                    'max' => 500,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::after, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::after' => 'right: {{SIZE}}{{UNIT}};',
                            ],
                        ),  
                        array(
                            'name' => 'pos_bottom',
                            'label' => esc_html__('Bottom', 'aimo'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'condition' => [
                                'style_l1' => 'style-2',
                            ],
                            'range' => [
                                'px' => [
                                    'min' => -500,
                                    'max' => 500,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::after, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::after' => 'bottom: {{SIZE}}{{UNIT}};',
                            ],
                        ),
                        
                        array(
                            'name' => 'pos_left',
                            'label' => esc_html__('Left', 'aimo'),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'condition' => [
                                'style_l1' => 'style-2',
                            ],
                            'range' => [
                                'px' => [
                                    'min' => -500,
                                    'max' => 500,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon::after, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::before, {{WRAPPER}} .pxl-line-icon2 .pxl-item--icon .pxl-gradien1::after' => 'left: {{SIZE}}{{UNIT}};',
                            ],
                        ),    
                        array(
                            'name' => 't_width',
                            'label' => esc_html__('Width', 'aimo' ),
                            'type' => \Elementor\Controls_Manager::SLIDER,
                            'control_type' => 'responsive',
                            'size_units' => [ 'px', '%' ],
                            'range' => [
                                'px' => [
                                    'min' => 0,
                                    'max' => 3000,
                                ],
                            ],
                            'selectors' => [
                                '{{WRAPPER}} .pxl-line-icon .pxl-line' => 'width: {{SIZE}}{{UNIT}};',
                            ],
                            'condition' => [
                                'layout' => '1',
                            ],
                        ),
                        array(
                            'name' => 'background',
                            'label' => esc_html__('Background Line', 'aimo' ),
                            'type' => \Elementor\Controls_Manager::COLOR,
                            'selectors' => [
                                '{{WRAPPER}} .pxl-line-icon .pxl-line' => 'background: {{VALUE}};',
                            ],
                            'condition' => [
                                'layout' => '1',
                            ],
                        ),
                    ),
                ),
                aimo_widget_animation_settings(),
            ),
        ),
    ),
    aimo_get_class_widget_path()
);