<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $__env->yieldContent('title', 'Recruiter Dashboard'); ?> | Munchify Careers</title>
    
    <!-- Google Fonts: Sora -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    
    <!-- Alpine.js -->
    <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>

    <!-- FontAwesome Icons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <?php echo app('Illuminate\Foundation\Vite')(['resources/css/app.css']); ?>
    <?php echo $__env->yieldContent('styles'); ?>
</head>
<body class="bg-[#F7F8FA] font-sans antialiased text-[#111318] min-h-screen flex" x-data="{ sidebarOpen: false }">

    <!-- 1. LEFT SIDEBAR -->
    <aside class="w-64 bg-[#111318] text-white flex flex-col fixed h-screen z-40 transition-all duration-300 md:translate-x-0"
           :class="sidebarOpen ? 'translate-x-0' : '-translate-x-64'">
        
        <!-- Sidebar Logo Header -->
        <div class="p-6 border-b border-white/5 flex items-center justify-between">
            <a href="<?php echo e(route('dashboard.overview')); ?>" class="flex items-center gap-2">
                <div class="w-8 h-8 rounded-lg bg-[#FF6B00] flex items-center justify-center text-white font-extrabold text-lg">
                    M
                </div>
                <div class="flex flex-col">
                    <span class="font-extrabold tracking-tight text-sm">Munchify Recruiter</span>
                    <span class="text-[9px] text-[#FFD233] uppercase tracking-wider font-semibold">Workspace</span>
                </div>
            </a>
            
            <button class="md:hidden text-gray-400 hover:text-white" @click="sidebarOpen = false">
                <i class="fa-solid fa-xmark"></i>
            </button>
        </div>

        <!-- Sidebar Navigation List -->
        <nav class="flex-grow p-4 space-y-1.5 overflow-y-auto">
            <a href="<?php echo e(route('dashboard.overview')); ?>" class="sidebar-link <?php echo e(Request::routeIs('dashboard.overview') ? 'sidebar-link-active' : ''); ?>">
                <i class="fa-solid fa-chart-pie w-5"></i> Overview
            </a>
            
            <a href="<?php echo e(route('jobs.manage')); ?>" class="sidebar-link <?php echo e(Request::routeIs('jobs.*') ? 'sidebar-link-active' : ''); ?>">
                <i class="fa-solid fa-briefcase w-5"></i> Jobs
            </a>
            
            <a href="<?php echo e(route('applications.index')); ?>" class="sidebar-link <?php echo e(Request::routeIs('applications.*') ? 'sidebar-link-active' : ''); ?>">
                <i class="fa-solid fa-user-group w-5"></i> Candidates
            </a>
            
            <a href="<?php echo e(route('interviews.index')); ?>" class="sidebar-link <?php echo e(Request::routeIs('interviews.*') ? 'sidebar-link-active' : ''); ?>">
                <i class="fa-solid fa-calendar-days w-5"></i> Interviews
            </a>

            <?php if(Auth::user()->canManageJobs()): ?>
            <a href="<?php echo e(route('pipelines.index')); ?>" class="sidebar-link <?php echo e(Request::routeIs('pipelines.*') ? 'sidebar-link-active' : ''); ?>">
                <i class="fa-solid fa-arrows-split-up-and-left w-5"></i> Pipelines
            </a>
            <?php endif; ?>

            <?php if(Auth::user()->hasRole('admin', 'hr_manager', 'hiring_manager')): ?>
            <a href="<?php echo e(route('analytics.index')); ?>" class="sidebar-link <?php echo e(Request::routeIs('analytics.index') ? 'sidebar-link-active' : ''); ?>">
                <i class="fa-solid fa-chart-line w-5"></i> Analytics
            </a>
            <?php endif; ?>

            <?php if(Auth::user()->canManageJobs()): ?>
            <a href="<?php echo e(route('settings.index')); ?>" class="sidebar-link <?php echo e(Request::routeIs('settings.*') ? 'sidebar-link-active' : ''); ?>">
                <i class="fa-solid fa-sliders w-5"></i> Settings
            </a>
            <?php endif; ?>

            <?php if(Auth::user()->isAdmin()): ?>
            <a href="<?php echo e(route('audit.index')); ?>" class="sidebar-link <?php echo e(Request::routeIs('audit.index') ? 'sidebar-link-active' : ''); ?>">
                <i class="fa-solid fa-clock-rotate-left w-5"></i> Audit Logs
            </a>
            <?php endif; ?>
        </nav>

        <!-- Sidebar User Profile Info -->
        <div class="p-4 border-t border-white/5 flex items-center justify-between">
            <div class="flex items-center gap-3">
                <div class="w-10 h-10 rounded-full bg-white/10 border border-white/10 flex items-center justify-center font-bold text-sm text-[#FFD233] uppercase">
                    <?php echo e(Auth::user()->initials); ?>

                </div>
                <div class="flex flex-col min-w-0">
                    <span class="font-bold text-xs truncate leading-none mb-1"><?php echo e(Auth::user()->full_name); ?></span>
                    <span class="text-[10px] text-gray-500 truncate capitalize"><?php echo e(Auth::user()->role_label); ?></span>
                </div>
            </div>
            
            <!-- Log Out Action Form -->
            <form action="<?php echo e(route('logout')); ?>" method="POST" class="inline">
                <?php echo csrf_field(); ?>
                <button type="submit" class="text-gray-500 hover:text-[#FF6B00] p-2 rounded-lg transition" title="Log Out">
                    <i class="fa-solid fa-right-from-bracket"></i>
                </button>
            </form>
        </div>
    </aside>

    <!-- 2. MAIN LAYOUT CONTAINER -->
    <div class="flex-grow md:pl-64 flex flex-col min-h-screen">
        
        <!-- TOP NAVBAR -->
        <header class="bg-white border-b border-gray-200 h-16 sticky top-0 z-30 flex items-center px-6 justify-between">
            <div class="flex items-center gap-4">
                <button class="md:hidden text-gray-500 hover:text-gray-700" @click="sidebarOpen = true">
                    <i class="fa-solid fa-bars text-lg"></i>
                </button>
                <h2 class="font-bold text-base md:text-lg text-[#111318]"><?php echo $__env->yieldContent('header_title', 'Recruiter Dashboard'); ?></h2>
            </div>

            <!-- Topbar right components -->
            <div class="flex items-center gap-4">
                <a href="<?php echo e(route('careers.home')); ?>" target="_blank" class="text-xs text-gray-500 hover:text-[#FF6B00] font-semibold flex items-center gap-1 border border-gray-200 rounded-full py-1.5 px-3">
                    <i class="fa-solid fa-globe"></i> Careers Site <i class="fa-solid fa-arrow-up-right-from-square text-[9px]"></i>
                </a>
            </div>
        </header>

        <!-- SESSION FLASH NOTIFICATIONS -->
        <?php if(session('success')): ?>
        <div class="mx-6 mt-4 p-4 bg-emerald-50 border border-emerald-200 rounded-xl text-emerald-800 text-xs font-semibold flex items-center gap-2 shadow-sm animate-fade-in">
            <i class="fa-solid fa-circle-check text-base text-emerald-500"></i>
            <span><?php echo e(session('success')); ?></span>
        </div>
        <?php endif; ?>

        <?php if($errors->any()): ?>
        <div class="mx-6 mt-4 p-4 bg-red-50 border border-red-200 rounded-xl text-red-800 text-xs font-semibold flex flex-col gap-1 shadow-sm animate-fade-in">
            <div class="flex items-center gap-2">
                <i class="fa-solid fa-circle-exclamation text-base text-red-500"></i>
                <span class="font-bold">Please correct the following errors:</span>
            </div>
            <ul class="list-disc pl-7 space-y-0.5 mt-1 text-[11px]">
                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li><?php echo e($error); ?></li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </div>
        <?php endif; ?>

        <!-- MAIN PAGE VIEW CONTENT -->
        <main class="flex-grow p-6">
            <?php echo $__env->yieldContent('content'); ?>
        </main>
    </div>

    <?php echo $__env->yieldContent('scripts'); ?>
</body>
</html>
<?php /**PATH /home/manuu/Projects/munchify/Munchify appointing/resources/views/layouts/dashboard.blade.php ENDPATH**/ ?>