<?php
/**
 * Email Template Wrapper
 *
 * Full HTML email template with responsive design and branding.
 *
 * @since 2.15.0
 * @package wc-affiliate
 *
 * @var string $content Main email content HTML
 * @var string $title Email title/subject
 * @var string $site_name Site name for branding
 * @var string $site_url Site URL for footer link
 * @var bool   $is_admin_email Whether this is an admin email
 */

?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title><?php echo esc_html( $title ); ?> - <?php echo esc_html( $site_name ); ?></title>
	<style>
		body {
			margin: 0;
			padding: 0;
			font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
			background-color: #F2F4FF;
		}

		.container {
			max-width: 600px;
			margin: 0 auto;
			background-color: #ffffff;
		}

		.header {
			background: <?php echo $is_admin_email ? '#1A0177' : '#490C8E'; ?>;
			padding: 40px 30px;
			text-align: center;
			border-top-left-radius: 16px;
			border-top-right-radius: 16px;
		}

		.header h1 {
			color: #ffffff;
			margin: 0;
			font-size: 30px;
			font-weight: 600;
		}

		.header p {
			color: #ffffff;
			margin: 0;
			font-size: 20px;
			font-weight: 500;
		}

		.content {
			padding: 40px 30px 20px;
			color: #121216;
			line-height: 1.6;
			font-size: 16px;
			border-right: 1px solid #F0EDFB;
			border-left: 1px solid #F0EDFB;
		}

		.footer {
			background-color: #F8F9FA;
			padding: 20px;
			text-align: center;
			border-bottom-left-radius: 16px;
			border-bottom-right-radius: 16px;
		}

		a {
			color: <?php echo $is_admin_email ? '#1A0177' : '#490C8E'; ?>;
			text-decoration: none;
		}

		a:hover {
			text-decoration: underline;
		}
	</style>
</head>
<body>
<div class="container">
	<div class="header">
		<h1><?php echo esc_html( $site_name ); ?></h1>
		<?php if ( $title ) : ?>
			<p><?php echo esc_html( $title ); ?></p>
		<?php endif; ?>
	</div>
	<div class="content">
		<?php echo $content; ?>

		<p style="color: #232324; font-size: 16px; line-height: 24px; font-weight: 500; text-align: right;">
			Powered by <a href="https://wcaffiliate.com/" style="color: #8114FF; font-weight: 600;">wc-affiliate</a>
		</p>
	</div>
	<div class="footer">
		<p style="margin: 0; color: #3C3C42; font-size: 16px; line-height: 24px;">
			You received this email because you are part of our affiliate program at <a href="<?php echo esc_url( $site_url ); ?>"><?php echo esc_html( $site_name ); ?></a>
		</p>
		<p style="margin: 10px 0 0 0; color: #3C3C42; font-size: 14px; line-height: 20px;">
			© <?php echo esc_html( wp_date( 'Y' ) ); ?> <?php echo esc_html( $site_name ); ?>. All rights reserved.
		</p>
	</div>
</div>
</body>
</html>
