<!DOCTYPE html>
<html lang="id">
<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', 'Sistem Distribusi Qurban'); ?></title>
    
    <!-- Custom Style -->
    <link rel="stylesheet" href="<?php echo e(asset('css/app.css')); ?>">
    
    <!-- Icons (Optional, we can use simple emojis or SVG icons) -->
    <?php echo $__env->yieldContent('styles'); ?>
</head>
<body>
    <!-- Toast Messages -->
    <div class="toast-container">
        <?php if(session('success')): ?>
            <div class="toast toast-success" id="toast-success">
                <span class="toast-icon">✅</span>
                <div class="toast-content">
                    <span class="toast-message"><?php echo e(session('success')); ?></span>
                </div>
            </div>
        <?php endif; ?>

        <?php if(session('error') || $errors->any()): ?>
            <div class="toast toast-error" id="toast-error">
                <span class="toast-icon">⚠️</span>
                <div class="toast-content">
                    <span class="toast-message">
                        <?php if(session('error')): ?>
                            <?php echo e(session('error')); ?>

                        <?php else: ?>
                            <?php echo e($errors->first()); ?>

                        <?php endif; ?>
                    </span>
                </div>
            </div>
        <?php endif; ?>
    </div>

    <div class="app-container">
        <!-- Sidebar Navigation -->
        <aside class="sidebar">
            <div class="sidebar-brand">
                <div class="sidebar-brand-logo">🐏</div>
                <span class="sidebar-brand-name">QurbanDist</span>
            </div>

            <nav class="sidebar-menu">
                <li class="sidebar-menu-item <?php echo e(Request::is('/') || Request::is('dashboard') ? 'active' : ''); ?>">
                    <a href="<?php echo e(url('/dashboard')); ?>">
                        <span>📊</span> Dashboard
                    </a>
                </li>
                <li class="sidebar-menu-item <?php echo e(Request::is('distribution*') ? 'active' : ''); ?>">
                    <a href="<?php echo e(route('distribution.index')); ?>">
                        <span>🔍</span> Cari & Scan Kupon
                    </a>
                </li>
                <li class="sidebar-menu-item <?php echo e(Request::is('antrian-ambil-daging*') ? 'active' : ''); ?>">
                    <a href="<?php echo e(route('distribution.antrian')); ?>">
                        <span>📋</span> Antrean Ambil Daging
                    </a>
                </li>
                <li class="sidebar-menu-item <?php echo e(Request::is('paket-distribusi*') ? 'active' : ''); ?>">
                    <a href="<?php echo e(route('distribution.paket')); ?>">
                        <span>🎁</span> Paket Distribusi
                    </a>
                </li>
                <li class="sidebar-menu-item <?php echo e(Request::is('titip*') ? 'active' : ''); ?>">
                    <a href="<?php echo e(route('titip.index')); ?>">
                        <span>📦</span> Daftar Titipan
                    </a>
                </li>
                <li class="sidebar-menu-item <?php echo e(Request::is('jatah*') ? 'active' : ''); ?>">
                    <a href="<?php echo e(route('jatah.index')); ?>">
                        <span>👥</span> Jatah RT / Kelompok
                    </a>
                </li>
            </nav>

            <div class="sidebar-footer">
                <?php if(auth()->guard()->check()): ?>
                    <div class="sidebar-user">
                        <div class="sidebar-user-avatar">
                            <?php echo e(substr(Auth::user()->name, 0, 1)); ?>

                        </div>
                        <div class="sidebar-user-info">
                            <span class="sidebar-user-name"><?php echo e(Auth::user()->name); ?></span>
                            <span class="sidebar-user-role">Panitia</span>
                        </div>
                    </div>
                    <form action="<?php echo e(route('logout')); ?>" method="POST">
                        <?php echo csrf_field(); ?>
                        <button type="submit" class="btn-logout">
                            <span>🚪</span> Keluar
                        </button>
                    </form>
                <?php endif; ?>
            </div>
        </aside>

        <!-- Main Content Pane -->
        <main class="main-content">
            <header class="top-header">
                <div class="top-header-title">
                    <h1><?php echo $__env->yieldContent('header_title'); ?></h1>
                    <p><?php echo $__env->yieldContent('header_subtitle'); ?></p>
                </div>
                <div class="top-header-date">
                    <span style="font-size: 0.85rem; font-weight: 600; color: var(--text-muted);">
                        📅 <?php echo e(Carbon\Carbon::now()->isoFormat('dddd, D MMMM Y')); ?>

                    </span>
                </div>
            </header>

            <section class="content-body">
                <?php echo $__env->yieldContent('content'); ?>
            </section>
        </main>
    </div>

    <!-- Toast Fade-Out Handler -->
    <script>
        document.addEventListener('DOMContentLoaded', () => {
            const successToast = document.getElementById('toast-success');
            const errorToast = document.getElementById('toast-error');

            const fadeOut = (el) => {
                if (el) {
                    setTimeout(() => {
                        el.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
                        el.style.opacity = '0';
                        el.style.transform = 'translateY(-20px)';
                        setTimeout(() => el.remove(), 500);
                    }, 4000);
                }
            };

            fadeOut(successToast);
            fadeOut(errorToast);
        });
    </script>
    <?php echo $__env->yieldContent('scripts'); ?>
</body>
</html>
<?php /**PATH /Users/sagara/Projects/distribusi-apps/resources/views/layouts/app.blade.php ENDPATH**/ ?>