@php
    $brandLogo = asset('assets/img/logo/LOGO%20PUTRA.png');
    $favicon = asset('assets/img/logo/LOGO%20PONDOK%2064.png');
    $viteAssets = [
        'resources/assets/vendor/libs/jquery/jquery.js',
        'resources/assets/vendor/fonts/iconify/iconify.css',
        'resources/assets/vendor/libs/node-waves/node-waves.scss',
        'resources/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.scss',
        'resources/assets/vendor/libs/sweetalert2/sweetalert2.scss',
        'resources/assets/vendor/scss/core.scss',
        'resources/assets/css/demo.css',
        'resources/css/app.css',
        'resources/assets/vendor/js/helpers.js',
        'resources/assets/js/config.js',
        'resources/assets/vendor/js/bootstrap.js',
        'resources/assets/vendor/libs/node-waves/node-waves.js',
        'resources/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js',
        'resources/assets/vendor/libs/sweetalert2/sweetalert2.js',
        'resources/assets/vendor/js/menu.js',
        'resources/assets/js/main.js',
        'resources/js/app.js',
    ];
@endphp
<!DOCTYPE html>
<html lang="id" class="light-style layout-wide" dir="ltr" data-theme="theme-default" data-assets-path="{{ asset('assets') }}/" data-template="front-pages">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <title>{{ $title ?? 'Pusat Bantuan' }} - Inventaris Pondok</title>
    <link rel="icon" type="image/png" href="{{ $favicon }}">
    @vite($viteAssets)
    @stack('styles')
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            @if (session('status') || session('success'))
                Swal.fire({
                    icon: 'success',
                    title: 'Berhasil!',
                    text: '{{ session('status') ?: session('success') }}',
                    customClass: { confirmButton: 'btn btn-primary waves-effect waves-light' },
                    buttonsStyling: false
                });
            @endif

            @if (session('error'))
                Swal.fire({
                    icon: 'error',
                    title: 'Kesalahan',
                    text: '{{ session('error') }}',
                    customClass: { confirmButton: 'btn btn-primary waves-effect waves-light' },
                    buttonsStyling: false
                });
            @endif
        });
    </script>
</head>
<body>
    <nav class="navbar navbar-expand-lg bg-white shadow-sm sticky-top py-3">
        <div class="container">
            <a class="navbar-brand d-flex align-items-center gap-2" href="{{ route('public.home') }}">
                <img src="{{ $brandLogo }}" alt="Logo" height="32">
                <span class="h4 mb-0 fw-bold text-success">Inventaris Pondok</span>
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarFront" aria-controls="navbarFront" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarFront">
                <ul class="navbar-nav ms-auto gap-2">
                    <li class="nav-item">
                        <a class="nav-link fw-medium {{ request()->routeIs('public.home') ? 'active text-success' : '' }}" href="{{ route('public.home') }}">Beranda</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link fw-medium {{ request()->routeIs('public.tickets.create') ? 'active text-success' : '' }}" href="{{ route('public.tickets.create') }}">Lapor Kerusakan</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link fw-medium {{ request()->routeIs('public.tickets.status') ? 'active text-success' : '' }}" href="{{ route('public.tickets.status') }}">Cek Status</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link fw-medium" href="{{ route('public.home') }}#faq">FAQ</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    @yield('content')

    <footer class="footer bg-white pt-10 pb-5 border-top mt-10">
        <div class="container">
            <div class="row g-6 mb-8">
                <div class="col-lg-6">
                    <div class="d-flex align-items-center gap-2 mb-4">
                        <img src="{{ $brandLogo }}" alt="Logo" height="32">
                        <span class="h4 mb-0 fw-bold text-success">Inventaris Pondok</span>
                    </div>
                    <p class="text-muted mb-0 max-width-400">
                        Sistem manajemen inventaris dan fasilitas terpadu untuk efisiensi operasional pondok pesantren.
                    </p>
                </div>
                <div class="col-lg-6 text-lg-end">
                    <h5 class="mb-4">Butuh Bantuan?</h5>
                    <div class="d-flex gap-3 justify-content-lg-end">
                        <a href="https://wa.me/628123456789" target="_blank" class="btn btn-success waves-effect">
                            <i class="ti tabler-brand-whatsapp me-1"></i> Chat WhatsApp
                        </a>
                    </div>
                </div>
            </div>
            <div class="border-top pt-4">
                <div class="d-flex flex-wrap justify-content-between align-items-center">
                    <div class="mb-2 mb-md-0 text-muted small">
                        © 2026 <span class="fw-bold">Inventaris Pondok</span>. All Rights Reserved.
                    </div>
                    <div class="text-muted small">
                        Developer by <a href="https://yudhadigital.com" target="_blank" class="fw-bold text-success">Yudha Digital</a>
                    </div>
                </div>
            </div>
        </div>
    </footer>
    @stack('scripts')
</body>
</html>
