<?php
namespace ThemeAtelier\EventfulForElementor\Admin\Widgets\Options;

use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
use Elementor\Core\Kits\Documents\Tabs\Global_Typography;

class EventfulForElementorStyleFilterBar
{
    public static function ppfe_style_filter_bar($widget)
    {
        $widget->start_controls_section(
            'filter_bar_tab',
            [
                'label' => esc_html__('Filter Bar', 'eventful-for-elementor'),
                'tab'   => \Elementor\Controls_Manager::TAB_STYLE,
            ]
        );

        $widget->start_controls_tabs('filter_bar_color_style');

        // Normal tab.
        $widget->start_controls_tab(
            'filter_bar_normal',
            array(
                'label' => esc_html__('Normal', 'eventful-for-elementor'),
            )
        );

        // Navigation color.
        $widget->add_control(
            'filter_bar_color',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Color', 'eventful-for-elementor'),
                'global' => [
                    'default' => Global_Colors::COLOR_TEXT,
                ],
                'selectors' => [
                    '{{WRAPPER}} .efpe-author-filter.efpe-bar.fl_button input ~ div' => 'color: {{VALUE}}',
                ],
            ]
        );

        // Navigation background.
        $widget->add_control(
            'filter_bar_background',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Background', 'eventful-for-elementor'),
                'global' => [
                    'default' => Global_Colors::COLOR_PRIMARY,
                ],
                'selectors' => [
                    '{{WRAPPER}} .efpe-author-filter.efpe-bar.fl_button input ~ div' => 'background: {{VALUE}};',
                ],
            ]
        );

        // Navigation border.
        $widget->add_control(
            'filter_bar_border',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Border Color', 'eventful-for-elementor'),
                'global' => [
                    'default' => Global_Colors::COLOR_PRIMARY,
                ],
                'selectors' => [
                    '{{WRAPPER}} .efpe-author-filter.efpe-bar.fl_button input ~ div' => 'border-color: {{VALUE}};',
                ],
            ]
        );

        $widget->end_controls_tab();

        // Hover tab.
        $widget->start_controls_tab(
            'filter_bar_active_tab',
            array(
                'label' => esc_html__('Active', 'eventful-for-elementor'),
            )
        );

        // Navigation active color.
        $widget->add_control(
            'filter_bar_active_color',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Color', 'eventful-for-elementor'),
                'global' => [
                    'default' => Global_Colors::COLOR_TEXT,
                ],
                'selectors' => [
                    '{{WRAPPER}} .efpe-author-filter.efpe-bar.fl_button input:checked ~ div' => 'color: {{VALUE}};',
                ],
            ]
        );

        // Navigation active background.
        $widget->add_control(
            'filter_bar_active_background',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Background', 'eventful-for-elementor'),
                'global' => [
                    'default' => Global_Colors::COLOR_TEXT,
                ],
                'selectors' => [
                    '{{WRAPPER}} .efpe-author-filter.efpe-bar.fl_button input:checked ~ div' => 'background: {{VALUE}};',
                ],
            ]
        );

        // Navigation border.
        $widget->add_control(
            'filter_bar_active_border',
            [
                'type'      => \Elementor\Controls_Manager::COLOR,
                'label'     => esc_html__('Border', 'eventful-for-elementor'),
                'global' => [
                    'default' => Global_Colors::COLOR_TEXT,
                ],
                'selectors' => [
                    '{{WRAPPER}} .efpe-author-filter.efpe-bar.fl_button input:checked ~ div' => 'border-color: {{VALUE}};',
                ],
            ]
        );

        $widget->end_controls_tabs();
        $widget->end_controls_section();
    }
}
