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


/**
 * ============================================
 * FILE: templates/emails/employee/appointment-cancelled.php
 * Employee Cancelled Appointment Email Template
 * ============================================
 */
?>
<?php
do_action( 'rtrb_get_email_header', $email, $booking );
do_action( 'rtrb_email_before_content', $email, $booking );
do_action( 'rtrb_email_content_start', $email, $booking );
?>

	<!-- Email Content Text -->
	<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( 'An appointment has been cancelled. Please review the details below and update your schedule accordingly.', 'radius-booking' ); ?></p>
				<?php endif; ?>
			</td>
		</tr>
	</table>

	<!-- Customer Info Box -->
	<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( $booking['customer']->customer_info['name'] ?? '' ); ?>
				</p>
				<p style="margin: 0; font-size: 14px; color: #374151;">
					<strong><?php esc_html_e( 'Email:', 'radius-booking' ); ?></strong> <?php echo esc_html( $booking['customer']->customer_info['email'] ?? '' ); ?>
				</p>
			</td>
		</tr>
	</table>

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

	<!-- Booking Details Box -->
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="booking-details">
		<tr>
			<td style="padding: 20px;">
				<?php do_action( 'rtrb_email_booking_details', $email, $booking ); ?>
			</td>
		</tr>
	</table>

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

	<!-- Status Badge -->
	<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 ( isset( $booking['cancellation_reason'] ) && ! empty( $booking['cancellation_reason'] ) ) : ?>
	<!-- 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( $booking['cancellation_reason'] ); ?>
				</p>
			</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 );