<?php
$ft_radius_css =
$border_color_type = '';
$atts = vc_map_get_attributes( $this->getShortcode(), $atts );
extract( $atts );

$class_prefix = '3d' == $style ? 'tr' : '';
$smooth_effect = empty( $smooth ) ? '0' : '1';
$border_css_front = 'border:' . $border_size_front . ' ' . $border_style_front . ' ';
$border_css_back = 'border:' . $border_size_back . ' ' . $border_style_back . ' ';
$icon = $this->getIconClass( $atts );
$radius_css = 'rounded' == $shape ? 'border-radius:' . $radius : '';
$min_height = 'mini' == $type ? '150px' : '300px';

switch ( $border_color_front ) {
case 'color' :
  $border_color = 'border-color:' . $border_one_color_front;
  break;
case 'gradient':
  $border_color = 'border-image:linear-gradient(to bottom right,' . $border_gradient_start . ' 0%,' . $border_gradient_end . ' 100%);
                   webkit-border-image:-webkit-linear-gradient(to bottom right, ' . $border_gradient_start . ' 0%, ' . $border_gradient_end . ' 100%);
                   border-image-slice: 1';
  break;
default :
  $border_color = '';
  break;
}

switch ( $border_color_back ) {
case 'color' :
  $back_border_color = 'border-color:' . $border_one_color_back;
  break;
case 'gradient':
  $back_border_color = 'border-image:linear-gradient(to bottom right,' . $border_gradient_start_back . ' 0%,' . $border_gradient_end_back . ' 100%);
                   webkit-border-image:-webkit-linear-gradient(to bottom right, ' . $border_gradient_start_back . ' 0%, ' . $border_gradient_end_back . ' 100%);
                   border-image-slice: 1';
  break;
default :
  $back_border_color = '';
  break;
}

switch ( $bg_type_front ) {
case 'image':
  $bg_css_front = 'background-image:url(' . $bg_url_front . ');';
  break;
case 'color':
  $bg_css_front = 'background-color:' . $bg_color_front . ';';
  break;
case 'gradient':
  $bg_css_front = 'background:linear-gradient(to bottom right,' . $bg_gradient_start_front . ',' . $bg_gradient_end_front . ');';
  break;
default:
  $bg_css_front = '';
  break;
}

switch ( $bg_type_back ) {
case 'image':
  $bg_css_back = 'background-image:url(' . $bg_url_back . ')';
  break;
case 'color':
  $bg_css_back = 'background-color:' . $bg_color_back;
  break;
case 'gradient':
  $bg_css_back = 'background:linear-gradient(to bottom right,' . $bg_gradient_start_back . ',' . $bg_gradient_end_back . ')';
  break;
default:
  $bg_css_back = '';
  break;
}

switch ( $ft_bg_type ) {
case 'color':
  $feature_bg_css = 'background-color:' . $ft_bg_color;
  break;
case 'gradient':
  $feature_bg_css = 'background:linear-gradient(to bottom right,' . $ft_bg_gradient_start . ',' . $ft_bg_gradient_end . ')';
  break;
default:
  $feature_bg_css = '';
  break;
}

switch ( $icon_bg_type ) {
case 'color':
  $icon_bg_css = 'color:' . $icon_bg_color;
  break;
case 'gradient':
  $icon_bg_css = 'background: linear-gradient(to bottom right,' . $icon_bg_gradient_start . ',' . $icon_bg_gradient_end . ');
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent';
  break;
default:
  $icon_bg_css = '';
  break;
}

switch ( $action_bg_type ) {
case 'color':
  $action_bg_css = 'background-color:' . $action_color;
  break;
case 'gradient':
  $action_bg_css = 'background-color: ' . $action_gradient_start . ';
                    background: linear-gradient(to bottom right, ' . $action_gradient_start . ',' . $action_gradient_end . ')';
  break;
default:
  $action_bg_css = '';
  break;
}

// @codingStandardsIgnoreStart
?>

<div class="vckit-<?php echo $class_prefix ?>cflp-container vckit-theelement" data-layout="<?php echo $direction_2d ?>" data-smootheffect="<?php echo $smooth_effect ?>" style="min-height:<?php echo $min_height ?>;">
  <div class="vckit-<?php echo $class_prefix ?>cflp-card">
    <div class="vckit-<?php echo $class_prefix ?>cflp-front vckit-<?php echo $class_prefix ?>cflp-figure vckit-element-back-overlay vckit-<?php echo $class_prefix ?>cflp-front-bg-<?php echo $bg_type_front ?><?php echo $border_color_type ?>" style="<?php echo $bg_css_front ?>;<?php echo $border_css_front ?>;<?php echo $border_color ?>;<?php echo $radius_css ?>;min-height: <?php echo $min_height ?>;">
      <div class="vckit-<?php echo $class_prefix ?>cflp-insider">
        <div class="vckit-<?php echo $class_prefix ?>cflp-icon">
          <?php if ( $ft_type == 'icon' ) { ?>
          <div class="<?php echo $class_prefix ?>cflp-iconar vckit-<?php echo $class_prefix ?>cflp-feature-bg-<?php echo $ft_bg_type ?>" style="font-size:<?php echo $icon_size ?>; width:<?php echo $ft_width ?>; height:<?php echo $ft_height ?>; line-height:<?php echo $ft_height ?>;<?php echo $ft_radius_css ?>;<?php echo $feature_bg_css ?>;border-radius: 500px">
            <i class="<?php echo $icon ?> <?php echo $icon_bg_color ?>" style="<?php echo $icon_bg_css?>"></i>
          </div>
          <?php } else { ?>
          <img src="<?php echo $ft_url ?>" width="<?php echo $ft_width ?>" height="<?php echo $ft_height ?>">
          <?php } ?>
        </div>
        <div class="vckit-<?php echo $class_prefix ?>cflp-front-title vckit-shortcode-element" style="font-size:<?php echo $title_size_front ?>;color:<?php echo $title_color_front ?>"><?php echo $title_front ?></div>
        <?php if ( $type == 'normal' ) { ?>
        <div class="vckit-<?php echo $class_prefix ?>cflp-front-subtitle vckit-shortcode-element" style="font-size:<?php echo $subtitle_size_front ?>;color:<?php echo $subtitle_color_front ?>;"><?php echo $subtitle_front ?></div>
        <?php } ?>
      </div>
    </div>
    <div class="vckit-<?php echo $class_prefix ?>cflp-back vckit-<?php echo $class_prefix ?>cflp-figure vckit-element-back-overlay vckit-<?php echo $class_prefix ?>cflp-back-bg-<?php echo $bg_type_back ?><?php echo $border_color_back ?>" style="<?php echo $bg_css_back ?>;<?php echo $border_css_back ?>;<?php echo $back_border_color ?>;<?php echo $radius_css ?>;min-height: <?php echo $min_height ?>;">
      <div class="vckit-<?php echo $class_prefix ?>cflp-insider">
        <div class="vckit-<?php echo $class_prefix ?>cflp-back-title vckit-shortcode-element" style="font-size:<?php echo $title_size_back ?>;color:<?php echo $title_color_back ?>;"><?php echo $title_back ?></div>
        <div class="vckit-<?php echo $class_prefix ?>cflp-back-subtitle vckit-shortcode-element" style="font-size:<?php echo $subtitle_size_back ?>;color:<?php echo $subtitle_color_back ?>;"><?php echo $subtitle_back ?></div>
        <?php if ( $type == 'normal' ) { ?>
        <div class="vckit-<?php echo $class_prefix ?>cflp-action-wrapper">
          <a href="<?php echo $action_url ?>" target=" _blank" style="<?php echo $action_bg_css ?>" class="vckit-<?php echo $class_prefix ?>cflp-action vckit-<?php echo $class_prefix ?>cflp-action-bg-<?php echo $action_bg_type ?> vckit-shortcode-element"><?php echo $action_name ?></a>
        </div>
        <?php } // @codingStandardsIgnoreEnd ?>
      </div>
    </div>
  </div>
</div>
