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

/**
 * HTML Template: New Job Proposal Submitted
 *
 * Sent to the employer when a new proposal is submitted.
 *
 * @var string   $email_heading
 * @var string   $recipient_name
 * @var string   $freelancer_name
 * @var string   $job_title
 * @var int      $proposal_id
 * @var int      $job_id
 * @var string   $proposal_link
 * @var string   $bid_amount
 * @var string   $job_delivery_time
 * @var string   $job_delivery_time_type
 * @var string   $freelancer_label
 * @var bool     $sent_to_admin
 * @var bool     $plain_text
 * @var WC_Email $email
 */
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
do_action( 'woocommerce_email_header', $email_heading, $email );
?>

<table role="presentation" cellspacing="0" cellpadding="0" style="width: 100%; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;">
	<tr>
		<td style="padding: 40px 20px;">

			<!-- Greeting -->
			<p style="margin: 0 0 20px 0;">
				<?php
				printf(
					// translators: %s is a recipient name.
					esc_html__( 'Hello %s,', 'gigneo' ),
					esc_html( $recipient_name )
				);
				?>
			</p>

			<!-- Introduction -->
			<p style="margin: 0 0 30px 0;">
				<?php
				printf(
					// translators: %1$s: Freelancer name, %2$s: Freelancer label, %3$s: Job title.
					esc_html__( 'You have received a new proposal from %1$s (%2$s) for your job posting "%3$s". Below are the key details of the proposal for your review.', 'gigneo' ),
					'<strong>' . esc_html( $freelancer_name ) . '</strong>',
					esc_html( $freelancer_label ),
					'<strong>' . esc_html( $job_title ) . '</strong>'
				);
				?>
			</p>

			<!-- Section heading -->
			<h3 style="margin: 0 0 15px 0;">
				<?php echo esc_html__( 'Proposal details', 'gigneo' ); ?>
			</h3>

			<!-- Details table -->
			<table role="presentation" cellspacing="0" cellpadding="0" style="width: 100%; background: #F7F7F7; border: 1px solid #f0f0f0; border-radius: 12px; margin: 0 0 30px 0;">
				<!-- Job Title -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; width: 50%;">
						<?php echo esc_html__( 'Job title', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( $job_title ); ?>
					</td>
				</tr>

				<!-- Freelancer -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0;">
						<?php echo esc_html( $freelancer_label ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( $freelancer_name ); ?>
					</td>
				</tr>

				<!-- Bid Amount -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0;">
						<?php echo esc_html__( 'Bid amount', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( gigneo_price_format( $bid_amount, true ) ); ?>
					</td>
				</tr>

				<!-- Delivery Time -->
				<tr>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0;">
						<?php echo esc_html__( 'Estimated delivery', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; border-bottom: 1px solid #f0f0f0; text-align: right;">
						<?php echo esc_html( $job_delivery_time . ' ' . $job_delivery_time_type ); ?>
					</td>
				</tr>

				<!-- Proposal ID -->
				<tr>
					<td style="padding: 14px 16px;">
						<?php echo esc_html__( 'Proposal ID', 'gigneo' ); ?>
					</td>
					<td style="padding: 14px 16px; text-align: right;">
						<?php echo esc_html( gigneo_format_id( $proposal_id, 'proposal', false ) ); ?>
					</td>
				</tr>
			</table>

			<!-- CTA Button -->
			<table role="presentation" cellspacing="0" cellpadding="0" style="width: 100%; margin: 0 0 30px 0;">
				<tr>
					<td style="text-align: center; padding: 10px 0;">
						<a href="<?php echo esc_url( $proposal_link ); ?>" target="_blank" rel="noopener">
							<?php echo esc_html__( 'Review proposal details', 'gigneo' ); ?> &rarr;
						</a>
					</td>
				</tr>
			</table>

			<!-- Closing note -->
			<p style="margin: 0 0 10px 0;">
				<?php echo esc_html__( 'We recommend reviewing the freelancer\'s profile and previous work before making a decision.', 'gigneo' ); ?>
			</p>

		</td>
	</tr>
</table>

<?php
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
do_action( 'woocommerce_email_footer', $email );
