<?php

namespace Layerdrops\Ostech\Widgets;


class Team extends \Elementor\Widget_Base
{
    public function get_name()
    {
        return 'ostech-team';
    }

    public function get_title()
    {
        return __('Team', 'ostech-addon');
    }

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

    public function get_categories()
    {
        return ['ostech-category'];
    }

    protected function register_controls()
    {
        $this->start_controls_section(
            'layout_section',
            [
                'label' => __('Layout', 'ostech-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this->add_control(
            'layout_type',
            [
                'label' => __('Select Layout', 'ostech-addon'),
                'type' => \Elementor\Controls_Manager::SELECT2,
                'default' => 'layout_one',
                'options' => [
                    'layout_one' => __('Layout One', 'ostech-addon'),
                    'layout_two' => __('Layout Two', 'ostech-addon'),
                    'layout_three' => __('Layout Three', 'ostech-addon'),
                    // 'layout_four' => __('Layout Four', 'ostech-addon'),
                    // 'layout_five' => __('Layout Five', 'ostech-addon'),
                    // 'layout_six' => __('Layout Six', 'ostech-addon'),
                ]
            ]
        );

        $this->end_controls_section();

        include ostech_get_elementor_option('team-one-option.php');
        include ostech_get_elementor_option('team-three-option.php');
        include ostech_get_elementor_option('team-four-option.php');
        include ostech_get_elementor_option('team-five-option.php');
        include ostech_get_elementor_option('team-six-option.php');

        //General style
        $this->start_controls_section(
            'general_style',
            [
                'label' => esc_html__('Content Style', 'ostech-addon'),
                'tab' => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        ostech_elementor_general_style_options($this, 'Section Title', '{{WRAPPER}} .section-title__title,{{WRAPPER}} .sec-title-two__title', ['layout_five', 'layout_four', 'layout_five', 'layout_six']);
        ostech_elementor_general_style_options($this, 'Section Sub Title', '{{WRAPPER}} .section-title__tagline,{{WRAPPER}} .sec-title-two__tagline', ['layout_five', 'layout_four', 'layout_five', 'layout_six']);

        ostech_elementor_general_style_options($this, 'Name', '{{WRAPPER}} .team-card__content__title,{{WRAPPER}} .team-details__content__subtitle,{{WRAPPER}} .team-card-three__title', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five', 'layout_six']);
        ostech_elementor_general_style_options($this, 'Designation', '{{WRAPPER}} .team-card__content__designation,{{WRAPPER}} .team-details__content__title,{{WRAPPER}} .team-card-three__designation', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five', 'layout_six']);

        ostech_elementor_general_style_options($this, 'Summary', '{{WRAPPER}} .team-details__content__text', ['layout_three']);

        ostech_elementor_general_style_options($this, 'Features List', '{{WRAPPER}} .team-details__list > li', ['layout_three']);
        ostech_elementor_general_style_options($this, 'Progressbar Title', '{{WRAPPER}} .team-skills__progress__title', ['layout_three']);
        ostech_elementor_general_style_options($this, 'Progressbar Count', '{{WRAPPER}} .team-details .team-skills__progress__number', ['layout_three']);

        ostech_elementor_general_style_options($this, 'Team Details Progress Color', '{{WRAPPER}} .team-details .team-skills__progress__inner', ['layout_three'], 'background-color', false);

        $this->end_controls_section();

        ostech_elementor_column_count_options($this, ['layout_one']);

        ostech_get_elementor_carousel_options($this, ['layout_two', 'layout_four', 'layout_five']);
    }

    protected function render()
    {
        $settings = $this->get_settings_for_display();
        include ostech_get_template('team-one.php');
        include ostech_get_template('team-two.php');
        include ostech_get_template('team-three.php');
        include ostech_get_template('team-four.php');
        include ostech_get_template('team-five.php');
        include ostech_get_template('team-six.php');
    }
}
