<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <title><?php echo $__env->yieldContent('title', 'Admin'); ?> — <?php echo e($siteName ?? config('app.name')); ?> Admin</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
    <style>
        * { box-sizing: border-box; }
        body { font-family: 'Inter', sans-serif; background: #f0f2f5; color: #1a1a2e; }

        /* Sidebar */
        .admin-sidebar {
            width: 250px;
            min-height: 100vh;
            background: #1a1a2e;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 200;
            display: flex;
            flex-direction: column;
        }
        .sidebar-brand {
            padding: 20px 20px 16px;
            border-bottom: 1px solid #2d2d4a;
        }
        .sidebar-brand a {
            font-size: 1.15rem;
            font-weight: 700;
            color: #fff;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .sidebar-brand small { font-size: .68rem; color: #888; display: block; margin-top: 2px; }
        .sidebar-nav { padding: 12px 0; flex: 1; overflow-y: auto; }
        .nav-section-label {
            font-size: .65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            color: #555;
            padding: 10px 20px 4px;
        }
        .sidebar-nav .nav-link {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 9px 20px;
            color: #a0a8c0;
            font-size: .85rem;
            font-weight: 500;
            border-radius: 0;
            transition: background .15s, color .15s;
            border-left: 3px solid transparent;
        }
        .sidebar-nav .nav-link:hover,
        .sidebar-nav .nav-link.active {
            background: rgba(255,255,255,.06);
            color: #fff;
            border-left-color: #4f46e5;
        }
        .sidebar-nav .nav-link .bi { font-size: 1rem; }

        /* Main wrapper */
        .admin-main {
            margin-left: 250px;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }
        .admin-topbar {
            background: #fff;
            border-bottom: 1px solid #e5e7eb;
            padding: 12px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 100;
        }
        .admin-topbar .page-title { font-size: 1rem; font-weight: 600; color: #1a1a2e; }
        .topbar-actions { display: flex; align-items: center; gap: 12px; }
        .admin-content { padding: 24px; flex: 1; }

        /* Cards */
        .card { border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
        .card-header { background: #fff; border-bottom: 1px solid #e5e7eb; font-weight: 600; font-size: .9rem; }
        .stat-card { border: none; border-radius: 10px; padding: 20px; }
        .stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }

        /* Table */
        .table { font-size: .85rem; }
        .table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; color: #6b7280; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }

        /* Alert */
        .alert { border-radius: 8px; font-size: .85rem; }

        /* Upload zone */
        .upload-zone {
            border: 2px dashed #d1d5db;
            border-radius: 8px;
            padding: 40px;
            text-align: center;
            cursor: pointer;
            transition: border-color .2s, background .2s;
        }
        .upload-zone:hover, .upload-zone.drag-over {
            border-color: #4f46e5;
            background: #f5f3ff;
        }
        .upload-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
        .upload-preview-item { position: relative; width: 100px; }
        .upload-preview-item img { width: 100px; height: 130px; object-fit: cover; border-radius: 4px; border: 1px solid #ddd; }
        .upload-preview-item .remove-btn { position: absolute; top: -6px; right: -6px; background: #ef4444; color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: .7rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

        /* Hotspot editor */
        .hotspot-canvas { position: relative; display: inline-block; user-select: none; }
        .hotspot-canvas img { max-width: 100%; display: block; }
        .hotspot-rect {
            position: absolute;
            border: 2px solid #4f46e5;
            background: rgba(79,70,229,.15);
            cursor: pointer;
            transition: background .15s;
        }
        .hotspot-rect:hover { background: rgba(79,70,229,.3); }
        .hotspot-rect .delete-btn {
            position: absolute;
            top: -8px;
            right: -8px;
            background: #ef4444;
            color: #fff;
            border: none;
            border-radius: 50%;
            width: 18px;
            height: 18px;
            font-size: .65rem;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
        }
        .hotspot-rect:hover .delete-btn { display: flex; }

        @media (max-width: 768px) {
            .admin-sidebar { transform: translateX(-100%); transition: transform .3s; }
            .admin-sidebar.show { transform: translateX(0); }
            .admin-main { margin-left: 0; }
        }
    </style>
    <?php echo $__env->yieldPushContent('styles'); ?>
</head>
<body>

<aside class="admin-sidebar" id="adminSidebar">
    <div class="sidebar-brand">
        <a href="<?php echo e(route('admin.dashboard')); ?>">
            <i class="bi bi-newspaper"></i>
            <div>
                <span><?php echo e($siteName ?? config('app.name')); ?></span>
                <small>Admin Panel</small>
            </div>
        </a>
    </div>

    <nav class="sidebar-nav">
        <div class="nav-section-label">Main</div>
        <a class="nav-link <?php echo e(request()->routeIs('admin.dashboard') ? 'active' : ''); ?>" href="<?php echo e(route('admin.dashboard')); ?>">
            <i class="bi bi-speedometer2"></i> Dashboard
        </a>

        <div class="nav-section-label mt-1">Content</div>
        <a class="nav-link <?php echo e(request()->routeIs('admin.newspapers.*') ? 'active' : ''); ?>" href="<?php echo e(route('admin.newspapers.index')); ?>">
            <i class="bi bi-newspaper"></i> Newspapers
        </a>

        <div class="nav-section-label mt-1">Pages</div>
        <a class="nav-link <?php echo e(request()->routeIs('admin.static-pages.*') ? 'active' : ''); ?>"
           href="<?php echo e(route('admin.static-pages.index')); ?>">
            <i class="bi bi-file-earmark-text"></i> Pages
        </a>

        <div class="nav-section-label mt-1">Navigation</div>
        <a class="nav-link <?php echo e(request()->routeIs('admin.menu.*') ? 'active' : ''); ?>" href="<?php echo e(route('admin.menu.index')); ?>">
            <i class="bi bi-list-ul"></i> Menu
        </a>

        <div class="nav-section-label mt-1">Media</div>
        <a class="nav-link <?php echo e(request()->routeIs('admin.media.*') ? 'active' : ''); ?>" href="<?php echo e(route('admin.media.index')); ?>">
            <i class="bi bi-images"></i> Image Gallery
        </a>

        <div class="nav-section-label mt-1">System</div>
        <a class="nav-link <?php echo e(request()->routeIs('admin.settings.*') ? 'active' : ''); ?>" href="<?php echo e(route('admin.settings.index')); ?>">
            <i class="bi bi-gear"></i> Settings
        </a>
        <a class="nav-link" href="<?php echo e(route('home')); ?>" target="_blank">
            <i class="bi bi-box-arrow-up-right"></i> View Site
        </a>
        <a class="nav-link text-danger-emphasis"
           href="<?php echo e(route('logout')); ?>"
           onclick="event.preventDefault();document.getElementById('admin-logout').submit()">
            <i class="bi bi-box-arrow-right"></i> Logout
        </a>
        <form id="admin-logout" action="<?php echo e(route('logout')); ?>" method="POST" class="d-none"><?php echo csrf_field(); ?></form>
    </nav>
</aside>

<div class="admin-main">
    <header class="admin-topbar">
        <div class="d-flex align-items-center gap-3">
            <button class="btn btn-sm btn-light d-md-none" id="sidebarToggle"><i class="bi bi-list"></i></button>
            <span class="page-title"><?php echo $__env->yieldContent('title', 'Dashboard'); ?></span>
        </div>
        <div class="topbar-actions">
            <span class="text-muted" style="font-size:.8rem"><?php echo e(auth()->user()->name); ?></span>
            <a href="<?php echo e(route('admin.newspapers.create')); ?>" class="btn btn-sm btn-primary">
                <i class="bi bi-plus"></i> New Edition
            </a>
        </div>
    </header>

    <div class="admin-content">
        <?php if(session('success')): ?>
            <div class="alert alert-success alert-dismissible fade show mb-3" role="alert">
                <i class="bi bi-check-circle me-2"></i><?php echo e(session('success')); ?>

                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        <?php endif; ?>
        <?php if(session('error')): ?>
            <div class="alert alert-danger alert-dismissible fade show mb-3" role="alert">
                <i class="bi bi-exclamation-circle me-2"></i><?php echo e(session('error')); ?>

                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        <?php endif; ?>
        <?php if($errors->any()): ?>
            <div class="alert alert-danger mb-3">
                <ul class="mb-0 ps-3"><?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $e): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><li><?php echo e($e); ?></li><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></ul>
            </div>
        <?php endif; ?>

        <?php echo $__env->yieldContent('content'); ?>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.getElementById('sidebarToggle')?.addEventListener('click', function() {
    document.getElementById('adminSidebar').classList.toggle('show');
});
</script>
<?php echo $__env->yieldPushContent('scripts'); ?>
</body>
</html>
<?php /**PATH /home/boguraj1/public_html/epaper/resources/views/layouts/admin.blade.php ENDPATH**/ ?>