<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{ucwords(Lang::T($type))} - {$_c['CompanyName']}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
    <style>
        body {
            margin: 0;
            background: url(https://therichpost.com/wp-content/uploads/2021/03/material-design-4k-2048x1152-1.jpg) fixed;
            background-size: cover;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100vh;
            font: 600 16px/18px 'Open Sans', sans-serif;
            color: #edf3ff;
        }

        .lockscreen-wrapper {
            width: 90%;
            max-width: 400px;
            margin: auto;
            background: rgba(0, 0, 0, 0.7);
            border-radius: 15px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            text-align: center;
        }

        .panel {
            border: none;
            border-radius: 0;
            margin: 0;
            background: transparent;
        }

        .panel-heading {
            background-color: {if $type == 'success'}#28a745{elseif $type == 'danger'}#dc3545{else}#007bff{/if};
            color: #fff;
            padding: 15px;
            font-size: 1.5rem;
            border-top-left-radius: 15px;
            border-top-right-radius: 15px;
            border-radius: 15px 15px 0 0;
            text-align: center;
            margin: 0; /* Remove margin to touch top */
        }

        .panel-body {
            padding: 20px;
            font-size: 1.1rem;
            text-align: center;
        }

        .panel-footer {
            padding: 10px;
        }

        .btn-block {
            background-color: {if $type == 'success'}#28a745{elseif $type == 'danger'}#dc3545{else}#007bff{/if};
            color: #fff;
            border-radius: 25px;
            padding: 15px;
            text-decoration: none;
            transition: background-color 0.3s;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            max-width: 200px;
            margin: 0 auto;
        }

        .btn-block:hover {
            background-color: {if $type == 'success'}#218838{elseif $type == 'danger'}#c82333{else}#0056b3{/if};
        }

        .lockscreen-footer {
            margin-top: 20px;
            font-size: 0.9rem;
            color: #ddd;
        }

        @media (max-width: 480px) {
            .lockscreen-wrapper {
                max-width: 90%;
                padding: 15px;
            }

            .panel-heading {
                font-size: 1.25rem;
            }

            .panel-body {
                font-size: 1rem;
            }
        }
    </style>
</head>

<body class="hold-transition lockscreen">
    <div class="lockscreen-wrapper">
        <div class="panel panel-{$type}">
            <div class="panel-heading">{ucwords(Lang::T($type))}</div>
            <div class="panel-body">
                <p>{$text}</p>
            </div>
            <div class="panel-footer">
                <a href="{$url}" id="button" class="btn btn-block">{Lang::T('Click Here')} (0)</a>
            </div>
        </div>
        <div class="lockscreen-footer text-center">
            {$_c['CompanyName']}
        </div>
    </div>

    <script>
        var time = {$time};
        timer();

        function timer() {
            setTimeout(() => {
                time--;
                if (time > -1) {
                    document.getElementById("button").innerHTML = "{Lang::T('Click Here')} (" + time + ")";
                    timer();
                } else {
                    window.location.href = "{$url}"; // Redirect after countdown
                }
            }, 1000);
        }
    </script>
</body>

</html>
