<?php
require_once __DIR__ . '/config.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Unauthorized Access - <?= APP_NAME ?></title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <style>
        :root {
            --primary: #3b0b7c;
            --secondary: #6c4ab6;
        }
        body {
            background-color: #f8f9fa;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Inter', sans-serif;
        }
        .error-card {
            max-width: 500px;
            width: 100%;
            background: white;
            border-radius: 24px;
            padding: 40px;
            text-align: center;
            box-shadow: 0 20px 40px rgba(59, 11, 124, 0.1);
            border: 1px solid rgba(59, 11, 124, 0.05);
        }
        .icon-circle {
            width: 100px;
            height: 100px;
            background: #fff5f5;
            color: #dc3545;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 24px;
            font-size: 40px;
            border: 5px solid #fff;
            box-shadow: 0 10px 20px rgba(220, 53, 69, 0.15);
        }
        h1 {
            color: var(--primary);
            font-weight: 800;
            margin-bottom: 16px;
            font-size: 2rem;
        }
        p {
            color: #6c757d;
            font-size: 1.1rem;
            line-height: 1.6;
            margin-bottom: 30px;
        }
        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            border: none;
            padding: 12px 32px;
            border-radius: 12px;
            font-weight: 700;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .btn-primary:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(59, 11, 124, 0.2);
        }
        .btn-outline {
            border: 2px solid #e9ecef;
            padding: 12px 32px;
            border-radius: 12px;
            font-weight: 700;
            color: #6c757d;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-block;
        }
        .btn-outline:hover {
            background: #f8f9fa;
            border-color: #dee2e6;
            color: var(--primary);
        }
    </style>
</head>
<body>

<div class="error-card">
    <div class="icon-circle">
        <i class="fas fa-lock"></i>
    </div>
    <h1>Access Denied</h1>
    <p>Sorry, you don't have permission to access this page. Please contact your administrator if you believe this is an error.</p>
    
    <div class="d-flex flex-column gap-3">
        <a href="index.php" class="btn btn-primary shadow-sm">
            <i class="fas fa-home me-2"></i>Back to Home
        </a>
        <a href="javascript:history.back()" class="btn btn-outline">
            <i class="fas fa-arrow-left me-2"></i>Go Back
        </a>
    </div>
    
    <div class="mt-4 pt-4 border-top">
        <small class="text-muted">IP Logged: <?= $_SERVER['REMOTE_ADDR'] ?></small>
    </div>
</div>

</body>
</html>
