<?php declare(strict_types=1);

namespace TotalThemeCore\Vcex;

defined( 'ABSPATH' ) || exit;

/**
 * Returns a description for a param type.
 */
class Param_Description {

	/**
	 * Return description.
	 */
	public function get( string $type ): string {
		if ( method_exists( $this, $type ) ) {
			return $this->$type();
		}
		return '';
	}

	/**
	 * Card select
	 */
	protected function card_select(): string {
		return esc_html__( 'Select your card style. Note: Not all settings are used for every card style', 'total-theme-core' ) . '<br>' . sprintf( esc_html__( '%sPreview card styles%s', 'total-theme-core' ), '<a href="https://totalwptheme.com/cards/" target="_blank" rel="noopener noreferrer">', '</a>' );
	}

	/**
	 * Advanced Query.
	 */
	protected function advanced_query(): string {
		return sprintf( esc_html__( 'Build a query according to the WordPress Codex in string format or enter a custom callback function name that will return an array of query arguments. %sview docs%s', 'total-theme-core' ), '<a href="https://totalwptheme.com/docs/advanced-query-setting/" target="_blank" rel="noopener noreferrer">', '</a>' );
	}

	/**
	 * Header Style.
	 */
	protected function header_style(): string {
		return sprintf( esc_html__( 'Select your custom heading style. You can select your global style in %sthe Customizer%s.', 'total-theme-core' ), '<a href="' . esc_url( admin_url( '/customize.php?autofocus[section]=wpex_theme_heading' ) ) . '" target="_blank" rel="noopener noreferrer">', '</a>' );
	}

	/**
	 * Unique ID.
	 */
	protected function unique_id(): string {
		return sprintf( esc_html__( 'Enter element ID (Note: make sure it is unique and valid according to %sw3c specification%s).', 'total-theme-core' ), '<a href="https://www.w3schools.com/tags/att_global_id.asp" target="_blank" rel="noopener noreferrer">', '</a>' );
	}

	/**
	 * Extra classname.
	 */
	protected function el_class(): string {
		return sprintf( esc_html__( 'Enter a classname to target this element with custom CSS or multiple classnames separated by an empty space. You may use theme %sCSS framework%s classes, however some may not work if they are being overwritten by the element.', 'total-theme-core' ), '<a href="https://totalwptheme.com/css-framework/" target="_blank" rel="noopener noreferrer">', '</a>' );
	}

	/**
	 * Text HTML
	 */
	protected function text_html(): string {
		return esc_html__( 'Allowed:', 'total-theme-core' ) . ' ' . esc_html__( 'text', 'total-theme-core' ) . ', ' . esc_html__( 'shortcodes', 'total-theme-core' ) . ', ' . $this->allowed_dynamic_vars() . ', HTML';
	}

	/**
	 * Text.
	 */
	protected function text(): string {
		return esc_html__( 'Allowed:', 'total-theme-core' ) . ' ' . esc_html__( 'text', 'total-theme-core' ) . ', ' . esc_html__( 'shortcodes', 'total-theme-core' ) . ', ' . $this->allowed_dynamic_vars();
	}

	/**
	 * Link.
	 */
	protected function link(): string {
		return esc_html__( 'Enter your custom link url, lightbox url or local/toggle element ID (including a # at the front).', 'total-theme-core' ) . '<br>' . $this->text();
	}

	/**
	 * PX.
	 */
	protected function px(): string {
		return esc_html__( 'Value in pixels.', 'total-theme-core' );
	}

	/**
	 * Border Radius.
	 */
	protected function border_radius(): string {
		return sprintf(
			/* translators: 1: allowed CSS units. */
			esc_html__( 'Numbers are treated as pixels. Any input is allowed, including CSS units (%1$s). You can also use shorthand format: top right bottom left.', 'total-theme-core' ),
			'px, rem, %'
		);
	}

	/**
	 * Width and Height.
	 */
	protected function width(): string {
		return sprintf(
			/* translators: 1: CSS units 2: CSS keywords 3: CSS functions. */
			esc_html__( 'Numbers are treated as pixels. Any input is allowed, including CSS units (%1$s), CSS keywords (%2$s), or CSS functions (%3$s).', 'total-theme-core' ),
			'px, em, rem, vw, vh, vmin, vmax',
			'max-content, min-content, fit-content',
			'calc, var, clamp, min, max'
		);
	}

	/**
	 * Height.
	 */
	protected function height(): string {
		return sprintf(
			/* translators: 1: CSS units, 2: CSS keywords, 3: CSS functions. */
			esc_html__( 'Numbers are treated as pixels. Any input is allowed, including CSS units (%1$s), CSS keywords (%2$s), or CSS functions (%3$s).', 'total-theme-core' ),
			'px, em, rem, vw, vh, vmin, vmax',
			'max-content, min-content, fit-content',
			'calc, var, clamp, min, max'
		);
	}

	/**
	 * Border.
	 */
	protected function border(): string {
		return esc_html__( 'Please use the shorthand format: width style color. Enter a single value (such as 4px) to modify the border width only.', 'total-theme-core' );
	}

	/**
	 * Border Width.
	 */
	protected function border_width(): string {
		return sprintf(
			/* translators: 1: CSS units */
			esc_html__( 'Numbers are treated as pixels. Any input is allowed, including CSS units (%1$s). You can also use shorthand format: top right bottom left.', 'total-theme-core' ),
			'px, rem, em, thin, medium, thick'
		);
	}

	/**
	 * CSS value.
	 */
	protected function css_value(): string {
		return sprintf(
			/* translators: 1: CSS units 2: CSS functions */
			esc_html__( 'Numbers are treated as pixels. Any input is allowed, including CSS units (%1$s) or CSS functions (%2$s).', 'total-theme-core' ),
			'px, em, rem, vw, vh, vmin, vmax',
			'calc, var, clamp, min, max'
		);
	}

	/**
	 * Dimensions.
	 */
	protected function dimensions(): string {
		return $this->css_value();
	}

	/**
	 * Padding.
	 */
	protected function padding(): string {
		return $this->css_value();
	}

	/**
	 * Margin.
	 */
	protected function margin(): string {
		return $this->css_value();
	}

	/**
	 * Gap.
	 */
	protected function gap(): string {
		return $this->css_value();
	}

	/**
	 * Margin Shorthand.
	 */
	protected function margin_shorthand(): string {
		return esc_html__( 'Please use the following format: top right bottom left.', 'total-theme-core' );
	}

	/**
	 * Opacity.
	 */
	protected function opacity(): string {
		return esc_html__( 'Enter a decimal or percentage value.', 'total-theme-core' );
	}

	/**
	 * Milliseconds.
	 */
	protected function ms(): string {
		return esc_html__( 'Enter a value in milliseconds.', 'total-theme-core' );
	}

	/**
	 * Font Size.
	 */
	protected function font_size(): string {
		return sprintf(
			/* translators: 1: predefined font size keywords, 2: allowed CSS units, 3: allowed CSS functions. */
			esc_html__( 'Numbers are treated as pixels. You may also use predefined keywords (%1$s), CSS units (%2$s), or CSS functions (%3$s). Invalid values will be converted to pixels.', 'total-theme-core' ),
			'xs, sm, md, lg, base, xl, 2xl, 3xl, 4xl, 5xl',
			'px, em, rem, vw, vh, vmin, vmax, %',
			'calc, var, clamp, min, max'
		);
	}

	/**
	 * Allowed Dynamic Vars.
	 */
	protected function allowed_dynamic_vars(): string {
		return '<a href="https://totalwptheme.com/docs/dynamic-variables/" target="_blank" rel="noopener noreferrer">' . esc_html__( 'dynamic variables', 'total-theme-core' ) . '</a>';
	}

	/**
	 * Text Balance.
	 */
	protected function text_balance(): string {
		return esc_html__( 'Text is wrapped in a way that best balances the number of characters on each line, enhancing layout quality and legibility. Ideal for lengthy headings that extend across multiple lines.', 'total-theme-core' );
	}

	/**
	 * Rotate.
	 */
	protected function rotate(): string {
		return esc_html__( 'Set the rotation angle of this element. Enter any valid CSS angle value, e.g., 10deg, -15deg, or 0.5turn. Positive values rotate clockwise, negative values rotate counterclockwise.', 'total-theme-core' );
	}

}
