<?php
/**
 * Future pregnancy results.
 *
 * @link       https://belovdigital.agency
 * @since      1.0.0
 *
 * @package    ultimate-pregnancy-ovulation-calculator
 * @subpackage ultimate-pregnancy-ovulation-calculator/public/partials
 *
 * @global array $atts (input data)
 */

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

<div class="ulpc-result__pregnancy">
	<div class="ulpc-result__pregnancy-wrapper">
		<div class="ulpc-result__pregnancy-summary ulpc-result__pregnancy-summary--future-pregnancy">

			<div class="ulpc-result__pregnancy-image ulpc-result__pregnancy-image--future-pregnancy">
				<img src="<?php echo esc_url( ULPC_PLUGIN_URL . 'public/images/future-pregnancy.jpg' ); ?>" alt="<?php esc_attr_e( 'Future pregnancy planning', 'ultimate-pregnancy-ovulation-calculator' ); ?>">
			</div>

			<div class="ulpc-result__pregnancy-disclaimer">
				<?php esc_html_e( '* the results of this calculator are estimations only', 'ultimate-pregnancy-ovulation-calculator' ); ?>
			</div>



		</div>
		<div class="ulpc-result__pregnancy-content ulpc-result__pregnancy-content--future-pregnancy">

			<div class="ulpc-result__future-pregnancy">

				<div class="ulpc-result__future-pregnancy-content">

					<p class="ulpc-result__future-pregnancy-title">
						<?php esc_html_e( 'Future pregnancy planning', 'ultimate-pregnancy-ovulation-calculator' ); ?>
					</p>

					<div class="ulpc-result__future-pregnancy-icon">
						<img src="<?php echo esc_url( ULPC_PLUGIN_URL . 'public/images/future-pregnancy-icon.png' ); ?>" alt="">
					</div>

				</div>

				<div class="ulpc-result__future-pregnancy-footer">
					<?php if ( isset( $result['isIVF'] ) && $result['isIVF'] ) : ?>

						<div class="ulpc-result__future-pregnancy-row">
							<p class="ulpc-result__future-pregnancy-row-title <?php echo $is_custom_font ? 'ulpc-custom-font' : ''; ?>">
								<?php echo esc_html__( '📅 Planned transfer date:', 'ultimate-pregnancy-ovulation-calculator' ); ?>
							</p>
							<p class="ulpc-result__future-pregnancy-row-text">
								<?php echo esc_html( $result['transferDate'] ); ?>
							</p>
						</div>

						<div class="ulpc-result__future-pregnancy-row">
							<p class="ulpc-result__future-pregnancy-row-title <?php echo $is_custom_font ? 'ulpc-custom-font' : ''; ?>">
								<?php echo esc_html__( '❤️‍🔥 Days until transfer:', 'ultimate-pregnancy-ovulation-calculator' ); ?>
							</p>
							<p class="ulpc-result__future-pregnancy-row-text">
								<?php echo esc_html( $result['daysUntilConception'] ); ?>
							</p>
						</div>

					<?php else : ?>

						<div class="ulpc-result__future-pregnancy-row">
							<?php
							$conception_date_title = 'conception_date' === $calculator_data['calculatorMethod'] ? __( '❤️‍🔥 Conception date:', 'ultimate-pregnancy-ovulation-calculator' ) : __( '❤️‍🔥 Estimated conception date:', 'ultimate-pregnancy-ovulation-calculator' );
							?>
							<p class="ulpc-result__future-pregnancy-row-title <?php echo $is_custom_font ? 'ulpc-custom-font' : ''; ?>">
								<?php echo esc_html( $conception_date_title ); ?>
							</p>
							<p class="ulpc-result__future-pregnancy-row-text">
								<?php echo esc_html( $result['estimatedConceptionDate'] ); ?>
							</p>
						</div>

						<?php
							$days_until_conception_title = 'conception_date' === $calculator_data['calculatorMethod'] ? __( '📅 Days until conception:', 'ultimate-pregnancy-ovulation-calculator' ) : __( '📅 Days until estimated conception:', 'ultimate-pregnancy-ovulation-calculator' );
							if ( isset( $result['daysUntilConception'] ) && $result['daysUntilConception'] > 0 ) : ?>
							<div class="ulpc-result__future-pregnancy-row">
								<p class="ulpc-result__future-pregnancy-row-title <?php echo $is_custom_font ? 'ulpc-custom-font' : ''; ?>">
									<?php echo esc_html( $days_until_conception_title ); ?>
								</p>
								<p class="ulpc-result__future-pregnancy-row-text">
									<?php echo esc_html( $result['daysUntilConception'] ); ?>
								</p>
							</div>
						<?php endif; ?>

					<?php endif; ?>

					<div class="ulpc-result__future-pregnancy-row">
						<p class="ulpc-result__future-pregnancy-row-title <?php echo $is_custom_font ? 'ulpc-custom-font' : ''; ?>">
							<?php echo esc_html__( '🎉 Estimated due date:', 'ultimate-pregnancy-ovulation-calculator' ); ?>
						</p>
						<p class="ulpc-result__future-pregnancy-row-text">
							<?php echo esc_html( $result['dueDate'] ); ?>
						</p>
					</div>

				</div>

			</div>


		</div>

	</div>
</div>
