<?php
/**
 * First Configuration Template for Pixelio / Rivio
 *
 * This file displays the multi-step onboarding process for users
 * after installing the plugin. It includes domain verification,
 * configuration mode selection, email generation method, and final settings.
 *
 * PHP version 8.x
 *
 * @package   PixelioCartAbandonRecoveryMore
 * @author    Pixelio
 * @license   GPL-2.0-or-later
 * @link      https://www.pixelio.com/
 */
if ( ! defined( 'ABSPATH' ) ) exit;

use PixelioCartAbandonRecoveryMore\Admin\Views\Reusable\Pixelio_Cart_Abandon_Recovery_More_Admin_Loader_Spinner;
use PixelioCartAbandonRecoveryMore\Admin\Views\Reusable\Pixelio_Cart_Abandon_Recovery_More_Header;
use PixelioCartAbandonRecoveryMore\Admin\Views\Reusable\Pixelio_Cart_Abandon_Recovery_More_Progress_Bar;
use PixelioCartAbandonRecoveryMore\Admin\Wrapper\Pixelio_Cart_Abandon_Recovery_More_Wordpress_Wrapper;
use PixelioCartAbandonRecoveryMore\Includes\Utils\Pixelio_Cart_Abandon_Recovery_More_Util;
$pixelio_util = new Pixelio_Cart_Abandon_Recovery_More_Util(new Pixelio_Cart_Abandon_Recovery_More_Wordpress_Wrapper());
$pixelio_cart_abandon_recovery_more_header = new Pixelio_Cart_Abandon_Recovery_More_Header($pixelio_util);
$pixelio_cart_abandon_recovery_more_header->pixelio_cart_abandon_recovery_more_get_views();

?>

	<div class="pixelio-cart-abandon-recovery-more-first-config-placeholder">
		<a class="pixelio-cart-abandon-recovery-more-step-back"
		   href=""><?php esc_html_e( 'Back', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></a>
		<h1 class="pixelio-cart-abandon-recovery-more-main-title">
			<?php esc_html( 'Thank you for installing' ); ?>
			<span
				class="pixelio-cart-abandon-recovery-more-highlight"><?php esc_html_e( 'Rivio', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></span>
		</h1>
		<a class="pixelio-cart-abandon-recovery-more-step-next"
		   href=""><?php esc_html_e( 'Next', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></a>
	</div>

<?php
$pixelio_cart_abandon_recovery_more_progress = new Pixelio_Cart_Abandon_Recovery_More_Progress_Bar();
$pixelio_cart_abandon_recovery_more_progress->pixelio_cart_abandon_recovery_more_get_views( 4 );


$pixelio_cart_abandon_recovery_more_spinner = new Pixelio_Cart_Abandon_Recovery_More_Admin_Loader_Spinner(__('Your request is being processed. Please wait.','rivio-ai-cart-recovery-marketing-email-automation'));
$pixelio_cart_abandon_recovery_more_spinner->pixelio_cart_abandon_recovery_more_get_views( );
?>


	<div class="pixelio-cart-abandon-recovery-more-first-config">


		<div class="pixelio-cart-abandon-recovery-more-step-1" data-step-state="
		<?php
		if ( get_option( 'pixelio_api_key' ) ) {
			echo esc_attr(1);
		} else {
			echo esc_attr(0);
		}
		?>
		">
			<h2 class="pixelio-cart-abandon-recovery-more-domain-title">
				<?php esc_html_e( 'Vérification of your domain', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
			</h2>
			<p class="pixelio-cart-abandon-recovery-more-domain-subtitle">
				<?php esc_html_e( 'To generate your API key and for security reasons, we need to verify that you are the owner of this domain.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
			</p>
			<div class="pixelio-cart-abandon-recovery-more-domain-verification">

				<label for="pixelio_email">
					<?php esc_html_e( 'Email (Optional)', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
				</label>
				<p class="pixelio-cart-abandon-recovery-more-email-description"><?php esc_html_e( 'Used to link your beta benefits. Leave it empty if you are not a beta tester', 'rivio-ai-cart-recovery-marketing-email-automation' );?> </p>
				<input type="email" id="pixelio-cart-abandon-recovery-more-email" class="pixelio-cart-abandon-recovery-more-input-text"
					   placeholder="<?php esc_attr_e( 'you@example.com', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>"
					<?php
					if ( get_option( 'pixelio_api_key' ) ) {
						esc_attr_e( 'disabled', 'rivio-ai-cart-recovery-marketing-email-automation' );
					}
					?>
				/>

				<label for="pixelio_domain"><?php esc_html_e( 'Your current domain name*', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></label>
				<input type="text" id="pixelio-cart-abandon-recovery-more-domain" class="pixelio-cart-abandon-recovery-more-input-text"
					   placeholder="<?php
					   if ( get_option( 'pixelio_api_key' ) ) {
						   echo esc_attr( get_site_url() );
					   } else {
						   esc_attr_e( 'example.com', 'rivio-ai-cart-recovery-marketing-email-automation' );
					   }
					   ?>"
					<?php
					if ( get_option( 'pixelio_api_key' ) ) {
						esc_attr_e( 'disabled', 'rivio-ai-cart-recovery-marketing-email-automation' );
					}
					?>
				/>

				<button id="pixelio-cart-abandon-recovery-more-verify-domain"
						class="pixelio-cart-abandon-recovery-more-button pixelio-cart-abandon-recovery-more-button-primary"
					<?php
					if ( get_option( 'pixelio_api_key' ) ) {
						esc_attr_e( 'disabled', 'rivio-ai-cart-recovery-marketing-email-automation' );
					}
					?>
				>
					<?php esc_html_e( 'Verify domain and/or email', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
				</button>

				<div id="pixelio-cart-abandon-recovery-more-verification-result" style="margin-top:10px;">
					<?php
					if ( get_option( 'pixelio_api_key' ) ) {
						echo wp_kses('<span style="color:green;">' . esc_html__( 'Domain verified successfully and email linked!', 'rivio-ai-cart-recovery-marketing-email-automation' ) . '</span>',Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_cart_abandon_recovery_more_allowed_html);
					}
					?>
				</div>
			</div>

		</div>

		<div class="pixelio-cart-abandon-recovery-more-step-2 pixelio-cart-abandon-recovery-more-steps" data-step-state="0">
			<div class="pixelio-cart-abandon-recovery-more-subtitle-block">
				<h2 class="pixelio-cart-abandon-recovery-more-subtitle"><?php esc_html_e( 'Choose your configuration mode', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></h2>
				<p class="pixelio-cart-abandon-recovery-more-description"><?php esc_html_e( 'Select the mode that best suits your needs.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></p>
			</div>

			<!-- Cards -->
			<div class="pixelio-cart-abandon-recovery-more-cards-container">

				<!-- Débutant -->
				<div class="pixelio-cart-abandon-recovery-more-card pixelio-cart-abandon-recovery-more-card-without-next-button not-border-top " data-value="beginner">
				<span
					class="pixelio-cart-abandon-recovery-more-card-recommanded"><?php esc_html_e( 'Best conversion rate', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></span>
					<div class="pixelio-cart-abandon-recovery-more-card-content ">
						<h3><?php esc_html_e( 'Beginner', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></h3>
						<p><?php esc_html_e( 'Quick setup with essential settings enabled by default.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></p>
						<ul class="pixelio-cart-abandon-recovery-more-beginner-list">
							<li><img class="pixelio-cart-abandon-recovery-more-included" src="
							<?php

								echo esc_attr( Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_plugin_url . '/admin/assets/img/check.svg' );
								?>
							"
									 alt="included fonction"/><?php esc_attr_e( 'Predefined & ready-to-send emails.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
							</li>
							<li><img class="pixelio-cart-abandon-recovery-more-included" src="
							<?php

								echo esc_attr( Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_plugin_url . '/admin/assets/img/check.svg' );
								?>
							"
									 alt="included fonction"/><?php esc_attr_e( 'All settings that can increase your conversions will be enabled.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
							</li>
							<li><img class="pixelio-cart-abandon-recovery-more-included"
									 src="<?php echo esc_attr( Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_plugin_url . '/admin/assets/img/check.svg' ); ?>"
									 alt="included fonction"/><?php esc_attr_e( 'Advanced personalization is enabled by default if your plan allows it.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
							</li>

						</ul>
					</div>

				</div>


				<!-- Intermédiaire -->
				<div class="pixelio-cart-abandon-recovery-more-card pixelio-cart-abandon-recovery-more-card-without-next-button " data-value="intermediate">
					<div class="pixelio-cart-abandon-recovery-more-card-content">
						<h3><?php esc_attr_e( 'Intermediate', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></h3>
						<p><?php esc_attr_e( 'A good balance between simplicity and customization.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></p>
						<ul class="pixelio-cart-abandon-recovery-more-beginner-list">
							<li><img class="pixelio-cart-abandon-recovery-more-included" src="
							<?php

								echo esc_attr( Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_plugin_url . '/admin/assets/img/check.svg' );
								?>
							"
									 alt="included fonction"/><?php esc_attr_e( 'All settings that can increase your conversions will be enabled.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
							</li>
							<li><img class="pixelio-cart-abandon-recovery-more-included"
									 src="<?php echo esc_attr( Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_plugin_url . '/admin/assets/img/check.svg' ); ?>"
									 alt="included fonction"/><?php esc_attr_e( 'Advanced customization enabled by default if your plan allows it.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
							</li>
							<li><img class="pixelio-cart-abandon-recovery-more-included" src="
							<?php

								echo esc_attr( Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_plugin_url . '/admin/assets/img/remove.svg' );
								?>
							"
									 alt="included fonction"/><?php esc_attr_e( 'Non-predefined emails.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
							</li>


						</ul>
					</div>

				</div>

				<!-- Avancé -->
				<div class="pixelio-cart-abandon-recovery-more-card pixelio-cart-abandon-recovery-more-card-without-next-button" data-value="advanced">
					<span
						class="pixelio-cart-abandon-recovery-more-card-not-recommanded"><?php esc_attr_e( 'Low conversion rate', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></span>
					<div class="pixelio-cart-abandon-recovery-more-card-content">
						<h3><?php esc_attr_e( 'Advanced', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></h3>
						<p><?php esc_attr_e( 'Full control over configuration and features.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></p>
						<ul class="pixelio-cart-abandon-recovery-more-beginner-list">

							<li><img class="pixelio-cart-abandon-recovery-more-included"
									 src="<?php echo esc_attr( Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_plugin_url . '/admin/assets/img/check.svg' ); ?>"
									 alt="included fonction"/><?php esc_attr_e( 'Large choice of settings.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
							</li>
							<li><img class="pixelio-cart-abandon-recovery-more-included" src="
							<?php

								echo esc_attr( Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_plugin_url . '/admin/assets/img/remove.svg' );
								?>
							"
									 alt="included fonction"/><?php esc_attr_e( 'Non-predefined emails.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
							</li>
							<li><img class="pixelio-cart-abandon-recovery-more-included" src="
							<?php

								echo esc_attr( Pixelio_Cart_Abandon_Recovery_More_Util::$pixelio_plugin_url . '/admin/assets/img/remove.svg' );
								?>
							"
									 alt="included fonction"/><?php esc_attr_e( 'No option is enabled by default.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
							</li>
						</ul>
					</div>

				</div>

			</div>
		</div>
		<div class="pixelio-cart-abandon-recovery-more-card pixelio-cart-abandon-recovery-more-step-3 pixelio-cart-abandon-recovery-more-card-vertical pixelio-cart-abandon-recovery-more-steps" data-step-state="0">
			<h3>
				<?php
				esc_attr_e( 'Choose your email generation method', 'rivio-ai-cart-recovery-marketing-email-automation' );
				?>
			</h3>
			<p><?php esc_attr_e( 'Select how you want your emails to be created  manually, or using AI—for abandoned carts and review requests.', 'rivio-ai-cart-recovery-marketing-email-automation' );?></p>
			<div class="pixelio-cart-abandon-recovery-more-email-choice-tags">
							<span class="pixelio-cart-abandon-recovery-more-tag"
								  data-mode="free"><?php esc_attr_e( '4 personalized automation generated by AI', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></span>


				<span class="pixelio-cart-abandon-recovery-more-tag pixelio-cart-abandon-recovery-more-not-border-top "
					  data-mode="manual">
				<span
					class="pixelio-cart-abandon-recovery-more-card-not-recommanded"><?php esc_attr_e( 'Low conversion rate', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></span>
				<?php esc_attr_e( 'Create emails manually', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></span>

			</div>

			<p class="pixelio-cart-abandon-recovery-more-free-description pixelio-cart-abandon-recovery-more-hide-it pixelio-cart-abandon-recovery-more-generation-method-description">
				<?php esc_html_e( 'Generate AI-powered abandoned cart emails. Personalized messages can increase recovery rates by up to 15% and save you time', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
			</p>
			<p class="pixelio-cart-abandon-recovery-more-manual-description pixelio-cart-abandon-recovery-more-hide-it pixelio-cart-abandon-recovery-more-generation-method-description">
				<?php esc_html_e( 'Create your own emails/scenario manually. This gives you full control, but may be less effective than AI-generated emails. Recommended for users familiar with email marketing.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></p>




		</div>


		<div class="pixelio-cart-abandon-recovery-more-card pixelio-cart-abandon-recovery-more-step-4 pixelio-cart-abandon-recovery-more-steps" data-step-state="0">
			<div class="pixelio-cart-abandon-recovery-more-card-content">
				<h3><?php esc_attr_e( 'Last step', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></h3>


				<div class="pixelio-cart-abandon-recovery-more-pixelio-shop-type-container">
					<label for="pixelio_shop_type"
						   class="pixelio-cart-abandon-recovery-more-shop-type-label"><?php esc_html_e( 'What are you selling ? - We will use that to personalize more the email your client will receive', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></label>
					<select id="pixelio-cart-abandon-recovery-more-pixelio-shop-type">
						<option value=""><?php esc_html_e( 'Select your shop type', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="clothing"><?php esc_html_e( 'Clothing & Accessories', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="electronics"><?php esc_html_e( 'Electronics', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="home_garden"><?php esc_html_e( 'Home & Garden', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="beauty"><?php esc_html_e( 'Beauty & Cosmetics', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="food_drink"><?php esc_html_e( 'Food & Drinks', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="sports"><?php esc_html_e( 'Sports & Outdoors', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="toys"><?php esc_html_e( 'Toys & Games', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="jewelry"><?php esc_html_e( 'Jewelry & Watches', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="books"><?php esc_html_e( 'Books & Media', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="pets"><?php esc_attr_e( 'Pet Supplies', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="automotive"><?php esc_attr_e( 'Automotive', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="health"><?php esc_attr_e( 'Health Products', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="digital"><?php esc_attr_e( 'Digital Goods', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="services"><?php esc_attr_e( 'Services', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
						<option value="other"><?php esc_attr_e( 'Other', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></option>
					</select>
				</div>
				<!-- Checkbox autorisation -->
				<div class="pixelio-cart-abandon-recovery-more-checkbox">
					<input type="checkbox" id="pixelio-cart-abandon-recovery-more-ue">
					<label for="pixelio-ue">
						<?php esc_attr_e( 'If you are located in Europe, please check this box so we can automatically apply GDPR-compliant settings, including showing the necessary consent checkboxes on popups and forms.', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
					</label>
				</div>


				<div class="pixelio-cart-abandon-recovery-more-checkbox">
					<input type="checkbox" id="pixelio-cart-abandon-recovery-more-term-of-use">
					<label for="pixelio-term-of-use">
						<?php esc_attr_e( "By checking this box, you confirm your agreement with Pixelio’s,",'rivio-ai-cart-recovery-marketing-email-automation');?> <a href='https://www.rivio.be/conditions-generales-dutilisations/'><?php  esc_attr_e("Terms of Use and consent to our processing",'rivio-ai-cart-recovery-marketing-email-automation' );?></a> <?php esc_attr_e(" of your data as described therein.", 'rivio-ai-cart-recovery-marketing-email-automation' ); ?>
					</label>
				</div>

				<button id="pixelio-cart-abandon-recovery-more-finish-config"
						class="pixelio-cart-abandon-recovery-more-finish-config-btn"><?php esc_attr_e( 'Finalize the configuration', 'rivio-ai-cart-recovery-marketing-email-automation' ); ?></button>
			</div>
		</div>
	</div>

<?php
