<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
/**
 * Employee Meeting Reminder Email Template
 */
do_action( 'rtrb_get_email_header', $email, $booking );
do_action( 'rtrb_email_before_content', $email, $booking );
do_action( 'rtrb_email_content_start', $email, $booking );
?>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td class="main-content">
			<?php if ( ! empty( $settings['additional_content'] ) ) : ?>
				<?php echo wp_kses_post( wpautop( wptexturize( $settings['additional_content'] ) ) ); ?>
			<?php else : ?>
				<p style="margin: 0;"><?php esc_html_e( 'This is a reminder about an upcoming meeting on your schedule.', 'radius-booking' ); ?></p>
			<?php endif; ?>
		</td>
	</tr>
</table>

<!-- Customer Info -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-color: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; margin: 16px 0;">
	<tr>
		<td style="padding: 16px;">
			<p style="margin: 0 0 8px 0; font-weight: 600; color: #111827;"><?php esc_html_e( 'Customer Information:', 'radius-booking' ); ?></p>
			<p style="margin: 0 0 4px 0; font-size: 14px; color: #374151;"><strong><?php esc_html_e( 'Name:', 'radius-booking' ); ?></strong> <?php echo esc_html( $merge_tags['customer_name'] ?? '' ); ?></p>
			<p style="margin: 0 0 4px 0; font-size: 14px; color: #374151;"><strong><?php esc_html_e( 'Email:', 'radius-booking' ); ?></strong> <?php echo esc_html( $merge_tags['customer_email'] ?? '' ); ?></p>
			<?php if ( ! empty( $merge_tags['customer_phone'] ) ) : ?>
				<p style="margin: 0; font-size: 14px; color: #374151;"><strong><?php esc_html_e( 'Phone:', 'radius-booking' ); ?></strong> <?php echo esc_html( $merge_tags['customer_phone'] ); ?></p>
			<?php endif; ?>
		</td>
	</tr>
</table>

<?php do_action( 'rtrb_email_before_booking_details', $email, $booking ); ?>

<table width="100%" border="0" cellspacing="0" cellpadding="0" class="booking-details">
	<tr>
		<td style="padding: 20px;">
			<?php if ( ! empty( $merge_tags['meeting_type_name'] ) ) : ?>
				<p style="margin: 8px 0; font-size: 14px; color: #374151;"><strong><?php esc_html_e( 'Meeting Type:', 'radius-booking' ); ?></strong> <?php echo esc_html( $merge_tags['meeting_type_name'] ); ?></p>
			<?php endif; ?>
			<p style="margin: 8px 0; font-size: 14px; color: #374151;"><strong><?php esc_html_e( 'Date:', 'radius-booking' ); ?></strong> <?php echo esc_html( $merge_tags['booking_date'] ?? '' ); ?></p>
			<p style="margin: 8px 0; font-size: 14px; color: #374151;"><strong><?php esc_html_e( 'Time:', 'radius-booking' ); ?></strong> <?php echo esc_html( $merge_tags['time'] ?? '' ); ?></p>
			<?php if ( ! empty( $merge_tags['duration'] ) ) : ?>
				<p style="margin: 8px 0; font-size: 14px; color: #374151;"><strong><?php esc_html_e( 'Duration:', 'radius-booking' ); ?></strong> <?php echo esc_html( $merge_tags['duration'] ); ?></p>
			<?php endif; ?>
			<?php if ( ! empty( $merge_tags['location'] ) ) : ?>
				<p style="margin: 8px 0; font-size: 14px; color: #374151;"><strong><?php esc_html_e( 'Location:', 'radius-booking' ); ?></strong> <?php echo esc_html( $merge_tags['location'] ); ?></p>
			<?php endif; ?>
		</td>
	</tr>
</table>

<?php if ( ! empty( $merge_tags['meeting_link'] ) ) : ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin: 16px 0;">
	<tr>
		<td align="center" style="padding: 16px; background-color: #eff6ff; border: 1px solid #bfdbfe; border-radius: 6px;">
			<p style="margin: 0 0 12px 0; font-size: 14px; font-weight: 600; color: #1e40af;"><?php esc_html_e( 'Meeting Link', 'radius-booking' ); ?></p>
			<a href="<?php echo esc_url( $merge_tags['meeting_link'] ); ?>" target="_blank" rel="noopener noreferrer" style="display: inline-block; padding: 10px 24px; background-color: #2563eb; color: #ffffff; text-decoration: none; font-size: 14px; font-weight: 600; border-radius: 6px;">
				<?php esc_html_e( 'Open Meeting', 'radius-booking' ); ?>
			</a>
		</td>
	</tr>
</table>
<?php endif; ?>

<?php do_action( 'rtrb_email_after_booking_details', $email, $booking ); ?>

<?php if ( ! empty( $settings['footer_text'] ) ) : ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td class="footer-text"><?php echo wp_kses_post( wpautop( wptexturize( $settings['footer_text'] ) ) ); ?></td></tr></table>
<?php endif; ?>

<?php do_action( 'rtrb_email_before_button', $email, $booking ); ?>
<?php if ( ! empty( $settings['button_text'] ) ) : ?>
	<?php do_action( 'rtrb_email_button', $email, $booking, $settings ); ?>
<?php endif; ?>

<?php
do_action( 'rtrb_email_content_end', $email, $booking );
do_action( 'rtrb_email_after_content', $email, $booking );
do_action( 'rtrb_get_email_footer', $email, $booking );
?>
