<?php
/**
 * OrokuBlocks Item Review
 * 
 * @package OrokuBlocks
 * @author OrokuBlocks (https://orokublocks.com/)
 * 
 * @since 1.0.0
 * 
 */

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

if ( ! class_exists( 'OrokuBlocks_ItemReview_Widget' ) ) {
  class OrokuBlocks_ItemReview_Widget extends OrokuBlocks_Widget {
    /**
     * Initialize property values
     * 
     * @since 1.0.0
     * 
     * @access protected
     */
    protected function initialize() {
      $this->widget_id = 'item_review';

      $this->defaults = [
        'theme'                                 => 'light',
        'light_primary_color'                   => '#8c56ff',
        'light_background_color'                => '#ffffff',
        'light_background_alt_color'            => '#f7f7f9',
        'light_line_color'                      => '#c7cdd6',
        'light_text_color'                      => '#22212c',
        'dark_primary_color'                    => '#09dfb9',
        'dark_background_color'                 => '#2b2a3b',
        'dark_background_alt_color'             => '#21202e',
        'dark_line_color'                       => '#38374b',
        'dark_text_color'                       => '#ffffff',
        'status_tag_enabled_icon_color'         => '#00d4cf',
        'status_tag_enabled_background_color'   => '#ffffff',
        'status_tag_disabled_icon_color'        => '#ff5775',
        'status_tag_disabled_background_color'  => '#ffffff',
        'progress_bar_color'                    => '#1200e3',
        'progress_bar_underline_color'          => '#c7cdd6',
        'progress_bar_gradient'                 => true,
        'progress_bar_gradient_start_color'     => '#1200e3',
        'progress_bar_gradient_end_color'       => '#00ceff',
        'rating_color'                          => '#8c56ff',
        'rating_underline_color'                => '#d9d9d9',
        'use_plugin_font'                       => true,
        'font_scale'                            => 1,
        'card_border_radius'                    => 24,
        'card_image_border_radius'              => 14,
        'width'                                 => 0,
        'image_url'                             => '',
        'avatar_url'                            => '',
        'title'                                 => 'Supersonic Hosting',
        'title_link'                            => '',
        'subtitle'                              => 'Web Hosting Service',
        'user_text'                             => 'By',
        'user_name'                             => 'OrokuBlocks',
        'user_link'                             => '#',
        'timestamp'                             => 'September 8th, 2025',
        'score_value'                           => 4.5,
        'score_max_value'                       => 5,
        'decimal_points'                        => 1,
        'progress_bar_width'                    => 276,
        'progress_bar_breakpoint_width'         => 680,
        'progress_bar_split_parts'              => 1,
        'animate_on_scroll'                     => true,
        'score_separator'                       => '/',
        'score_text'                            => 'RATING',
        'summary'                               => 'Perfect service for beginners and people who are looking for cheap hosting.',
        'pros_icon'                             => '',
        'pros_status_tag_style'                 => 'outline',
        'pros_title'                            => 'PROS',
        'pros'                                  => [
          [
            'text'  => 'Cheap Entry Level'
          ],
          [
            'text'  => 'Cancel Anytime'
          ],
          [
            'text'  => '14 Days Free Trial'
          ]
        ],
        'cons_icon'                             => '',
        'cons_status_tag_style'                 => 'outline',
        'cons_title'                            => 'CONS',
        'cons'                                  => [
          [
            'text'  => 'Lacks Some Integrations'
          ],
          [
            'text'  => 'Small Dashboard'
          ]
        ],
        'progress_bars'                         => [
          [
            'text'      => 'GAMEPAD DESIGN',
            'value'     => 9,
            'max_value' => 10
          ],
          [
            'text'      => 'RESPONSIVENESS',
            'value'     => 7,
            'max_value' => 10
          ],
          [
            'text'      => 'PRICING POINT',
            'value'     => 8,
            'max_value' => 10
          ]
        ],
        'button_text'                           => 'Read Full Review',
        'button_link'                           => '#',
        'button1_text'                          => 'Get it on WallMarket',
        'button1_link'                          => '#',
        'button2_text'                          => 'Get it on Best Buyer',
        'button2_link'                          => '#',
        'tags'                                  => [
          [
            'text'  => 'LAPTOPS',
            'link'  => '#',
            'color' => '#8c56ff'
          ],
          [
            'text'  => 'GAMING',
            'link'  => '#',
            'color' => '#ff56d0'
          ]
        ],
        'footer_left_title'                     => 'SHARE:',
        'share_facebook_enabled'                => true,
        'share_x_enabled'                       => true,
        'shortcode'                             => false
      ];

      $this->control_modules = [
        'content' => [],
        'media_content' => [ 'image_url' ],
        'user_content' => [ 'avatar_url', 'user_text', 'user_name', 'user_link' ],
        'tags_content' => [],
        'meta_content' => [ 'timestamp' ],
        'score_rating_content' => [ 'score_value', 'decimal_points', 'score_separator', 'score_text' ],
        'pros_cons_content' => [],
        'progress_bars_content' => [],
        'button_content' => [],
        'buttons_content' => [],
        'share_actions' => [],
        'theme' => [],
        'theme_light' => [],
        'theme_dark' => [],
        'font' => [],
        'card' => [],
        'media_style' => [],
        'rating_style' => [],
        'progress_bars_style' => [],
        'pros_cons_style' => []
      ];

      $this->control_section_conditions = [
        'content' => [
          'controls'  => [
            'subtitle'  => [
              'version'  =>  [ 'v1', 'v2', 'v4', 'v5' ]
            ]
          ]
        ],
        'user_content' => [
          'condition' => [
            'version'  => [ 'v3' ]
          ]
        ],
        'tags_content' => [
          'condition' => [
            'version'  => [ 'v5' ]
          ]
        ],
        'meta_content' => [
          'condition' => [
            'version'  => [ 'v3' ]
          ]
        ],
        'score_rating_content' => [
          'controls'  => [
            'score_text'  => [
              'version'  => [ 'v2' ]
            ],
            'score_separator'  => [
              'version'  => [ 'v1', 'v2', 'v4', 'v5' ]
            ],
            'decimal_points'  => [
              'version'  => [ 'v4', 'v5' ]
            ]
          ]
        ],
        'pros_cons_content' => [
          'condition' => [
            'version'  => [ 'v1', 'v2', 'v3', 'v5' ]
          ]
        ],
        'progress_bars_content' => [
          'condition' => [
            'version'  => [ 'v4', 'v5' ]
          ]
        ],
        'button_content' => [
          'condition' => [
            'version'  => [ 'v2', 'v3', 'v4' ]
          ]
        ],
        'buttons_content' => [
          'condition' => [
            'version'  => [ 'v5' ]
          ]
        ],
        'share_actions' => [
          'controls'  => [
            'footer_left_title'  => [
              'version'  =>  [ 'v1', 'v5' ]
            ]
          ]
        ],
        'progress_bars_style' => [
          'condition' => [
            'version'  => [ 'v4', 'v5' ]
          ]
        ],
        'pros_cons_style' => [
          'condition' => [
            'version'  => [ 'v1', 'v2', 'v3', 'v5' ]
          ]
        ]
      ];
    }
  }
}