<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>@yield('title') – SSWSEEP</title>

    <!-- Fonts -->
    <link rel="dns-prefetch" href="//fonts.bunny.net">
    <link href="https://fonts.bunny.net/css?family=Nunito" rel="stylesheet">
    <style>
        .navbar { background: #28a745; }
        .navbar .nav-link, .navbar .navbar-brand { color: white !important; }
        .navbar .nav-link:hover { color: #f8f9fa !important; }
        .header-logo { height: 60px; }
    </style>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <link href="{{ asset('css/custom.css') }}" rel="stylesheet">
    @stack('styles')
</head>
<body>
    <div class="d-flex">
        <div class="flex-grow-1">
            <header class="bg-white shadow-sm p-3 d-flex justify-content-between align-items-center">
                <div class="d-flex align-items-center gap-4">
                    <img src="{{ asset('images/ministry-logo.png') }}" class="header-logo" alt="Ministry">
                    {{-- <img src="{{ asset('images/sswseep-logo.png') }}" class="header-logo" alt="SSWSEEP"> --}}
                    <h4 class="mb-0 text-success fw-bold">Community Empowerment Support to Women and Girls </h4>
                </div>
                <div class="d-flex align-items-center">
                    <span class="navbar-text me-3">Hello, {{ Auth::user()->name }}</span>                    
                    <form method="POST" action="{{ route('logout') }}" class="m-0">
                        @csrf
                        <button type="submit" class="btn-sswseep-green">Logout</button>
                    </form>
                </div>
            </header>

            <main class="p-4">
                @if(session('success'))
                    <div class="alert alert-success alert-dismissible fade show">
                        {{ session('success') }} <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                    </div>
                @endif
                @yield('content')
            </main>
        </div>
    </div>
    </div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
@stack('scripts')

<!-- Footer -->
<footer class="bg-light border-top mt-5">
    <div class="container-fluid py-3 text-center text-muted small">
        <p class="mb-0">&copy; Copyright. MGSCW / SSWSEEP Database. Powered By Dynamic Consult.</p>
    </div>
</footer>

</body>
</html>
