<?php
/**
 * Brute Force 503 Lockout View
 *
 * @package VMPFence
 * @since 2.0.0
 */

// Prevent direct access
if (!defined('ABSPATH')) {
    exit;
}

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Access Temporarily Limited - VMPFence Security</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #ff7a45 0%, #ff6b35 100%);
            color: #333;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            padding: 20px;
        }
        .container {
            background: white;
            border-radius: 10px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            max-width: 700px;
            width: 100%;
            padding: 40px;
        }
        .lock-icon {
            text-align: center;
            font-size: 64px;
            color: #ff6b35;
            margin-bottom: 20px;
        }
        h1 {
            color: #ff6b35;
            font-size: 32px;
            margin-bottom: 10px;
            text-align: center;
        }
        h2 {
            color: #555;
            font-size: 20px;
            margin-bottom: 30px;
            text-align: center;
            font-weight: 300;
        }
        .details {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
        }
        .details h3 {
            color: #ff6b35;
            margin-bottom: 15px;
            font-size: 18px;
        }
        .details p {
            margin-bottom: 8px;
            color: #555;
        }
        .info {
            background: #fff3e0;
            border: 1px solid #ffcc02;
            border-radius: 5px;
            padding: 15px;
            margin-bottom: 20px;
            color: #e65100;
        }
        .custom-message {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 5px;
            padding: 20px;
            margin: 20px 0;
            color: #495057;
        }
        .unlock-section {
            background: #e8f5e8;
            border: 1px solid #c8e6c9;
            border-radius: 5px;
            padding: 20px;
            margin-bottom: 20px;
            color: #2e7d32;
        }
        .unlock-section h3 {
            color: #1b5e20;
            margin-bottom: 10px;
        }
        .unlock-section p {
            margin-bottom: 10px;
        }
        .unlock-section a {
            color: #2e7d32;
            text-decoration: underline;
        }
        .footer {
            text-align: center;
            margin-top: 30px;
            font-size: 12px;
            color: #999;
        }
        hr {
            border: none;
            border-top: 1px solid #ddd;
            margin: 20px 0;
        }
        .countdown {
            font-family: 'Courier New', monospace;
            font-size: 18px;
            font-weight: bold;
            color: #ff6b35;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="lock-icon">🔒</div>
        <h1>Access Temporarily Limited</h1>
        <h2>Your access has been temporarily restricted</h2>

        <div class="details">
            <h3>Lockout Information</h3>
            <p><strong>Reason:</strong> <?php echo esc_html($reason ?? 'Too many failed login attempts'); ?></p>
            <p><strong>Time:</strong> <?php echo esc_html(current_time('mysql')); ?></p>
            <p><strong>Your IP:</strong> <?php echo esc_html($ip ?? $_SERVER['REMOTE_ADDR']); ?></p>
            <?php if (isset($lockout_duration) && $lockout_duration > 0): ?>
            <p><strong>Lockout Duration:</strong> <?php echo esc_html($lockout_duration); ?> minutes</p>
            <?php endif; ?>
        </div>

        <div class="info">
            <strong>What happened?</strong><br>
            Your IP address has been temporarily blocked due to suspicious activity or repeated failed login attempts. This is a security measure to protect the website from unauthorized access attempts.
        </div>

        <?php if (!empty($custom_text)): ?>
        <hr>
        <div class="custom-message">
            <?php echo $custom_text; ?>
        </div>
        <?php endif; ?>

        <div class="unlock-section">
            <h3>How to regain access:</h3>
            <p>• Wait for the lockout period to expire</p>
            <p>• Ensure you are using correct login credentials</p>
            <p>• Contact the website administrator if you believe this is an error</p>
        </div>

        <div class="info">
            <strong>Still having trouble?</strong><br>
            If you continue to experience issues or believe this block is in error, please contact the website administrator for assistance.
        </div>

        <div class="footer">
            Protected by VMPFence Security Plugin
        </div>
    </div>
</body>
</html>