<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
/**
 * Customer Cancelled Meeting 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( 'Your meeting has been cancelled. If you have any questions or would like to reschedule, please contact us.', 'radius-booking' ); ?></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( 'Host:', 'radius-booking' ); ?></strong> <?php echo esc_html( $merge_tags['staff_name'] ?? '' ); ?></p>
			<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 do_action( 'rtrb_email_after_booking_details', $email, $booking ); ?>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="center" style="padding: 16px 0;">
			<span style="background-color: #fee2e2; color: #991b1b; padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block;">
				<?php esc_html_e( 'CANCELLED', 'radius-booking' ); ?>
			</span>
		</td>
	</tr>
</table>

<?php if ( ! empty( $merge_tags['cancellation_reason'] ) ) : ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-color: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; margin: 16px 0;">
	<tr>
		<td style="padding: 16px;">
			<p style="margin: 0 0 8px 0; font-weight: 600; color: #991b1b;"><?php esc_html_e( 'Cancellation Reason:', 'radius-booking' ); ?></p>
			<p style="margin: 0; font-size: 14px; color: #7f1d1d;"><?php echo esc_html( $merge_tags['cancellation_reason'] ); ?></p>
		</td>
	</tr>
</table>
<?php endif; ?>

<?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 );
?>
