<?php
/**
 * External-service disclosure helpers for settings UI and privacy copy.
 *
 * @package SEOvaultSEO\Extension
 */

namespace SEOvaultSEO\Extension;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Renders admin disclosure for Free external services and Pro licensing.
 */
class ExternalServices {

	/**
	 * Render a compact disclosure block for General → Connection.
	 *
	 * @return void
	 */
	public static function render_connection_disclosure() {
		?>
		<div class="seovaultseo-external-services-disclosure" style="margin-top:24px;padding:16px;border:1px solid var(--seovaultseo-border,#52a2b4);border-radius:var(--seovaultseo-radius,8px);background:var(--seovaultseo-card-bg,#fff);">
			<h3><?php esc_html_e( 'External services & data', 'seovault-ai' ); ?></h3>
			<p class="description">
				<?php esc_html_e( 'SEOvault AI works as a local SEO plugin without contacting SEOvault servers. Optional features contact external services only when you enable or use them.', 'seovault-ai' ); ?>
			</p>
			<ul style="list-style:disc;margin-left:1.25em;">
				<li><?php esc_html_e( 'SEOvault AI web app (optional site-key connection): authorized API access to content and SEO settings for cloud workflows. No automatic background post uploads.', 'seovault-ai' ); ?></li>
				<li><?php esc_html_e( 'IndexNow, Google Analytics, and Google Maps: only when those features are enabled/configured.', 'seovault-ai' ); ?></li>
				<li><?php esc_html_e( 'SEOvault AI Pro (separate plugin): if installed and activated with a license, it may contact SEOvault AI licensing and update endpoints to verify entitlements and deliver updates. Core Free SEO output continues without Pro.', 'seovault-ai' ); ?></li>
			</ul>
			<p class="description">
				<?php
				$terms_link   = '<a href="' . esc_url( 'https://seovaultai.com/terms/' ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'seovaultai.com/terms', 'seovault-ai' ) . '</a>';
				$privacy_link = '<a href="' . esc_url( 'https://seovaultai.com/privacy/' ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'seovaultai.com/privacy', 'seovault-ai' ) . '</a>';
				echo wp_kses(
					sprintf(
						/* translators: 1: terms link HTML, 2: privacy link HTML */
						__( 'Terms: %1$s — Privacy: %2$s', 'seovault-ai' ),
						$terms_link,
						$privacy_link
					),
					array(
						'a' => array(
							'href'   => true,
							'target' => true,
							'rel'    => true,
						),
					)
				);
				?>
			</p>
		</div>
		<?php
	}
}
