<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
$textdomain = defined( 'SFTCY_WORDAI_TEXT_DOMAIN' ) ? SFTCY_WORDAI_TEXT_DOMAIN : 'wordai';
include_once SFTCY_WORDAI_PLUGIN_DIR . 'admin/views/settings-pages-header-template.php';
?>
<div class="wrap sc-wordai-search-console-page">
	<header class="wordai-sc-header">
		<div>
			<span class="wordai-sc-kicker"><?php esc_html_e( 'Search performance', $textdomain ); ?></span>
			<h1><?php esc_html_e( 'Google Search Console', $textdomain ); ?></h1>
			<p><?php esc_html_e( 'Performance, content decay, and competing-page opportunities from your selected property.', $textdomain ); ?></p>
		</div>
		<div class="wordai-sc-header-actions">
			<button type="button" class="button button-secondary wordai-sc-icon-button" id="wordai-sc-refresh"><span class="dashicons dashicons-update" aria-hidden="true"></span><?php esc_html_e( 'Refresh', $textdomain ); ?></button>
		</div>
	</header>

	<div id="wordai-sc-notice" class="wordai-sc-notice" role="status" aria-live="polite" hidden></div>

	<nav class="wordai-sc-tabs" aria-label="<?php esc_attr_e( 'Search Console views', $textdomain ); ?>">
		<button type="button" class="wordai-sc-tab is-active" data-tab="overview"><?php esc_html_e( 'Overview', $textdomain ); ?></button>
		<button type="button" class="wordai-sc-tab" data-tab="opportunities"><?php esc_html_e( 'Opportunities', $textdomain ); ?></button>
		<button type="button" class="wordai-sc-tab" data-tab="connection"><?php esc_html_e( 'Connection', $textdomain ); ?></button>
	</nav>

	<div id="wordai-sc-loading" class="wordai-sc-loading"><span class="spinner is-active"></span><strong><?php esc_html_e( 'Loading Search Console data...', $textdomain ); ?></strong></div>

	<section class="wordai-sc-panel is-active" data-panel="overview">
		<div id="wordai-sc-metrics" class="wordai-sc-metrics"></div>
		<div class="wordai-sc-section-head"><div><h2><?php esc_html_e( 'Top pages', $textdomain ); ?></h2><p id="wordai-sc-period"></p></div><button type="button" class="button button-primary wordai-sc-icon-button" id="wordai-sc-sync"><span class="dashicons dashicons-update-alt" aria-hidden="true"></span><?php esc_html_e( 'Sync now', $textdomain ); ?></button></div>
		<div class="wordai-sc-table-wrap"><table class="widefat striped"><thead><tr><th><?php esc_html_e( 'Page', $textdomain ); ?></th><th><?php esc_html_e( 'Clicks', $textdomain ); ?></th><th><?php esc_html_e( 'Impressions', $textdomain ); ?></th><th><?php esc_html_e( 'Position', $textdomain ); ?></th></tr></thead><tbody id="wordai-sc-pages"></tbody></table></div>
	</section>

	<section class="wordai-sc-panel" data-panel="opportunities">
		<div class="wordai-sc-opportunity-grid">
			<div><div class="wordai-sc-section-head"><div><h2><?php esc_html_e( 'Content decay', $textdomain ); ?></h2><p><?php esc_html_e( 'Pages losing organic clicks compared with the previous period.', $textdomain ); ?></p></div></div><div id="wordai-sc-decay" class="wordai-sc-list"></div></div>
			<div><div class="wordai-sc-section-head"><div><h2><?php esc_html_e( 'Competing pages', $textdomain ); ?></h2><p><?php esc_html_e( 'Queries where multiple pages compete for visibility.', $textdomain ); ?></p></div></div><div id="wordai-sc-cannibalization" class="wordai-sc-list"></div></div>
		</div>
	</section>

	<section class="wordai-sc-panel" data-panel="connection">
		<div class="wordai-sc-connection-layout">
			<div>
				<div class="wordai-sc-section-head"><div><h2><?php esc_html_e( 'Google account', $textdomain ); ?></h2><p id="wordai-sc-account"><?php esc_html_e( 'Not connected', $textdomain ); ?></p></div><span id="wordai-sc-connection-state" class="wordai-sc-state"><?php esc_html_e( 'Disconnected', $textdomain ); ?></span></div>
				<label class="wordai-sc-consent"><input type="checkbox" id="wordai-sc-marketing-consent"> <span><?php esc_html_e( 'Email me occasional WordAI product updates and SEO guidance. This is optional.', $textdomain ); ?></span></label>
				<div class="wordai-sc-actions"><button type="button" class="button button-primary wordai-sc-icon-button" id="wordai-sc-connect"><span class="dashicons dashicons-admin-links" aria-hidden="true"></span><?php esc_html_e( 'Connect Google Search Console', $textdomain ); ?></button><button type="button" class="button button-secondary wordai-sc-icon-button wordai-sc-refresh-properties" hidden><span class="dashicons dashicons-update" aria-hidden="true"></span><?php esc_html_e( 'Refresh properties', $textdomain ); ?></button><button type="button" class="button button-secondary wordai-sc-icon-button" id="wordai-sc-disconnect" hidden><span class="dashicons dashicons-dismiss" aria-hidden="true"></span><?php esc_html_e( 'Disconnect', $textdomain ); ?></button></div>
			</div>
			<div>
				<div class="wordai-sc-section-head"><div><h2><?php esc_html_e( 'Properties', $textdomain ); ?></h2><p id="wordai-sc-property-limit"></p></div></div>
				<div id="wordai-sc-properties" class="wordai-sc-properties"></div>
			</div>
		</div>
	</section>
</div>


