<?php



use Elementor\Widget_Base;
use Elementor\Controls_Manager;

if (!defined('ABSPATH')) exit; // Exit if accessed directly


class Iconboxfourthstkaveh extends Widget_Base{

  public function get_name(){
    return 'Iconboxfourthstkaveh';
  }

  public function get_title(){
    return esc_html__( 'Icon Box Style Four', 'kavehTheme' );
  }

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

  public function get_categories(){
    return ['kavehelements'];
  }

  protected function register_controls(){
    
    $this->start_controls_section(
        'contentIconboxfourthstkaveh',
        [
              'label' => esc_html__( 'Element Content', 'kavehTheme' ),
              'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
        ]
      );
      $this->add_control(
        'iconbuttIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Icon', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::ICONS,
          'skin' => 'inline',

          'exclude_inline_options' => [ 'svg' ],
          'default' => [
            'value' => 'icon-direct',
          ],
        ]
      );
      $this->add_control(
        'tagtitleoneIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Main Title Tag', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SELECT,
          'default' => 'div',
          'options' => [
            'H1'  => esc_html__( 'H1', 'kavehTheme' ),
            'H2' => esc_html__( 'H2', 'kavehTheme' ),
            'H3' => esc_html__( 'H3', 'kavehTheme' ),
            'H4' => esc_html__( 'H4', 'kavehTheme' ),
            'H5' => esc_html__( 'H5', 'kavehTheme' ),
            'H6' => esc_html__( 'H6', 'kavehTheme' ),
            'p' => esc_html__( 'p', 'kavehTheme' ),
            'div' => esc_html__( 'div', 'kavehTheme' ),
            'span' => esc_html__( 'span', 'kavehTheme' ),
          ],
        ]
      );
      $this->add_control(
        'fwigti2Iconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Main Title', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXT,
          'default' => 'Headphone',
        ]
      );

      $this->add_control(
        'Numberbox2Iconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Box Count', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXT,
          'default' => '2554',
        ]
      );
      $this->add_control(
        'linkIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Link', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::TEXT,
          'default' => '#',
        ]
      );



       $this->end_controls_section();

       
       $this->start_controls_section(
        'stylet_Iconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Style', 'kavehTheme' ),
          'tab' => \Elementor\Controls_Manager::TAB_STYLE,
        ]
      );
      $this->add_control(
        'iconsizenchbIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Icon Size', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 200,
              'step' => 1,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .category-box-tech > i::before' => 'font-size: {{SIZE}}{{UNIT}};',
          ],
        ]
      );
      $this->add_control(
        'textbutton1colorIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Icon Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .category-box-tech > i::before' => 'color: {{VALUE}} !important',
          ],
        ]
      ); 
      $this->add_control(
        'catimg1widthIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Icon Background Width', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 300,
              'step' => 1,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .category-box-tech > i' => 'width: {{SIZE}}{{UNIT}};',
          ],
        ]
      );
      $this->add_control(
        'catimg1height2Iconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Icon Background Height', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::SLIDER,
          'size_units' => [ 'px' ],
          'range' => [
            'px' => [
              'min' => 0,
              'max' => 300,
              'step' => 1,
            ],
          ],
          'selectors' => [
            '{{WRAPPER}} .category-box-tech > i' => 'height: {{SIZE}}{{UNIT}};',
          ],
        ]
      );
      $this->add_control(
        'textbg1colorIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Icon Background Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .category-box-tech > i' => 'background-color:{{VALUE}}',
          ],
        ]
      ); 
      $this->add_control(
        'buttonradiusIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Icon Background Border Radius', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .category-box-tech > i' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
          ]
        ]
      );
      $this->add_control(
        'bordercolor21Iconboxfourthstkaveh',
        [
            'label' => esc_html__('Border Color', 'kavehTheme'),
            'type' => \Elementor\Controls_Manager::COLOR,
            'selectors' => [
                '{{WRAPPER}} .category-box-tech::before' => 'background: {{VALUE}} !important;',
            ],
        ]
    );

    $this->add_control(
      'backgroundHoverconboxfourthstkaveh',
      [
          'label' => esc_html__('Box Background Hover Color', 'kavehTheme'),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
              '{{WRAPPER}} .category-box-tech:hover' => 'background: {{VALUE}} !important;',
          ],
      ]
  );

  $this->add_control(
    'backgroundboxallconboxfourthstkaveh',
    [
        'label' => esc_html__('Box Background Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .category-box-tech' => 'background-color: {{VALUE}} !important;',
        ],
    ]
);

  $this->add_control(
    'borderbackgroundHoverconboxfourthstkaveh',
    [
        'label' => esc_html__('Box Border Hover Color', 'kavehTheme'),
        'type' => \Elementor\Controls_Manager::COLOR,
        'selectors' => [
            '{{WRAPPER}} .category-box-tech:hover' => 'border-color: {{VALUE}} !important;',
        ],
    ]
);


      $this->add_control(
        'hr1Iconboxfourthstkaveh',
        [
          'type' => \Elementor\Controls_Manager::DIVIDER,
        ]
      );
      


      $this->add_control(
        'ftextcolortIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Subtitle Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .category-box-tech .title span' => 'color: {{VALUE}}',
          ],
        ]
      );
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'ftitletyt_Iconboxfourthstkaveh',
          'label' => esc_html__( 'Subtitle Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .category-box-tech .title span',
        ]
      );
      $this->add_control(
        'numbercolortbolIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Number Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .category-box-tech .count ' => 'color: {{VALUE}}',
          ],
        ]
      );

      
      $this->add_group_control(
        \Elementor\Group_Control_Typography::get_type(),
        [
          'name' => 'numbertypobtitletyt_Iconboxfourthstkaveh',
          'label' => esc_html__( 'Number Typography', 'kavehTheme' ),
          'selector' => '{{WRAPPER}} .category-box-tech .count',
        ]
      );
      $this->add_control(
        'textcolortIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Number Box Color', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::COLOR,
          'selectors' => [
            '{{WRAPPER}} .category-box-tech .count' => 'background-color: {{VALUE}}',
          ],
        ]
      );

      $this->add_control(
        'allboxradiusIconboxfourthstkaveh',
        [
          'label' => esc_html__( 'Box Border Radius', 'kavehTheme' ),
          'type' => \Elementor\Controls_Manager::DIMENSIONS,
          'size_units' => [ 'px' ],
          'selectors' => [
            '{{WRAPPER}} .category-box-tech' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
          ]
        ]
      );



      $this->end_controls_section();
        }
 

        protected function render(){
          $settings = $this->get_settings_for_display();
          $clsid = $this->get_id();
          ?>
          <a href="<?php echo esc_url( $settings['linkIconboxfourthstkaveh']); ?>" class="category-box-tech d-flex align-items-center position-relative h-100">
              <i class="<?php echo esc_attr($settings['iconbuttIconboxfourthstkaveh']['value']); ?> d-flex align-items-center justify-content-center flex-fill flex-grow-0 flex-shrink-0"></i>
              <span class="title d-flex align-items-center">
                  <?php 
                  $tag = isset($settings['tagtitleoneIconboxfourthstkaveh']) ? $settings['tagtitleoneIconboxfourthstkaveh'] : 'h4'; 
                  ?>
                  <<?php echo $tag; ?> class="overflow-hidden">
                      <?php echo esc_html( $settings['fwigti2Iconboxfourthstkaveh']); ?>
                  </<?php echo $tag; ?>>
                  <i class="icon-angle-down-2 lh-1 d-none d-md-block"></i>
              </span>
              <span class="count ms-auto flex-fill flex-grow-0 flex-shrink-0 d-none d-md-block"><?php echo esc_html($settings['Numberbox2Iconboxfourthstkaveh']); ?></span>
          </a>
          <?php
      }
    }


