<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= $page_title ?? 'Dashboard' ?> | Festival Land Admin</title>
    <!-- Bootstrap 5 RTL -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.rtl.min.css">
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap" rel="stylesheet">
    <!-- FontAwesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            font-family: 'Cairo', sans-serif;
            background-color: #f8f9fa;
        }
        .sidebar {
            width: 250px;
            height: 100vh;
            position: fixed;
            top: 0;
            right: 0;
            background: linear-gradient(180deg, #0056B3 0%, #003d7e 100%);
            color: white;
            padding-top: 20px;
            z-index: 1000;
        }
        .main-content {
            margin-right: 250px;
            padding: 30px;
        }
        .nav-link {
            color: rgba(255, 255, 255, 0.8);
            margin: 5px 15px;
            border-radius: 10px;
            padding: 12px 20px;
            transition: 0.3s;
        }
        .nav-link:hover, .nav-link.active {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }
        .card {
            border: none;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        }
        .btn-primary {
            background-color: #0056B3;
            border: none;
            border-radius: 10px;
            padding: 10px 20px;
        }
        .badge-pending { background-color: #ffc107; color: #000; }
        .badge-approved { background-color: #198754; }
        .badge-cancelled { background-color: #dc3545; }
    </style>
</head>
<body>
    <div class="sidebar shadow">
        <div class="text-center mb-4">
            <h4 class="fw-bold">Festival Land</h4>
            <span class="badge bg-warning text-dark">لوحة التحكم الجديدة</span>
        </div>
        <nav class="nav flex-column">
            <a class="nav-link <?= (basename($_SERVER['PHP_SELF']) == 'index.php') ? 'active' : '' ?>" href="index.php">
                <i class="fas fa-chart-line me-2"></i> الإحصائيات
            </a>
            <a class="nav-link <?= (basename($_SERVER['PHP_SELF']) == 'games.php') ? 'active' : '' ?>" href="games.php">
                <i class="fas fa-gamepad me-2"></i> الألعاب
            </a>
            <a class="nav-link <?= (basename($_SERVER['PHP_SELF']) == 'bookings.php') ? 'active' : '' ?>" href="bookings.php">
                <i class="fas fa-calendar-check me-2"></i> الحجوزات
            </a>
            <a class="nav-link <?= (basename($_SERVER['PHP_SELF']) == 'users.php') ? 'active' : '' ?>" href="users.php">
                <i class="fas fa-users me-2"></i> المستخدمين
            </a>
            <a class="nav-link <?= (basename($_SERVER['PHP_SELF']) == 'settings.php') ? 'active' : '' ?>" href="settings.php">
                <i class="fas fa-cog me-2"></i> الإعدادات
            </a>
            <hr class="mx-3 text-white-50">
            <a class="nav-link text-danger" href="logout.php">
                <i class="fas fa-sign-out-alt me-2"></i> تسجيل الخروج
            </a>
        </nav>
    </div>

    <div class="main-content">
        <header class="d-flex justify-content-between align-items-center mb-4">
            <h2 class="fw-bold text-dark"><?= $page_title ?></h2>
            <div class="dropdown">
                <button class="btn btn-white shadow-sm dropdown-toggle" type="button" data-bs-toggle="dropdown">
                    <img src="https://ui-avatars.com/api/?name=Admin&background=0056B3&color=fff" class="rounded-circle me-2" width="30">
                    المدير العام
                </button>
            </div>
        </header>

        <?= $content ?>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
