<?php
require_once __DIR__ . "/MaintenanceCheck.php";
session_start();
$isLoggedIn = isset($_SESSION["user"]);

if (isset($_SESSION["user"])) {

    require "Auth/db.php";

    $stmt = $pdo->prepare("SELECT is_banned FROM users WHERE id = ?");
    $stmt->execute([$_SESSION["user"]["id"]]);

    $checkUser = $stmt->fetch(PDO::FETCH_ASSOC);

    if (!empty($checkUser["is_banned"])) {

        session_destroy();

        header("Location: /Banned.php");
        exit;
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Banned - Rewire</title>
<link rel="icon" type="image/png" href="Assets/Logo.png">

<style>
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial,sans-serif;
}

body{
    background:#050505;
    color:white;
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.ban-box{
    width:100%;
    max-width:650px;
    background:#071014;
    border:1px solid rgba(255,0,0,0.18);
    border-radius:22px;
    padding:50px;
    text-align:center;
    box-shadow:0 0 40px rgba(255,0,0,0.08);
}

.ban-title{
    font-size:4rem;
    font-weight:900;
    color:#ff3b3b;
    margin-bottom:10px;
    text-shadow:0 0 20px rgba(255,59,59,0.4);
}

.ban-sub{
    font-size:1.15rem;
    color:#c8d0d8;
    margin-bottom:35px;
}

.ban-reason{
    background:#050505;
    border:1px solid rgba(255,255,255,0.08);
    border-radius:16px;
    padding:22px;
    margin-bottom:30px;
}

.reason-label{
    color:#7d8894;
    font-size:0.78rem;
    font-weight:800;
    letter-spacing:1px;
    margin-bottom:12px;
}

.reason-text{
    font-size:1rem;
    color:white;
    font-weight:700;
}

.logout-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    height:52px;
    padding:0 26px;
    border-radius:12px;
    background:linear-gradient(135deg,#ff3b3b,#b30000);
    color:white;
    text-decoration:none;
    font-weight:800;
    transition:0.25s ease;
}

.logout-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 25px rgba(255,0,0,0.35);
}

.discord-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:12px 22px;
    border-radius:12px;
    text-decoration:none;
    font-weight:800;
    font-size:0.95rem;
    color:white;

    background:linear-gradient(135deg,#5865F2,#4752C4);

    border:1px solid rgba(255,255,255,0.08);

    transition:0.25s ease;
    box-shadow:0 8px 22px rgba(88,101,242,0.28);
}

.discord-btn:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 28px rgba(88,101,242,0.42);
    background:linear-gradient(135deg,#6975ff,#5865F2);
}
</style>
</head>
<body>
<?php include "Preloader.php"; ?>
<div class="ban-box">

    <div class="ban-title">
        BANNED
    </div>

    <div class="ban-sub">
        Your Access To Rewire Has Been Restricted.
    </div>

    <div class="ban-reason">
        <div class="reason-label">
            ACCOUNT STATUS
        </div>

        <div class="reason-text">
            This Account Has Been Permnatntly Banned From Accessing Our Serivces, Please Contact Staff Within Our Discord If You Believe This Is a Mistake.
        </div>
    </div>

    <a href="https://discord.gg/rewire" target="_blank" class="discord-btn">
        Discord
    </a>

</div>
<script src="Security.js"></script>
</body>
</html>