<?php
session_start();
require_once 'includes/translation.php';

$lang = Translation::getLanguage();
$dir  = Translation::getDirection();
?>
<!DOCTYPE html>
<html lang="<?php echo $lang; ?>" dir="<?php echo $dir; ?>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo __('access_denied', 'غير مصرح'); ?> - <?php echo __('system_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.0.0/css/all.min.css" rel="stylesheet">
    <link href="assets/css/rtl-ltr.css" rel="stylesheet">
    <style>
        body {
            background: #f8fafc;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Cairo', 'Tajawal', sans-serif;
        }
        .error-box {
            background: white;
            border-radius: 20px;
            padding: 60px 40px;
            text-align: center;
            box-shadow: 0 10px 40px rgba(0,0,0,0.1);
            max-width: 480px;
            width: 100%;
        }
        .error-icon {
            font-size: 5rem;
            color: #ef4444;
            margin-bottom: 1.5rem;
        }
        .error-code {
            font-size: 4rem;
            font-weight: 800;
            color: #1e293b;
            line-height: 1;
            margin-bottom: 0.5rem;
        }
        .error-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: #475569;
            margin-bottom: 1rem;
        }
        .error-message {
            color: #64748b;
            margin-bottom: 2rem;
            font-size: 1rem;
        }
    </style>
</head>
<body>
    <div class="error-box">
        <div class="error-icon"><i class="fas fa-lock"></i></div>
        <div class="error-code">403</div>
        <div class="error-title">
            <?php echo $lang === 'ar' ? 'غير مصرح بالوصول' : 'Access Denied'; ?>
        </div>
        <p class="error-message">
            <?php echo $lang === 'ar'
                ? 'ليس لديك صلاحية للوصول إلى هذه الصفحة. يرجى التواصل مع المدير إذا كنت تعتقد أن هذا خطأ.'
                : 'You do not have permission to access this page. Please contact the administrator if you believe this is an error.'; ?>
        </p>
        <div class="d-flex gap-3 justify-content-center flex-wrap">
            <a href="admin_dashboard.php" class="btn btn-primary">
                <i class="fas fa-home me-2"></i>
                <?php echo $lang === 'ar' ? 'لوحة التحكم' : 'Dashboard'; ?>
            </a>
            <a href="javascript:history.back()" class="btn btn-outline-secondary">
                <i class="fas fa-arrow-<?php echo $dir === 'rtl' ? 'right' : 'left'; ?> me-2"></i>
                <?php echo $lang === 'ar' ? 'رجوع' : 'Go Back'; ?>
            </a>
        </div>
    </div>
</body>
</html>

