<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Aadimjuth</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <!-- Bootstrap & Font Awesome -->
        <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">

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

        <style>
            body {
                background-color: #f8f9fa;
            }
            .sidebar {
                height: 100vh;
                background-color: #1e3d59;
                color: white;
            }
            .sidebar a {
                color: white;
                text-decoration: none;
            }
            .sidebar a:hover {
                background-color: #3a6073;
                color: white;
            }
            .navbar {
                background-color: #1e3d59;
            }
            .navbar-brand {
                font-weight: bold;
                color: white;
            }
            .navbar-brand span {
                color: #ff4c4c;
            }
            .dropdown-menu a:hover {
                background-color: #f1f1f1;
            }
        </style>
    </head>
    <body>

        <!-- Top Navbar -->
        <nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #00695C;">
            <div class="container-fluid">
                <a class="navbar-brand" href="#"><span style="color: #00e676">Adim</span><span>Juth</span></a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarDropdown">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse justify-content-end" id="navbarDropdown">
                    <ul class="navbar-nav">
                        <li class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle d-flex align-items-center" href="#" role="button" data-bs-toggle="dropdown">
                                <img src="assets/images/hd1.jpg" class="rounded-circle me-2" height="35" width="35" alt="">
                                Admin
                            </a>
                            <ul class="dropdown-menu dropdown-menu-end">
                                <li><a class="dropdown-item" href="#">Profile</a></li>
                                <li><hr class="dropdown-divider"></li>
                                <li><a class="dropdown-item" id="btn-logout" href="#">Logout</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>

        <!-- Page Layout -->
        <div class="container-fluid">
            <div class="row">
                <!-- Sidebar -->
                <div class="col-md-3 col-lg-2 p-3 sidebar">
                    <h5 class="text-white mb-4">Navigation</h5>
                    <ul class="nav flex-column">
                        <li class="nav-item"><a href="user_dashboard.php" class="nav-link">📊 Dashboard</a></li>
                        <li class="nav-item"><a href="add_entry.php" class="nav-link">👨‍👩‍👧‍👦 Patrak 1 Family</a></li>
                        <!--<li class="nav-item"><a href="patrak_1_family_entry.php" class="nav-link">👨‍👩‍👧‍👦 Patrak 1 Family</a></li>-->
                        <li class="nav-item"><a href="patrak_2_common_entry.php" class="nav-link">📋 Patrak 2 Common</a></li>
                        <li class="nav-item mt-4"><strong>Reports</strong></li>
                        <li class="nav-item"><a href="patrak_1_family_detail_report.php" class="nav-link">📑 Patrak 1 Report</a></li>
                        <li class="nav-item"><a href="patrak_2_common_detail_report.php" class="nav-link">📑 Patrak 2 Report</a></li>
                    </ul>
                </div>

                <!-- Main Content -->
                <div class="col-md-9 col-lg-10 p-4">
<!--                    <h2>Welcome to Aadimjuth Dashboard</h2>
                    <p>Use the sidebar to navigate through the application features.</p>
                    Add dynamic content here -->

                    <script>
                        $(document).ready(function () {

                            $('.btn').focus(function () {
                    //            alert("focus");
                                $(this).css({'border': '2px solid #3f6ad8'});
                            });
                            $('#btn-logout').click(function () {
                                    alert('logout');
                                var send = {'logout': 'logout'};
                                $.ajax({
                                    url: './PHP_Code/session_destroy.php',
                                    type: 'POST',
                                    data: send,
                                    success: function (data)
                                    {
                                        debugger;
                    //                        alert('data ' + data);
                                        window.location.href = "./login.php";
                                    },
                                    error: function (err) {
                                        alert('error ' + err);
                                    }
                                });
                            });
                        });
                    </script>