<?php
require_once 'includes/conn.php';
require_once 'includes/functions.php';

enforceAccessControl($pdo);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Restricted Access</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <style>
        :root {
            --primary: #1e293b;
            --danger: #dc2626;
            --warning-bg: #fff1f2;
            --text-dark: #0f172a;
            --text-muted: #475569;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: "Segoe UI", Tahoma, Arial, sans-serif;
        }

        body {
            min-height: 100vh;
            background: linear-gradient(135deg, #0f172a, #1e293b);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .restricted-card {
            background: #ffffff;
            max-width: 480px;
            width: 100%;
            border-radius: 12px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.25);
            overflow: hidden;
            animation: fadeIn 0.4s ease-in-out;
        }

        .restricted-header {
            background: var(--danger);
            color: #ffffff;
            padding: 24px;
            text-align: center;
        }

        .restricted-header h1 {
            font-size: 1.6rem;
            margin-bottom: 6px;
        }

        .restricted-header p {
            font-size: 0.9rem;
            opacity: 0.95;
        }

        .restricted-body {
            padding: 28px;
            color: var(--text-dark);
        }

        .restricted-body p {
            margin-bottom: 14px;
            line-height: 1.6;
            color: var(--text-muted);
            font-size: 0.95rem;
        }

        .notice-box {
            background: var(--warning-bg);
            border-left: 4px solid var(--danger);
            padding: 12px 14px;
            margin: 18px 0;
            font-size: 0.9rem;
            color: #7f1d1d;
        }

        .actions {
            margin-top: 22px;
            display: flex;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
        }

        .btn {
            flex: 1;
            text-align: center;
            padding: 10px 14px;
            border-radius: 6px;
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 600;
            transition: all 0.2s ease;
        }

        .btn-logout {
            background: var(--danger);
            color: #fff;
        }

        .btn-logout:hover {
            background: #b91c1c;
        }

        .btn-profile {
            background: #e2e8f0;
            color: #1e293b;
        }

        .btn-profile:hover {
            background: #cbd5f5;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @media (max-width: 480px) {
            .restricted-header h1 {
                font-size: 1.3rem;
            }
        }
    </style>
</head>
<body>

    <div class="restricted-card">
        <div class="restricted-header">
            <h1>Account Restricted</h1>
            <p>Limited system access</p>
        </div>

        <div class="restricted-body">
            <p>
                Your account has been restricted by the system administrator.
                Some features and pages are currently unavailable.
            </p>

            <div class="notice-box">
                If you believe this is a mistake, please contact the school administration
                for clarification or reactivation.
            </div>

            <div class="actions">
                <a href="profile.php" class="btn btn-profile">View Profile</a>
                <a href="logout.php" class="btn btn-logout">Logout</a>
            </div>
        </div>
    </div>

</body>
</html>
