<?php
/**
 * Admin ready-to-sync page template.
 * This page is shown after first-time connection to prompt user to manually start sync.
 *
 * @package    MaplePress
 * @subpackage MaplePress/includes
 */

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

$options = get_option( 'maplepress_settings', array() );
?>

<div class="wrap">
	<h1><?php esc_html_e( 'MaplePress - Ready to Sync', 'maplepress' ); ?></h1>

	<div style="max-width: 800px; margin: 40px auto;">
		<div style="background: #fff; border: 1px solid #dcdcde; padding: 40px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">

			<!-- Success icon -->
			<div style="text-align: center; margin-bottom: 30px;">
				<span style="display: inline-block; width: 80px; height: 80px; line-height: 80px; border-radius: 50%; background: #00a32a; color: #fff; font-size: 48px;">✓</span>
			</div>

			<!-- Main message -->
			<h2 style="text-align: center; margin: 20px 0; color: #1d2327; font-size: 28px;">
				<?php esc_html_e( 'Connection Successful!', 'maplepress' ); ?>
			</h2>

			<p style="text-align: center; color: #666; font-size: 18px; margin: 20px 0;">
				<?php esc_html_e( 'Your site is now connected to MaplePress.', 'maplepress' ); ?>
			</p>

			<!-- Important notice -->
			<div style="background: #fff3cd; border: 1px solid #ffc107; border-radius: 4px; padding: 20px; margin: 30px 0; text-align: center;">
				<p style="margin: 0; color: #856404; font-size: 16px; font-weight: 600;">
					<?php esc_html_e( 'You must sync all your pages to continue.', 'maplepress' ); ?>
				</p>
				<p style="margin: 10px 0 0 0; color: #856404; font-size: 14px;">
					<?php esc_html_e( 'This is a one-time process that will make all your published content searchable via MaplePress.', 'maplepress' ); ?>
				</p>
			</div>

			<!-- Action buttons -->
			<div style="text-align: center; margin: 40px 0 20px 0;">
				<a href="<?php echo admin_url( 'admin.php?page=maplepress-initial-sync' ); ?>" class="button button-primary button-hero" style="font-size: 18px; padding: 12px 36px; height: auto;">
					<?php esc_html_e( 'Start Sync Now', 'maplepress' ); ?>
				</a>
			</div>

			<!-- Divider -->
			<hr style="margin: 40px 0; border: none; border-top: 1px solid #dcdcde;">

			<!-- Secondary actions -->
			<div style="text-align: center;">
				<p style="color: #666; font-size: 14px; margin-bottom: 15px;">
					<?php esc_html_e( 'Need to start over?', 'maplepress' ); ?>
				</p>
				<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" onsubmit="return confirm('<?php echo esc_js( __( 'Are you sure you want to reset all MaplePress settings? This will disconnect your site from MaplePress.', 'maplepress' ) ); ?>');">
					<?php wp_nonce_field( 'maplepress_reset_settings' ); ?>
					<input type="hidden" name="action" value="maplepress_reset_settings">
					<button type="submit" class="button button-link-delete" style="color: #d63638; text-decoration: none;">
						<?php esc_html_e( 'Reset All Settings', 'maplepress' ); ?>
					</button>
				</form>
			</div>

		</div>
	</div>
</div>
