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

/**
 * ============================================
 * FILE: templates/emails/customer/appointment-completed.php
 * Customer Completed 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( 'Thank you for choosing our services! We hope you had a great experience. We would love to hear your feedback.', 'radius-booking' ); ?></p>
			<?php endif; ?>
		</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: #d1fae5; color: #065f46; padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-block;">
				✅ <?php esc_html_e( 'COMPLETED', 'radius-booking' ); ?>
			</span>
		</td>
	</tr>
</table>


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

<!-- Book Again CTA -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="center" style="padding-top: 16px;">
			<p style="margin: 0; font-size: 14px; color: #6b7280;">
				<?php esc_html_e( 'Ready for your next appointment?', 'radius-booking' ); ?>
				<a href="<?php echo esc_url( get_site_url() . '/booking/' ); ?>" style="color: #2563eb; text-decoration: underline;">
					<?php esc_html_e( 'Book Now', 'radius-booking' ); ?>
				</a>
			</p>
		</td>
	</tr>
</table>

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