<?php
// Security Headers
header("X-Frame-Options: SAMEORIGIN");
header("X-XSS-Protection: 1; mode=block");
header("X-Content-Type-Options: nosniff");
?>

<!DOCTYPE html>
<html>
<head>
<title><?= $pageTitle ?? 'Dashboard' ?></title>

<meta name="viewport" content="width=device-width, initial-scale=1">

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">


<style>

/* SIDEBAR */
.sidebar {
    width: 240px;
    height: 100vh;
    background: #1e2a38;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px;
    transition: 0.3s;
}
.sidebar a.active {
    background: #0d6efd;
    color: #fff;
    border-radius: 5px;
}


.sidebar a {
    display: block;
    color: #fff;
    padding: 10px;
    margin-bottom: 5px;
    text-decoration: none;
}

.sidebar a:hover {
    background: #2c3e50;
}

/* CONTENT */
.main-content {
    margin-left: 240px;
    transition: 0.3s;
}

/* TOPBAR */
.topbar {
    background: #fff;
    padding: 10px 20px;
    border-bottom: 1px solid #ddd;
}

/* MOBILE */
@media(max-width: 768px){

    .sidebar {
        left: -240px;
		z-index:99999
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

}

#overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    top: 0;
    left: 0;
    display: none;
    z-index: 998;
}

.sidebar {
    z-index: 999;
}

/* Show overlay when active */
.sidebar.active ~ #overlay {
    display: block;
}


</style>
</head>

<body>


<div id="overlay" onclick="closeSidebar()"></div>

<script>
function toggleSidebar(){
    document.getElementById("sidebar").classList.toggle("active");
}
</script>
