<?php
use Elementor\Controls_Manager;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
Use Elementor\Core\Schemes\Typography;
use Elementor\Group_Control_Image_Size;
use Elementor\Widget_Base;
use Elementor\Group_Control_Border;


if (!defined('ABSPATH')) {
    exit;
}
if (!defined('ABSPATH')) {
    exit;
}


class Widgetkit_Pro_LearnDash_Course_Tab extends Widget_Base
{
    public $learndash_core = 'sfwd-lms/sfwd_lms.php';
    public function get_name()
    {
        return 'widgetkit-learndash-dynamic-category-tab';
    }

    public function get_title()
    {
        return __('LearnDash Course Tab', 'widgetkit-pro');
    }

    public function get_icon()
    {
        return 'eicon-post-content';
    }

    public function get_categories()
    {
        return ['widgetkit_pro'];
    }
    /**
     * A list of style that the widgets is depended in
     **/
    public function get_style_depends()
    {
        return [
            'widgetkit_bs',
            'owl-css',
            'widgetkit_pro_default',
        ];
    }
    /**
     * A list of style that the widgets is depended in
     **/
    public function get_script_depends()
    {
        return [
            'widgetkit_bs',
            'owl-carousel',
            'widgetkit_pro_default',
            'learndash_dynamic_category',
        ];
    }

    protected function register_controls()
    {

        $cat_names = array();

        if(apply_filters('wkpro_check_plugin', $this->learndash_core) && class_exists('SFWD_LMS')):
            $terms = get_terms(array(
                'post_type' => 'sfwd-courses',
                'taxonomy' => 'ld_course_category',
                'hide_empty' => false,
            ));
            foreach ($terms as $t):
                $cat_names[$t->slug] = $t->name;
            endforeach;
        endif;

#   region Query 

        $this->start_controls_section(
            'section_query',
            [
                'label' => __('Query', 'widgetkit-pro'),
            ]
        );

            $this->add_control(
                'cat_dynamic_multiple_id',
                [
                    'label' => __('Select Category', 'widgetkit-pro'),
                    'type' => Controls_Manager::SELECT2,
                    'options' => $cat_names,
                    'multiple' => true,
                ]
            );
            $this->add_control(
                'post_num_to_show',
                [
                    'label' => __('Course to Show', 'widgetkit-pro'),
                    'type' => Controls_Manager::NUMBER,
                    'default' => 6,
                    'min' => -1,
                    'max' => 100,
                    'step' => 1,
                ]
            );
            $this->add_group_control(
                Group_Control_Image_Size::get_type(),
                [
                    'name' => 'image',
                    'default' => 'large',
                    'exclude' => [ 'custom' ],
                    'separator' => 'none',
                ]
            );

        $this->end_controls_section();
#   endregion

#   region Layout         
        $this->start_controls_section(
            'content_layout_section',
            [
                'label' => __('Layout', 'widgetkit-pro'),
            ]
        );

            $this->add_control(
                'posts_column',
                [
                    'label' => __('Column', 'widgetkit-pro'),
                    'type' => Controls_Manager::SELECT,
                    'default' => '4',
                    'options' => [
                        '2' => __('6 Column', 'widgetkit-pro'),
                        '3' => __('4 Column', 'widgetkit-pro'),
                        '4' => __('3 Column', 'widgetkit-pro'),
                        '6' => __('2 Column', 'widgetkit-pro'),
                        '12' => __('1 Column', 'widgetkit-pro'),
                    ],
                ]
            );

            $this->add_control(
                'courses_layout_style',
                [
                    'label' => __('Course Style', 'widgetkit-pro'),
                    'type' => Controls_Manager::SELECT,
                    'default' => 'grid',
                    'options' => [
                        'grid' => __('Grid', 'widgetkit-pro'),
                        'active_carousel' => __('Carousel', 'widgetkit-pro'),
                    ],
                ]
            );
            $this->add_control(
                'nav_visibility',
                [
                    'label' => __('Nav Visibility', 'widgetkit-pro'),
                    'type' => Controls_Manager::SELECT,
                    'default' => 'on_hover',
                    'options' => [
                        'always_visible' => __('Always Visible', 'widgetkit-pro'),
                        'on_hover' => __('On Hover', 'widgetkit-pro'),
                    ],
                    'condition' => [
                        'courses_layout_style' => 'active_carousel',
                    ],
                ]
            );
        $this->end_controls_section(); 
#   endregion

#   region title & description

        $this->start_controls_section(
            'section_title_description',
            [
                'label' => __('Title & Description', 'widgetkit-pro'),
            ]
        );
            $this->add_control(
                'ld_course_desc',
                [
                    'label' => __('Description', 'widgetkit-pro'),
                    'type' => Controls_Manager::SWITCHER,
                    'default' => 'yes',
                    'label_on' => __('Show', 'widgetkit-pro'),
                    'label_off' => __('Hide', 'widgetkit-pro'),
                    'return_value' => 'yes',
                ]
            );
            $this->add_control(
            'post_desc_length',
                [
                    'label' => __('Word Count', 'widgetkit-pro'),
                    'type' => Controls_Manager::NUMBER,
                    'default' => 20,
                    'min' => 1,
                    'max' => 100,
                    'step' => 1,
                    'condition' => [
                        'ld_course_desc' => 'yes',
                    ],
                ]
            );

        $this->end_controls_section();
#   endregion

#   region meta

        $this->start_controls_section(
            'section_meta',
            [
                'label' => __('Meta', 'widgetkit-pro'),
            ]
        );
            $this->add_control(
                'ld_course_price',
                [
                    'label' => __('Price', 'widgetkit-pro'),
                    'type' => Controls_Manager::SWITCHER,
                    'default' => 'yes',
                    'label_on' => __('Show', 'widgetkit-pro'),
                    'label_off' => __('Hide', 'widgetkit-pro'),
                    'return_value' => 'yes',
                ]
            );
            $this->add_control(
                'ld_course_btn',
                [
                    'label' => __('Button', 'widgetkit-pro'),
                    'type' => Controls_Manager::SWITCHER,
                    'default' => 'yes',
                    'label_on' => __('Show', 'widgetkit-pro'),
                    'label_off' => __('Hide', 'widgetkit-pro'),
                    'return_value' => 'yes',
                ]
            );

        $this->end_controls_section();
#   endregion



#   region title & description style 

        $this->start_controls_section(
            'section_wapper_style',
            [
                'label' => __('Title & Description', 'widgetkit-pro'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
            $this->add_control(
                'style_heading_title',
                [
                'label' => __( 'Title', 'widgetkit-pro' ),
                'type' => Controls_Manager::HEADING,
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'label' => __('Typography', 'widgetkit-pro'),
                    'name' => 'title_typography',
                    'selector' => '{{WRAPPER}} .course a.course-title-link',
                ]
            );

            $this->start_controls_tabs('title_style_tabs');

                $this->start_controls_tab(
                    'title_style_normal_tab',
                    [
                        'label' => __('Normal', 'widgetkit-pro'),
                    ]
                );

                    $this->add_control(
                        'title_color',
                        [
                            'label' => __('Color', 'widgetkit-pro'),
                            'type' => Controls_Manager::COLOR,
                            'default' => '',
                            'selectors' => [
                                '{{WRAPPER}} .course a.course-title-link' => 'color: {{VALUE}}',
                            ],
                        ]
                    );

                $this->end_controls_tab(); // Normal Tab end

                $this->start_controls_tab(
                    'title_style_hover_tab',
                    [
                        'label' => __('Hover', 'widgetkit-pro'),
                    ]
                );
                    $this->add_control(
                        'title_hover_color',
                        [
                            'label' => __('Color', 'widgetkit-pro'),
                            'type' => Controls_Manager::COLOR,
                            'default' => '',
                            'selectors' => [
                                '{{WRAPPER}} .course .wk-entry-title:hover a.course-title-link' => 'color: {{VALUE}}',
                            ],
                        ]
                    );

                $this->end_controls_tab(); // Hover Tab end

            $this->end_controls_tabs();

            $this->add_responsive_control(
                'title_spacing_bottom',
                [
                    'label' => __( 'Spacing Bottom', 'widgetkit-pro' ),
                    'type' => Controls_Manager::SLIDER,
                    'range' => [
                        'px' => [
                            'min' => 0,
                            'max' => 100,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .wkp-ld-course-tab-element  .wk-entry-title' => 'margin-bottom: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );

            /**
             * content
             */
            $this->add_control(
                'style_heading_content',
                [
                'label' => __( 'Content', 'widgetkit-pro' ),
                'type' => Controls_Manager::HEADING,
                'separator' => 'before',
                ]
            );
            $this->add_control(
                'content_color',
                [
                    'label' => __('Color', 'widgetkit-pro'),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .ld-entry-content' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'label' => __('Typography', 'widgetkit-pro'),
                    'name' => 'content_typography',
                    'selector' => '{{WRAPPER}} .ld-entry-content',
                ]
            );
            $this->add_responsive_control(
                'desc_spacing_bottom',
                [
                    'label' => __( 'Spacing Bottom', 'widgetkit-pro' ),
                    'type' => Controls_Manager::SLIDER,
                    'range' => [
                        'px' => [
                            'min' => 0,
                            'max' => 100,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .wkp-ld-course-tab-element  .ld-entry-content' => 'margin-bottom: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );
                
        $this->end_controls_section();
#   endregion 

#   region Price style
        $this->start_controls_section(
            'section_price_style',
            [
                'label' => __( 'Price', 'widgetkit-pro' ),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
            $this->add_control(
                'price_color',
                [
                    'label' => __('Color', 'widgetkit-pro'),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .ld_course_grid_price' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'label' => __('Typography', 'widgetkit-pro'),
                    'name' => 'price_typography',
                    'selector' => '{{WRAPPER}} .ld_course_grid_price',
                ]
            );
            $this->add_control(
                'price_bg_color',
                [
                    'label' => __('Background', 'widgetkit-pro'),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .ld_course_grid_price' => 'background-color: {{VALUE}};',
                        '{{WRAPPER}} .ld_course_grid_price:before' => 'border-top: 4px solid {{VALUE}}; border-right: 4px solid {{VALUE}}',
                    
                    ],
                ]
            );

        $this->end_controls_section();
#   endregion 

#   region Button style
        $this->start_controls_section(
            'section_button_style',
            [
                'label' => __( 'Button', 'widgetkit-pro' ),
                 'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
        // Button
        $this->add_group_control(
            Group_Control_Typography::get_type(),
            [
                'label' => __('Button Typography', 'widgetkit-pro'),
                'name' => 'button_typography',
                'selector' => '{{WRAPPER}} .course .ld_course_grid_button a.btn',
            ]
        );

            $this->start_controls_tabs('button_style_tabs');

                $this->start_controls_tab(
                    'button_style_normal_tab',
                    [
                        'label' => __('Normal', 'widgetkit-pro'),
                    ]
                );

                    $this->add_control(
                        'button_text_color',
                        [
                            'label' => __('Text Color', 'widgetkit-pro'),
                            'type' => Controls_Manager::COLOR,
                            'default' => '',
                            'selectors' => [
                                '{{WRAPPER}} .ld_course_grid_button .btn.btn-primary' => 'color: {{VALUE}} ;',
                                '{{WRAPPER}} .ld_course_grid_button .btn-primary' => 'border-color: {{VALUE}} ;',
                            ],
                        ]
                    );

                    $this->add_control(
                        'button_bg_color',
                        [
                            'label' => __('Background Color', 'widgetkit-pro'),
                            'type' => Controls_Manager::COLOR,
                            'default' => '',
                            'selectors' => [
                                '{{WRAPPER}} .ld_course_grid_button .btn-primary' => 'background-color: {{VALUE}};',
                            ],
                        ]
                    );
                    $this->add_control(
                        'button_border_color',
                        [
                            'label' => __('Border', 'widgetkit-pro'),
                            'type' => Controls_Manager::COLOR,
                            'default' => '',
                            'selectors' => [
                                '{{WRAPPER}} .ld_course_grid_button .btn-primary' => 'border-color: {{VALUE}};',
                            ],
                        ]
                    );

                $this->end_controls_tab(); // Normal Tab end

                $this->start_controls_tab(
                    'button_style_hover_tab',
                    [
                        'label' => __('Hover', 'widgetkit-pro'),
                    ]
                );
                    $this->add_control(
                        'button_hover_text_color',
                        [
                            'label' => __('Color', 'widgetkit-pro'),
                            'type' => Controls_Manager::COLOR,
                            'default' => '',
                            'selectors' => [
                                '{{WRAPPER}} .ld_course_grid_button .btn-primary:hover' => 'color: {{VALUE}} ;',
                            ],
                        ]
                    );
                    $this->add_control(
                        'button_hover_color',
                        [
                            'label' => __('Background', 'widgetkit-pro'),
                            'type' => Controls_Manager::COLOR,
                            'default' => '',
                            'selectors' => [
                                '{{WRAPPER}} .ld_course_grid_button .btn-primary:hover' => 'border-color: {{VALUE}} !important; Background: {{VALUE}} !important;',
                            ],
                        ]
                    );
                    $this->add_control(
                        'button_hover_border_color',
                        [
                            'label' => __('Border', 'widgetkit-pro'),
                            'type' => Controls_Manager::COLOR,
                            'default' => '',
                            'selectors' => [
                                '{{WRAPPER}} .ld_course_grid_button .btn-primary:hover' => 'border-color: {{VALUE}};',
                            ],
                        ]
                    );

                $this->end_controls_tab(); // Hover Tab end

            $this->end_controls_tabs();

            $this->add_control(
                'padding_hr',
                [
                'type' => \Elementor\Controls_Manager::DIVIDER,
                ]
            );
            $this->add_control(
                'button-border-width',
                [
                    'label'   => esc_html__( 'Border Width', 'widgetkit-pro' ),
                    'type'    => Controls_Manager::SLIDER,
                    'default' => [
                        'size' =>2,
                    ],
                    'range'  => [
                        'px' => [
                            'min' => 0,
                            'max' => 50,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ld_course_grid_button .btn-primary' => 'border-width: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );
            $this->add_control(
                'button-border-radius',
                [
                    'label'   => esc_html__( 'Radius', 'widgetkit-pro' ),
                    'type'    => Controls_Manager::SLIDER,
                    'default' => [
                        'size' =>50,
                    ],
                    'range'  => [
                        'px' => [
                            'min' => 0,
                            'max' => 200,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .ld_course_grid_button .btn-primary' => 'border-radius: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );
            $this->add_responsive_control(
                'single_course_padding',
                [
                    'label' => esc_html__( 'Padding', 'widgetkit-pro' ),
                    'type'  => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px'],
                    'selectors'  => [
                        '{{WRAPPER}} .ld_course_grid_button .btn-primary' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'default' => [
                        'top' => '7',
                        'right' => '20',
                        'bottom' => '7',
                        'left' => '20',
                        'unit' => 'px',
                        'isLinked' => false,
                    ],
                ]
            );

        $this->end_controls_section();
#   endregion         

#   region Navigation & overlay style
        /**
         * Navigation
         */
        $this->start_controls_section(
            'navigation_style',
            [
                'label' => __('Navigation & Overlay', 'widgetkit-pro'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
            $this->add_responsive_control(
                'tab_align',
                [
                    'label' => __('Alignment', 'widgetkit-pro'),
                    'type' => Controls_Manager::CHOOSE,
                    'default' => 'center',
                    'selectors' => [
                        '{{WRAPPER}} .learndash-dynamic-category-wrapper' => 'text-align: {{UNIT}};',
                    ],
                    'options' => [
                        'left' => [
                            'title' => __('Left', 'widgetkit-pro'),
                            'icon' => 'fa fa-align-left',
                        ],
                        'center' => [
                            'title' => __('Center', 'widgetkit-pro'),
                            'icon' => 'fa fa-align-center',
                        ],
                        'right' => [
                            'title' => __('Right', 'widgetkit-pro'),
                            'icon' => 'fa fa-align-right',
                        ],
                    ],

                ]
            );
            $this->add_group_control(
                Group_Control_Typography::get_type(),
                [
                    'label' => __('Typography', 'widgetkit-pro'),
                    'name' => 'navigation_typography',
                    'selector' => '{{WRAPPER}} .learndash-dynamic-category-wrapper .multiple-cat .cat-item .tab-text',
                ]
            );
            $this->add_responsive_control(
                'tab_spacing',
                [
                    'label' => __('Bottom Spacing', 'widgetkit-pro'),
                    'type' => Controls_Manager::SLIDER,
                    'range' => [
                        'px' => [
                            'min' => 0,
                            'max' => 100,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}} .learndash-dynamic-category-wrapper' => 'margin-bottom: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );

            $this->add_responsive_control(
                'tab_cat_spacing',
                [
                    'label' => __('Nav Spacing', 'widgetkit-pro'),
                    'type' => Controls_Manager::SLIDER,
                    'range' => [
                        'px' => [
                            'min' => 0,
                            'max' => 80,
                        ],
                    ],
                    'selectors' => [
                        '{{WRAPPER}}  .learndash-dynamic-category-wrapper .multiple-cat .cat-item' => 'padding-left: {{SIZE}}{{UNIT}}; padding-right: {{SIZE}}{{UNIT}};',
                    ],
                ]
            );
            $this->add_control(
                'seperator_color',
                [
                    'label' => __('Seperator Color', 'widgetkit-pro'),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .learndash-dynamic-category-wrapper' => 'border-bottom-color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_control(
                'tab_hr',
                [
                    'type' => \Elementor\Controls_Manager::DIVIDER,
                ]
            );
            $this->start_controls_tabs('tabs_button_style');
                /**
                 * Normal style
                 */
                $this->start_controls_tab(
                    'navigation-style-normal',
                    [
                        'label' => __('Normal', 'widgetkit-pro'),
                    ]
                );
                $this->add_control(
                    'navigation_color',
                    [
                        'label' => __('Color', 'widgetkit-pro'),
                        'type' => Controls_Manager::COLOR,
                        'selectors' => [
                            '{{WRAPPER}}  .learndash-dynamic-category-wrapper .multiple-cat .cat-item' => 'color: {{VALUE}}',
                        ],
                    ]
                );
                $this->add_control(
                    'navigation_border_color',
                    [
                        'label' => __('Border Color', 'widgetkit-pro'),
                        'type' => Controls_Manager::COLOR,
                        'selectors' => [
                            '{{WRAPPER}} .learndash-dynamic-category-wrapper .multiple-cat .cat-item.active:after' => 'background-color: {{VALUE}}',
                        ],
                    ]
                );
                $this->end_controls_tab();
                /**
                 * Active Style
                 */
                $this->start_controls_tab(
                    'navigation-style-active',
                    [
                        'label' => __('Active', 'widgetkit-pro'),
                    ]
                );
                $this->add_control(
                    'navigation_hover_color',
                    [
                        'label' => __('Color', 'widgetkit-pro'),
                        'type' => Controls_Manager::COLOR,
                        'selectors' => [
                            '{{WRAPPER}}  .learndash-dynamic-category-wrapper .multiple-cat .cat-item.active' => 'color: {{VALUE}};',
                            '{{WRAPPER}} .dynamic-category-body .owl-nav .owl-carousel-left, .dynamic-category-body .owl-nav .owl-carousel-right' => 'color: {{VALUE}};',
                            '{{WRAPPER}}  .learndash-dynamic-category-wrapper .multiple-cat .cat-item.active:after' => 'background-color: {{VALUE}};',
                            '{{WRAPPER}}  .widgetkit-lp-course-1 .owl-nav .owl-carousel-left, .widgetkit-lp-course-1 .owl-nav .owl-carousel-right, .widgetkit-course-1 .owl-nav .owl-carousel-left, .widgetkit-course-1 .owl-nav .owl-carousel-right, .dynamic-category-body .owl-nav .owl-carousel-left, .dynamic-category-body .owl-nav .owl-carousel-right' => 'color: {{VALUE}};',
                        ],
                    ]
                );
                $this->end_controls_tab();

            $this->end_controls_tabs();

            /**
             * overlay
             */
            $this->add_control(
                'style_heading_overlay',
                [
                'label' => __( 'Overlay', 'widgetkit-pro' ),
                'type' => Controls_Manager::HEADING,
                'separator' => 'before'
                ]
            );
                $this->add_control(
                    'tab_loding_color',
                    [
                        'label' => __('Dot Color', 'widgetkit-pro'),
                        'type' => Controls_Manager::COLOR,
                        'selectors' => [
                            '{{WRAPPER}} .lds-ellipsis div' => 'background-color: {{VALUE}};',
                        ],
                    ]
                );
                $this->add_control(
                    'tab_overlay_color',
                    [
                        'label' => __('Overlay Color', 'widgetkit-pro'),
                        'type' => Controls_Manager::COLOR,
                        'selectors' => [
                            '{{WRAPPER}} .dynamic-cat-post-list .ajax-contents' => 'background-color: {{VALUE}};',
                        ],
                    ]
                );

        $this->end_controls_section();
#   endregion        

#   region carousel 
        $this->start_controls_section(
            'loading_overlay_style',
            [
                'label' => __('Carousel', 'widgetkit-pro'),
                'tab' => Controls_Manager::TAB_STYLE,
                'condition' => [
                    'courses_layout_style' => 'active_carousel'
                ]
            ]
        );
            
            // $this->add_control(
            //     'carousel_icon_color_hover',
            //     [
            //         'label' => __('Icon Color', 'widgetkit-pro'),
            //         'type' => Controls_Manager::COLOR,
            //         'selectors' => [
            //             '{{WRAPPER}} .dynamic-category-body .owl-carousel-left i' => 'color: {{VALUE}};',
            //             '{{WRAPPER}} .dynamic-category-body .owl-carousel-right i' => 'color: {{VALUE}};',
            //         ],
            //     ]
            // );
            $this->add_control(
                'carousel_icon_color',
                [
                    'label' => __('Icon Color', 'widgetkit-pro'),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .dynamic-category-body .owl-carousel-left i' => 'color: {{VALUE}};',
                        '{{WRAPPER}} .dynamic-category-body .owl-carousel-right i' => 'color: {{VALUE}};',
                        '{{WRAPPER}} .dynamic-category-body .owl-nav .owl-carousel-right:hover, {{WRAPPER}} .dynamic-category-body .owl-nav .owl-carousel-left:hover' => 'background-color: {{VALUE}};',
                    ],
                ]
            );
    
            $this->add_control(
                'carousel_icon_bg_color',
                [
                    'label' => __('Background Color', 'widgetkit-pro'),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .dynamic-category-body .owl-nav .owl-carousel-left' => 'background-color: {{VALUE}};',
                        '{{WRAPPER}} .dynamic-category-body .owl-nav .owl-carousel-right' => 'background-color: {{VALUE}};',
                        '{{WRAPPER}} .dynamic-category-body .owl-nav .owl-carousel-right:hover i, {{WRAPPER}} .dynamic-category-body .owl-nav .owl-carousel-left:hover i' => 'color: {{VALUE}};',
                    ],
                ]
            );
            $this->add_responsive_control(
            'tab_course_arrow_border_radius',
                [
                    'label' => esc_html__( 'Border Radius', 'widgetkit-pro' ),
                    'type'  => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', '%' ],
                    'selectors'  => [
                        '{{WRAPPER}} .dynamic-category-body .owl-nav .owl-carousel-left, {{WRAPPER}} .dynamic-category-body .owl-nav .owl-carousel-right' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                ]
            );
        $this->end_controls_section();
#   endregion 

#   region Global option
        
        $this->start_controls_section(
            'single_course_style',
            [
                'label' => __('Global Option', 'widgetkit-pro'),
                'tab' => Controls_Manager::TAB_STYLE,
            ]
        );
            $this->add_control(
                'single-course-style-background',
                [
                    'label' => __('Background', 'widgetkit-pro'),
                    'type' => Controls_Manager::COLOR,
                    'selectors' => [
                        '{{WRAPPER}} .course .ld-caption' => 'background: {{VALUE}};',
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Border::get_type(), 
                [
                    'name'          => 'single-course-style-border',
                    'selector'      => '{{WRAPPER}} .course',
                ]
            );
            $this->add_responsive_control(
                'tab_course_border_radius',
                [
                    'label' => esc_html__( 'Border Radius', 'widgetkit-pro' ),
                    'type'  => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px', '%' ],
                    'selectors'  => [
                        '{{WRAPPER}} .dynamic-category-body .course' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;',
                    ],
                ]
            );
            $this->add_responsive_control(
                'title_center_padding',
                [
                    'label' => esc_html__( 'Title Padding', 'widgetkit-pro' ),
                    'type'  => Controls_Manager::DIMENSIONS,
                    'size_units' => [ 'px'],
                    'selectors'  => [
                        '{{WRAPPER}} .course .ld-caption' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
                    ],
                    'default' => [
                        'top' => '30',
                        'right' => '25',
                        'bottom' => '30',
                        'left' => '25',
                        'unit' => 'px',
                        'isLinked' => false,
                    ],
                ]
            );
            $this->add_group_control(
                Group_Control_Box_Shadow::get_type(),
                [
                    'name' => 'layout_box_shadow',
                    'exclude' => [
                        'box_shadow_position',
                    ],
                    'selector' => '{{WRAPPER}} .dynamic-category-body .course',
                ]
            );
        $this->end_controls_section();
#   endregion 

    }
    protected function render()
    {
        include plugin_dir_path(__FILE__) . '../layout/learndash-course-tab.php';
    }

    protected function _content_template()
    {
    }
}
