<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Dashboard - Ruhan Vlog</title>
    <link rel="stylesheet" href="/css/style.css">
    <!-- Font Awesome for icons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            margin: 0;
            padding: 0;
            display: flex;
            min-height: 100vh;
            background-color: #080b12;
            color: #f8fafc;
        }

        .sidebar {
            width: 250px;
            background-color: #1e293b;
            color: white;
            padding: 20px 0;
            display: flex;
            flex-direction: column;
        }

        .sidebar-header {
            padding: 0 20px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            margin-bottom: 20px;
        }

        .sidebar-header h2 {
            color: #f59e0b;
            margin: 0;
            font-size: 1.5rem;
        }

        .sidebar-nav {
            flex-grow: 1;
        }

        .sidebar-nav a {
            display: block;
            padding: 12px 20px;
            color: #cbd5e1;
            text-decoration: none;
            transition: all 0.3s ease;
            border-left: 3px solid transparent;
        }

        .sidebar-nav a:hover,
        .sidebar-nav a.active {
            background-color: rgba(255, 255, 255, 0.05);
            color: white;
            border-left-color: #f59e0b;
        }

        .sidebar-nav a i {
            width: 25px;
        }

        .nav-category {
            padding: 15px 20px 5px;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: #64748b;
            font-weight: 700;
        }

        .main-content {
            flex-grow: 1;
            padding: 30px 40px;
            overflow-y: auto;
            height: 100vh;
            box-sizing: border-box;
        }

        .admin-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            padding-bottom: 15px;
            border-bottom: 1px solid #1e293b;
        }

        .admin-section {
            background: var(--bg-dark);
            padding: 25px;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
            margin-bottom: 30px;
        }

        .admin-section h3 {
            margin-top: 0;
            border-bottom: 1px solid #f1f5f9;
            padding-bottom: 15px;
            margin-bottom: 20px;
            color: #1e293b;
        }

        .grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        .table-responsive {
            overflow-x: auto;
        }

        table {
            width: 100%;
            text-align: left;
            border-collapse: collapse;
        }

        table th,
        table td {
            padding: 12px 15px;
            border-bottom: 1px solid #e2e8f0;
        }

        table th {
            background-color: #f8fafc;
            font-weight: 600;
            color: #475569;
        }
    </style>
</head>

<body>

    <!-- Sidebar -->
    <div class="sidebar">
        <div class="sidebar-header">
            <h2>Ruhan Admin</h2>
        </div>
        <nav class="sidebar-nav">
            <div class="nav-category">General</div>
            <a href="/admin" class="<%= typeof activePage !== 'undefined' && activePage === 'dashboard' ? 'active' : '' %>"><i class="fas fa-home"></i> Dashboard</a>
            <a href="/admin/sections" class="<%= typeof activePage !== 'undefined' && activePage === 'sections' ? 'active' : '' %>"><i class="fas fa-layer-group"></i> Website Sections</a>
            <a href="/admin/socials" class="<%= typeof activePage !== 'undefined' && activePage === 'socials' ? 'active' : '' %>"><i class="fas fa-share-nodes"></i> Social Links</a>
            <a href="/admin/settings" class="<%= typeof activePage !== 'undefined' && activePage === 'settings' ? 'active' : '' %>"><i class="fas fa-cog"></i> Global Settings</a>
            <a href="/admin/submissions" class="<%= typeof activePage !== 'undefined' && activePage === 'submissions' ? 'active' : '' %>"><i class="fas fa-envelope"></i> Contact Submissions</a>

            <div class="nav-category">Home Page</div>
            <a href="/admin/videos" class="<%= typeof activePage !== 'undefined' && activePage === 'videos' ? 'active' : '' %>"><i class="fas fa-video"></i> Manage Videos</a>
            <a href="/admin/blogs" class="<%= typeof activePage !== 'undefined' && activePage === 'blogs' ? 'active' : '' %>"><i class="fas fa-pen-nib"></i> Manage Blogs</a>
            <a href="/admin/gallery" class="<%= typeof activePage !== 'undefined' && activePage === 'gallery' ? 'active' : '' %>"><i class="fas fa-images"></i> Manage Gallery</a>

            <div class="nav-category">About Page</div>
            <a href="/admin/about-slider" class="<%= typeof activePage !== 'undefined' && activePage === 'about-slider' ? 'active' : '' %>"><i class="fas fa-images"></i> About Slider</a>
            <a href="/admin/stats" class="<%= typeof activePage !== 'undefined' && activePage === 'stats' ? 'active' : '' %>"><i class="fas fa-chart-bar"></i> Manage Stats</a>

            <div class="nav-category">Countries Page</div>
            <a href="/admin/countries" class="<%= typeof activePage !== 'undefined' && activePage === 'countries' ? 'active' : '' %>"><i class="fas fa-globe-asia"></i> Manage Countries</a>
            <a href="/admin/travel-memories" class="<%= typeof activePage !== 'undefined' && activePage === 'travel-memories' ? 'active' : '' %>"><i class="fas fa-camera"></i> Travel Memories</a>

            <div class="nav-category">Collaborations Page</div>
            <a href="/admin/services" class="<%= typeof activePage !== 'undefined' && activePage === 'services' ? 'active' : '' %>"><i class="fas fa-concierge-bell"></i> Services & Collab</a>
            <a href="/admin/testimonials" class="<%= typeof activePage !== 'undefined' && activePage === 'testimonials' ? 'active' : '' %>"><i class="fas fa-star"></i> Testimonials</a>
        </nav>
        <div style="padding: 20px;">
            <a href="/" target="_blank" class="btn-outline"
                style="display: block; text-align: center; margin-bottom: 10px; width: 100%; box-sizing: border-box; padding: 10px;"><i
                    class="fas fa-external-link-alt"></i> View Site</a>
            <a href="/admin/profile" class="<%= typeof activePage !== 'undefined' && activePage === 'profile' ? 'btn-primary' : 'btn-outline' %>"
                style="display: block; text-align: center; margin-bottom: 10px; width: 100%; box-sizing: border-box; padding: 10px; <%= typeof activePage !== 'undefined' && activePage === 'profile' ? '' : 'color: #cbd5e1; border-color: #475569;' %>"><i
                    class="fas fa-user-circle"></i> My Profile</a>
            <a href="/admin/logout" class="btn-primary"
                style="display: block; text-align: center; width: 100%; box-sizing: border-box; padding: 10px; background-color: #ef4444;"><i
                    class="fas fa-sign-out-alt"></i> Logout</a>
        </div>
    </div>

    <!-- Main Content -->
    <div class="main-content">
        <div class="admin-header">
            <h2 style="margin: 0; color: #1e293b;">
                <%= typeof pageTitle !=='undefined' ? pageTitle : 'Dashboard' %>
            </h2>
        </div>