<?php
/**
 * Deactivation feedback modal template.
 *
 * This template displays a feedback modal when the user attempts to deactivate the plugin.
 *
 * @package Limb_Chatbot
 * @since 1.0.0
 *
 * @var array $reasons        Array of deactivation reasons.
 * @var array $localize_data  Localized data for JavaScript.
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>
<div id="lbaic-deactivation-modal">
	<div class="lbaic-deactivation-modal-overlay"></div>
	<div class="lbaic-deactivation-modal-content">
		<div class="lbaic-deactivation-header">
			<div class="lbaic-deactivation-header-title">
				<img src="<?php echo esc_url( Limb_Chatbot()->get_plugin_dir_url() . 'assets/resources/admin/page/settings/logo-mini.svg' ); ?>" alt="Limb Chatbot" class="lbaic-logo-mini">
				<h2>
					<?php esc_html_e( 'Quick Feedback', 'limb-chatbot' ); ?>
				</h2>
			</div>
			<button type="button" class="lbaic-deactivation-modal-close" aria-label="<?php esc_attr_e( 'Close', 'limb-chatbot' ); ?>">
                <svg viewBox="0 0 24 24" id="lbaic-settings-close">
                    <path d="M5 17.59L6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59z"></path>
                </svg>
            </button>
		</div>
		<p>
			<?php esc_html_e( 'If you have a moment, please let us know why you are deactivating:', 'limb-chatbot' ); ?>
		</p>
		<form id="lbaic-deactivation-form">
			<ul>
				<?php foreach ( $reasons as $value => $label ) : ?>
					<li class="lbaic-reason-<?php echo esc_attr( $value ); ?>">
						<label>
							<input type="radio" name="lbaic_deactivation_reason" value="<?php echo esc_attr( $value ); ?>" />
							<span><?php echo esc_html( $label ); ?></span>
						</label>
						<?php if ( 'other' === $value ) : ?>
							<textarea name="lbaic_deactivation_reason_other" rows="5" placeholder="<?php esc_attr_e( 'Please tell us more details.', 'limb-chatbot' ); ?>" aria-label="<?php esc_attr_e( 'Additional feedback', 'limb-chatbot' ); ?>" style="display: none;"></textarea>
						<?php endif; ?>
					</li>
				<?php endforeach; ?>
			</ul>
			<div class="lbaic-deactivation-footer">
				<button type="button" id="lbaic-deactivation-submit" class="button button-primary">
					<?php esc_html_e( 'Submit & Deactivate', 'limb-chatbot' ); ?>
				</button>
				<button type="button" id="lbaic-deactivation-skip" class="button button-secondary">
					<?php esc_html_e( 'Skip & Deactivate', 'limb-chatbot' ); ?>
				</button>
			</div>
		</form>
	</div>
</div>


