<?php

	use CrewHRM\Helpers\Utilities;
	use CrewHRM\Main;

if ( ! defined( 'ABSPATH' ) ) { exit;
}

$welcome_assets_version = Main::$configs->version;
$subscriber_host       = 'development' === Main::$configs->mode ? 'http://localhost:10028' : 'https://getcrewhrm.com';

wp_enqueue_style( 'crewhrm-welcome-bootstrap', Main::$configs->url . 'templates/welcome/vendor/bootstrap/bootstrap.min.css', array(), '4.6.2' );
wp_enqueue_style( 'crewhrm-welcome-reset', Main::$configs->url . 'templates/welcome/vendor/reset/reset.min.css', array(), '2.0' );
wp_enqueue_style( 'crewhrm-welcome-figtree', Main::$configs->url . 'templates/welcome/vendor/fonts/figtree.css', array(), $welcome_assets_version );
wp_enqueue_style( 'crewhrm-welcome-font-awesome', Main::$configs->url . 'templates/welcome/vendor/fontawesome/css/all.min.css', array(), '6.5.1' );
wp_enqueue_style( 'crewhrm-welcome-aos', Main::$configs->url . 'templates/welcome/vendor/aos/aos.css', array(), '2.3.4' );
wp_enqueue_style(
	'crewhrm-welcome-style',
	Main::$configs->url . 'templates/welcome/css/style.css',
	array( 'crewhrm-welcome-bootstrap', 'crewhrm-welcome-font-awesome', 'crewhrm-welcome-aos', 'crewhrm-welcome-reset', 'crewhrm-welcome-figtree' ),
	$welcome_assets_version
);

wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'crewhrm-welcome-bootstrap', Main::$configs->url . 'templates/welcome/vendor/bootstrap/bootstrap.bundle.min.js', array( 'jquery' ), '4.6.2', true );
wp_enqueue_script( 'crewhrm-welcome-wow', Main::$configs->url . 'templates/welcome/vendor/wow/wow.min.js', array(), '1.1.2', true );
wp_enqueue_script( 'crewhrm-welcome-aos', Main::$configs->url . 'templates/welcome/vendor/aos/aos.js', array(), '2.3.4', true );
wp_enqueue_script(
	'crewhrm-welcome-custom',
	Main::$configs->url . 'templates/welcome/js/custom-script.js',
	array( 'jquery', 'crewhrm-welcome-bootstrap', 'crewhrm-welcome-wow', 'crewhrm-welcome-aos' ),
	$welcome_assets_version,
	true
);
wp_add_inline_script(
	'crewhrm-welcome-custom',
	'window.crew_data = ' . wp_json_encode(
		array(
			'subscriber_host' => $subscriber_host . '/wp-admin/admin-ajax.php',
		)
	) . ';',
	'before'
);

?><!DOCTYPE html>
<html lang="en">
	<head>
		<title><?php esc_html_e( 'Welcome to CrewHRM', 'hr-management' ); ?></title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<?php
		wp_print_styles(
			array(
				'crewhrm-welcome-reset',
				'crewhrm-welcome-figtree',
				'crewhrm-welcome-bootstrap',
				'crewhrm-welcome-font-awesome',
				'crewhrm-welcome-aos',
				'crewhrm-welcome-style',
			)
		);
		?>
	</head>
	<body>
		<div class="wrapper">
			<header>
				<div class="container p-0 text-white">
					<!-- Navigation Bar -->
					<nav class="navbar navbar-expand-lg justify-content-between pb-lg-0 navbar-dark">
						<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggler" aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation">
							<span class="navbar-toggler-icon"></span>
						</button>
						<div class="upgrade-list w-50 d-lg-none d-inline-flex align-items-center justify-content-center">
							<a href="https://getcrewhrm.com/" target="_blank" class="nav-link">
								<?php esc_html_e( 'Upgrade to Pro', 'hr-management' ); ?>
							</a>
						</div>
						<a class="navbar-brand" href="<?php echo esc_sql( Utilities::getBackendPermalink( 'hr-management' ) ); ?>">
							<img src="<?php echo esc_url( Main::$configs->url ); ?>templates/welcome/img/logo.svg" width="115" alt="Logo">
						</a>
						<div class="collapse navbar-collapse" id="navbarToggler">
							<ul class="navbar-nav mx-md-auto mr-auto mt-2 mt-lg-0">
								<li class="nav-item active">
									<a class="nav-link" href="#">
										<?php esc_html_e( 'Welcome', 'hr-management' ); ?>
									</a>
								</li>
								<li class="nav-item">
									<a class="nav-link" target="_blank" href="<?php echo esc_url( Utilities::getBackendPermalink( 'crewhrm-settings#/settings/recruitment/careers/' ) ); ?>">
										<?php esc_html_e( 'Settings', 'hr-management' ); ?>
									</a>
								</li>
								<li class="nav-item">
									<a class="nav-link" target="_blank" href="https://getcrewhrm.com/docs">
										<?php esc_html_e( 'Knowledge Base', 'hr-management' ); ?>
									</a>
								</li>
								<li class="nav-item">
									<a class="nav-link" target="_blank" href="https://getcrewhrm.com/pricing">
										<?php esc_html_e( 'Pricing', 'hr-management' ); ?>
									</a>
								</li>
							</ul>
						</div>
						<div class="upgrade-list d-lg-flex d-none">
							<a href="https://getcrewhrm.com/" target="_blank" class="nav-link">
								<?php esc_html_e( 'Upgrade to Pro', 'hr-management' ); ?>
							</a>
						</div>
					</nav>
				</div>
			</header>

			<main class="container">
				<section class="welcome-secn">
					<div class="row align-items-center">
						<div class="col-md-6"  data-aos="fade-up" data-aos-delay="4s">
							<h1 class="heading-color main-title">
								<?php 
								/* translators: %s: HTML line break between "WELCOME TO" and "CREW HRM". */
								echo sprintf( esc_html__( 'WELCOME TO %s CREW HRM', 'hr-management' ), '<br/>' ); 
								?>
							</h1>
						</div>

						<div class="col-md-6" data-aos="fade-up" data-aos-delay="5s">
							<p class="astra-is-fast-fully">
								Astra is fast, fully customizable &amp; beautiful WordPress theme
								suitable for blog, personal portfolio, business website and WooCommerce storefront.
							</p>
							<a href="<?php echo esc_sql( Utilities::getBackendPermalink( 'hr-management' ) ); ?>" class="white-link">
								<?php esc_html_e( 'Go To Dashboard', 'hr-management' ); ?>
							</a>
						</div>
					</div>
				</section>

				<section class="cards_group">
					<div class="row justify-content-center cols-container">
						<div class="col-lg-4 col-md-6" data-aos="fade-up" data-aos-delay="400">
							<div class="card">
								<!-- Card Body -->
								<div class="card-body">
									<h5 class="card-title">
										<?php esc_html_e( 'Subscribe', 'hr-management' ); ?>
									</h5>
									<p class="card-text">
										<?php esc_html_e( 'Get notified about security updates and Tips & Tricks', 'hr-management' ); ?>
									</p>
									<form class="subscribe-form" id="subscribe-form" action="#" method="post">
										<div class="form-group">
											<input class="form-control" type="text" id="name" name="name" placeholder="Your name" required>
										</div>
										<div class="form-group">
											<input class="form-control" type="email" id="email" name="email" placeholder="Email Address" required>
										</div>
										<div class="form-group mb-0">
											<button type="submit" class="btn" id="subscribe-button">
												<?php esc_html_e( 'Subscribe Now', 'hr-management' ); ?>
											</button>
										</div>
									</form>
								</div>
							</div>
						</div>
						<div class="col-md-6 col-lg-4" data-aos="fade-up" data-aos-delay="500">
							<div class="card" style="display: flex; flex-flow: column; justify-content: space-between;">
								<div class="card-body">
									<h5 class="card-title">
										<?php esc_html_e( 'Overview', 'hr-management' ); ?>
									</h5>
									<p class="card-text">
										<?php esc_html_e( 'Watch the Quick starting guide', 'hr-management' ); ?>
									</p>
								</div>
								<div class="video-container" style="background-image: url(<?php echo esc_url( Main::$configs->url ); ?>templates/welcome/img/video-thumbnail.png);">
									<div class="video-icon" id="video-player-icon">
										<img src="<?php echo esc_url( Main::$configs->url ); ?>templates/welcome/img/video-icon.svg" width="50" alt="video0-icon" />
									</div> <!-- Using Unicode Play symbol -->
								</div>
							</div>
						</div>
						<div class="col-md-6 col-lg-4" data-aos="fade-up" data-aos-delay="600">
							<div class="card">
								<!-- Card Body -->
								<div class="card-body">
									<h5 class="card-title">Community</h5>
									<p class="card-text">Join our social platform</p>
									<a href="https://www.facebook.com/groups/crewhrm" target="_blank" class="plain-a">
										<button class="facebook-btn">
											<i class="fa-brands fa-facebook"></i> <?php esc_html_e( 'Join Our Facebook Group', 'hr-management' ); ?>
										</button>
									</a>
								</div>
								<div class="social-buttons-container">
									<a class="facebook-col w-50 plain-a" href="https://www.facebook.com/crewhrm" target="_blank">
										<i class="fa-brands fa-facebook-f"></i>
									</a>

									<a class="twitter-col w-50 plain-a" href="https://twitter.com/crewhrm" target="_blank">
										<i class="fa-brands fa-x-twitter"></i>
									</a>

									<a class="linkedin-col w-100 plain-a" href="https://www.linkedin.com/company/crewhrm/" target="_blank">
										<i class="fa-brands fa-linkedin-in"></i>
									</a>
								</div>
							</div>
						</div>
					</div>
				</section>
			</main>
		</div>
		<?php
		wp_print_scripts(
			array(
				'jquery',
				'crewhrm-welcome-bootstrap',
				'crewhrm-welcome-wow',
				'crewhrm-welcome-aos',
				'crewhrm-welcome-custom',
			)
		);
		?>
	</body>
</html>
