<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ config('app.name', 'Laravel Admin') }}</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Google Fonts - Inter -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <!-- Bootstrap Icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
    <!-- Material Design Icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@7.2.96/css/materialdesignicons.min.css">
    <style>
        :root {
            --sidebar-width: 280px;
            --sidebar-bg: #1e293b;
            --sidebar-color: #f8fafc;
            --sidebar-hover: #334155;
            --primary-color: #3b82f6;
        }

        body {
            font-family: 'Inter', sans-serif;
            overflow-x: hidden;
            background-color: #f1f5f9;
            color: #1e293b;
        }

        #wrapper {
            display: flex;
            width: 100%;
        }

        #sidebar-wrapper {
            min-height: 100vh;
            width: var(--sidebar-width);
            min-width: var(--sidebar-width);
            background: var(--sidebar-bg);
            transition: margin .25s ease-out;
            z-index: 1000;
            overflow-x: hidden;
        }

        #sidebar-wrapper .sidebar-heading {
            padding: 2rem 1.5rem;
            font-size: 1.1rem;
            letter-spacing: 1px;
            color: var(--sidebar-color);
            border-bottom: 1px solid rgba(255,255,255,0.05);
            white-space: nowrap;
        }

        .list-group-item {
            background-color: transparent !important;
            color: rgba(248, 250, 252, 0.7) !important;
            border: none !important;
            padding: 0.85rem 1.5rem;
            margin: 0.25rem 0.75rem;
            border-radius: 8px !important;
            font-weight: 500;
            transition: all 0.2s ease;
            display: block;
            width: auto; /* Let margins define the width */
        }

        .list-group-item:hover {
            background-color: var(--sidebar-hover) !important;
            color: #fff !important;
        }

        .list-group-item.active {
            background-color: var(--primary-color) !important;
            color: #fff !important;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        }

        #page-content-wrapper {
            width: 100%;
            background-color: #f1f5f9;
        }

        .navbar {
            padding: 0.75rem 1.5rem;
            background-color: #ffffff !important;
            border-bottom: 1px solid #e2e8f0 !important;
            box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
        }

        @media (max-width: 768px) {
            #sidebar-wrapper {
                margin-left: calc(-1 * var(--sidebar-width));
            }
            #wrapper.toggled #sidebar-wrapper {
                margin-left: 0;
            }
        }

        #wrapper.toggled #sidebar-wrapper {
            margin-left: calc(-1 * var(--sidebar-width));
        }
    </style>
    @yield('styles')
</head>
<body>
    <div class="d-flex" id="wrapper">
        <!-- Sidebar -->
        <div id="sidebar-wrapper">
            <div class="sidebar-heading fw-bold text-uppercase">
                <i class="bi bi-shield-lock-fill me-2"></i>Admin Panel
            </div>
            <div class="list-group">
                <a href="{{ route('dashboard') }}" class="list-group-item list-group-item-action {{ request()->routeIs('dashboard') ? 'active' : '' }}">
                    <i class="bi bi-speedometer2 me-2"></i> Dashboard
                </a>
                <a href="#resumeSubmenu" data-bs-toggle="collapse" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center {{ request()->routeIs('resume-analysis.*') ? 'active' : '' }}">
                    <span><i class="bi bi-file-earmark-person-fill me-2"></i>Resume</span>
                    <i class="bi bi-chevron-down" style="font-size: 0.8rem;"></i>
                </a>
                <div class="collapse {{ request()->routeIs('resume-analysis.*') ? 'show' : '' }}" id="resumeSubmenu">
                    <a href="{{ route('resume-analysis.index') }}" class="list-group-item list-group-item-action {{ request()->routeIs('resume-analysis.*') ? 'active' : '' }}" style="padding-left: 3rem; font-size: 0.9rem;">
                        <i class="bi bi-search me-2"></i>Resume Analyzer
                    </a>
                    <a href="#" class="list-group-item list-group-item-action" style="padding-left: 3rem; font-size: 0.9rem;">
                        <i class="bi bi-file-earmark-richtext me-2"></i>Resume Template
                    </a>
                </div>
                <a href="{{ route('notices.index') }}" class="list-group-item list-group-item-action {{ request()->routeIs('notices.*') ? 'active' : '' }}">
                    <i class="bi bi-bell me-2"></i> Notice
                </a>
                <a href="{{ route('home-banners.index') }}" class="list-group-item list-group-item-action {{ request()->routeIs('home-banners.*') ? 'active' : '' }}">
                    <i class="bi bi-image me-2"></i>Home Banner
                </a>
                <a href="{{ route('about-us.index') }}" class="list-group-item list-group-item-action {{ request()->routeIs('about-us.*') ? 'active' : '' }}">
                    <i class="bi bi-person-circle me-2"></i>About Me
                </a>

                <a href="{{route('skills.index')}}" class="list-group-item list-group-item-action">
                    <i class="bi bi-laptop me-2"></i>My Skills
                </a>

                <a href="{{ route('experiences.index') }}" class="list-group-item list-group-item-action">
                    <i class="bi bi-graph-up-arrow me-2"></i>My Journey
                </a>

                <a href="{{ route('projects.index') }}" class="list-group-item list-group-item-action {{ request()->routeIs('projects.*') ? 'active' : '' }}">
                    <i class="bi bi-code-square me-2"></i>My Projects
                </a>

                <a href="#" class="list-group-item list-group-item-action">
                    <i class="bi bi-journal-text me-2"></i>News & Blog
                </a>

                <a href="#" class="list-group-item list-group-item-action">
                    <i class="bi bi-send-fill me-2"></i>Contact Me
                </a>

                <a href="{{ route('visitors-messages.index') }}" class="list-group-item list-group-item-action">
                    <i class="bi bi-person-vcard me-2"></i>Visitors Messages
                </a>

                <a href="{{ route('chatbot.index') }}" class="list-group-item list-group-item-action {{ request()->routeIs('chatbot.*') ? 'active' : '' }}">
                    <i class="bi bi-robot me-2"></i>Chatbot
                </a>

            </div>
        </div>
        <!-- /#sidebar-wrapper -->

        <!-- Page Content -->
        <div id="page-content-wrapper">
            <nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom">
                <div class="container-fluid">
                    <button class="btn btn-primary btn-sm" id="menu-toggle">
                        <i class="bi bi-list"></i>
                    </button>

                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <ul class="navbar-nav ms-auto mt-2 mt-lg-0">
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle fw-semibold" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    <i class="bi bi-person-circle me-1"></i> {{ Auth::user()->name }}
                                </a>
                                <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
                                    <form action="{{ route('logout') }}" method="POST" class="m-0">
                                        @csrf
                                        <button type="submit" class="dropdown-item">
                                            <i class="bi bi-box-arrow-right me-2"></i> Logout
                                        </button>
                                    </form>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>

            <div class="container-fluid p-4">
                @yield('content')
            </div>
        </div>
        <!-- /#page-content-wrapper -->
    </div>
    <!-- /#wrapper -->

    <!-- Bootstrap 5 JS Bundle -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        window.addEventListener('DOMContentLoaded', event => {
            const sidebarToggle = document.body.querySelector('#menu-toggle');
            if (sidebarToggle) {
                sidebarToggle.addEventListener('click', event => {
                    event.preventDefault();
                    document.body.querySelector('#wrapper').classList.toggle('toggled');
                });
            }
        });
    </script>
    @yield('scripts')
</body>
</html>


