<?php
/**
 * @package     productive-forms
 * @author      productiveminds.com
 * @copyright   productiveminds.com
 */


// Start:: Content
$this->start_controls_section(
    'section_content_layout',
    [
        'label' => esc_html__( 'Layout', 'productive-forms' ),
        'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
    ]
);

$this->add_control(
    'is_formonly',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Contact Us Form Only?', 'productive-forms' ),
        'options' => [
        ] + productive_global_get_yes_or_no_options(),
        'default' => '0',
    ]
);

$this->add_control(
    'productive_forms_contact_side',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Form Position', 'productive-forms' ),
        'options' => [
            'contact_form_on_left' => esc_html__( 'Left Side', 'productive-forms' ),
            'contact_form_on_right' => esc_html__( 'Right Side', 'productive-forms' ),
        ],
        'default' => 'contact_form_on_left',
    ]
);

$this->add_control(
    'section_style_layout_contact_box_hr',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);
$this->add_control(
    'section_style_layout_contact_box_group_label',
    [
        'label' => esc_html__( 'Contact Form Block', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
    ]
);

$this->add_responsive_control(
    'section_style_layout_form_on_left_form_width',
    [
        'label' => esc_html__( 'Form Width', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ '%', 'px' ],
        'range' => [
            '%' => [
                'min' => 5,
                'max' => 100,
                'step' => 1,
            ],
            'px' => [
                'min' => 20,
                'max' => 1000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.contact-us-page .productiveminds_double_grid' => 'grid-template-columns: clamp(200px, {{SIZE}}{{UNIT}}, 75%) minmax(calc(20% - 50px), auto);',
        ],
        'condition' => [
            'productive_forms_contact_side' => [ 'contact_form_on_left', ],
        ],
    ]
);

$this->add_responsive_control(
    'section_style_layout_form_on_right_form_width',
    [
        'label' => esc_html__( 'Form Width', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ '%', 'px' ],
        'range' => [
            '%' => [
                'min' => 5,
                'max' => 100,
                'step' => 1,
            ],
            'px' => [
                'min' => 20,
                'max' => 1000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.contact-us-page .productiveminds_double_grid' => 'grid-template-columns: minmax(calc(20% - 25px), auto) clamp(200px, {{SIZE}}{{UNIT}}, 75%);',
        ],
        'condition' => [
            'productive_forms_contact_side' => [ 'contact_form_on_right', ],
        ],
    ]
);

$this->add_control(
    'section_content_content_align_vertical_contact',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Vertical Alignment', 'productive-forms' ),
        'options' => [
        ] + productive_global_get_vertical_css_align_options(),
        'default' => 'flex-start',
        'selectors' => [
                '{{WRAPPER}} .productiveminds_section.contact-us-page .productive_forms_contact_us_page_form_side' => 'align-content: {{VALUE}};',
        ],
    ]
);

$this->add_control(
    'section_style_layout_content_box_hr',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);
$this->add_control(
    'section_style_layout_content_box_group_label',
    [
        'label' => esc_html__( 'Other Contact Info Block', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
    ]
);

$this->add_control(
    'section_content_layout_align_vertical_content',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Vertical Alignment', 'productive-forms' ),
        'options' => [
        ] + productive_global_get_vertical_css_align_options(),
        'default' => 'flex-start',
        'selectors' => [
                '{{WRAPPER}} .productiveminds_section.contact-us-page .productive_forms_contact_us_page_info_side' => 'align-content: {{VALUE}};',
        ],
    ]
);

// Widget Container
$this->add_control(
    'section_style_each_widget_box_hr',
    [
        'type' => \Elementor\Controls_Manager::DIVIDER,
    ]
);
$this->add_control(
    'section_style_each_widget_box_hr_label',
    [
        'label' => esc_html__( 'Widget Container', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::RAW_HTML,
    ]
);

$this->add_responsive_control(
    'section_style_layout_width_content_box',
    [
        'label' => esc_html__( 'Width', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px', '%' ],
        'range' => [
            'px' => [
                'min' => 100,
                'max' => 32000,
                'step' => 10,
            ],
            '%' => [
                'min' => 10,
                'max' => 100,
                'step' => 1,
            ],
        ],
        'default' => [
            'unit' => '%',
            'size' => 100,
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section .productiveminds_section_uno' => 'width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_style_layout_max_width_content_box',
    [
        'label' => esc_html__( 'Max Width (px)', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'px' ],
        'range' => [
            'px' => [
                'min' => 100,
                'max' => 3000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section .productiveminds_section_uno' => 'max-width: {{SIZE}}{{UNIT}};',
        ],
    ]
);

$this->add_responsive_control(
    'section_content_layout_align_box',
    [
        'type' => \Elementor\Controls_Manager::SELECT,
        'label' => esc_html__( 'Container Justification', 'productive-forms' ),
        'options' => [
        ] + productive_global_get_horizontal_css_align_options(),
        'default' => 'center',
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section' => 'justify-content: {{VALUE}}; justify-items: {{VALUE}}',
        ],
    ]
);

$this->end_controls_section();
// End:: Content




/**
 * 
 * Start:: Styles
 * 
 */
$this->start_controls_section(
    'section_style_layout',
    [
        'label' => esc_html__( 'Layout', 'productive-forms' ),
        'tab' => \Elementor\Controls_Manager::TAB_STYLE,
    ]
);

$this->add_responsive_control(
    'section_style_each_item_col_gap',
    [
        'label' => esc_html__( 'Column Gap', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'rem', 'px' ],
        'range' => [
            'rem' => [
                'min' => 0,
                'max' => 50,
                'step' => 1,
            ],
            'px' => [
                'min' => 0,
                'max' => 1000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.contact-us-page .productiveminds_double_grid' => 'column-gap: {{SIZE}}{{UNIT}}',
        ],
	'frontend_available' => true,
    ]
);

$this->add_responsive_control(
    'section_style_each_item_row_gap',
    [
        'label' => esc_html__( 'Row gap (smallscreen)', 'productive-forms' ),
        'type' => \Elementor\Controls_Manager::SLIDER,
        'size_units' => [ 'rem', 'px' ],
        'range' => [
            'rem' => [
                'min' => 0,
                'max' => 50,
                'step' => 1,
            ],
            'px' => [
                'min' => 0,
                'max' => 1000,
                'step' => 10,
            ],
        ],
        'selectors' => [
            '{{WRAPPER}} .productiveminds_section.contact-us-page .productiveminds_double_grid' => 'row-gap: {{SIZE}}{{UNIT}}',
        ],
    ]
);

// End:: Content Title

$this->end_controls_section();
// End:: Styles