<?php

/**
 * The template for displaying security login notification
 *
 * This template can be overridden by copying it to yourtheme/movie-engine/emails/security-login.php.
 *
 * HOWEVER, on occasion MovieEngine will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * NOTE: Inline styles in email templates are intentional for email client compatibility.
 *
 * @note Please do not delete our CSS classes when you customize, as it may break functionality.
 * @package Movie_Engine
 * @subpackage Movie_Engine/templates
 * @version 1.0.0
 * @since 1.0.0
 */

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

<h1><?php esc_html_e('New Login Detected', 'cine-movie-engine'); ?></h1>
<p><?php esc_html_e('We noticed a new login to your account {user_name}. If this was you, you can safely ignore this email.', 'cine-movie-engine'); ?></p>

<div class="divider"></div>

<p><strong><?php esc_html_e('Device Details:', 'cine-movie-engine'); ?></strong></p>
<ul style="background: #1f1f1f; padding: 20px 40px; list-style: circle; border-radius: 6px; color: #ccc;">
    <li><strong><?php esc_html_e('Browser:', 'cine-movie-engine'); ?></strong> {browser}</li>
    <li><strong><?php esc_html_e('OS:', 'cine-movie-engine'); ?></strong> {os}</li>
    <li><strong><?php esc_html_e('IP Address:', 'cine-movie-engine'); ?></strong> {ip}</li>
    <li><strong><?php esc_html_e('Time:', 'cine-movie-engine'); ?></strong> {time}</li>
</ul>

<p><?php esc_html_e('If you did NOT perform this login, please reset your password immediately to secure your account.', 'cine-movie-engine'); ?></p>

<?php
$movie_engine_email_options = get_option('movie_engine_email_settings', []);
$movie_engine_email_primary_color = !empty($movie_engine_email_options['primary_color']) ? $movie_engine_email_options['primary_color'] : '#E50914';
$movie_engine_email_btn_text_color = !empty($movie_engine_email_options['btn_text_color']) ? $movie_engine_email_options['btn_text_color'] : '#FFFFFF';
?>
<div style="text-align: center; margin-top: 30px;">
    <a href="{reset_password_url}" class="btn" style="background-color: #333; color: #fff; border: 1px solid #555; text-decoration: none; padding: 12px 30px; border-radius: 4px; font-weight: bold; display: inline-block;"><?php esc_html_e('Secure My Account', 'cine-movie-engine'); ?></a>

    <div style="margin-top: 15px;">
        <a href="{dashboard_url}" class="btn" style="background-color: <?php echo esc_attr($movie_engine_email_primary_color); ?>; color: <?php echo esc_attr($movie_engine_email_btn_text_color); ?>; text-decoration: none; padding: 12px 30px; border-radius: 4px; font-weight: bold; display: inline-block;"><?php esc_html_e('Go to Dashboard', 'cine-movie-engine'); ?></a>
    </div>
</div>

<p style="margin-top: 40px; border-top: 1px solid #333; padding-top: 20px; font-style: italic; color: #888;">
    <?php esc_html_e('Stay Safe,', 'cine-movie-engine'); ?><br>
    <?php esc_html_e('The {site_name} Team', 'cine-movie-engine'); ?>
</p>