<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{ config('app.name', 'Faculty Portal') }}</title>

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.bunny.net">
    <link href="https://fonts.bunny.net/css?family=inter:300,400,500,600,700&display=swap" rel="stylesheet" />

    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />

    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- DataTables CSS -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/jquery.dataTables.min.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.min.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">

    <!-- Select2 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />

    <!-- Custom CSS -->
    <style>
        :root {
            --primary-color: #3b82f6;
            --secondary-color: #1e40af;
            --accent-color: #93c5fd;
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --danger-color: #ef4444;
            --light-bg: #f9fafb;
            --dark-bg: #1f2937;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: #f3f4f6;
        }

        .navbar {
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        .card {
            border-radius: 0.75rem;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
        }

        .card:hover {
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        }

        .card-header {
            background-color: white;
            border-bottom: 1px solid #e5e7eb;
            border-top-left-radius: 0.75rem !important;
            border-top-right-radius: 0.75rem !important;
            padding: 1.25rem;
        }

        .table {
            --bs-table-striped-bg: rgba(59, 130, 246, 0.05);
        }

        .table th {
            font-weight: 600;
            background-color: #f8fafc;
            color: #334155;
        }

        .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }

        .btn-primary:hover {
            background-color: var(--secondary-color);
            border-color: var(--secondary-color);
        }

        .dropdown-menu {
            border-radius: 0.5rem;
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        }

        .page-title {
            color: #1e293b;
            font-weight: 600;
        }

        .dataTables_wrapper .dataTables_length,
        .dataTables_wrapper .dataTables_filter {
            margin-bottom: 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .dataTables_wrapper .dataTables_length select,
        .dataTables_wrapper .dataTables_filter input {
            border: 1px solid #d1d5db;
            border-radius: 0.375rem;
            padding: 0.375rem 0.75rem;
            transition: all 0.3s ease;
        }
        .dataTables_wrapper .dataTables_paginate .paginate_button {
            padding: 0;
        }

        .dataTables_wrapper .dataTables_length select:hover,
        .dataTables_wrapper .dataTables_filter input:hover {
            border-color: var(--primary-color);
            box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
        }

        

        .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
            background-color: "#fff";
            border-color: "#fff";
            color: white;
        }

        .dataTables_wrapper .dataTables_paginate .paginate_button.current {
            background: var(--primary-color) !important;
            border-color: var(--primary-color) !important;
            color: white !important;
            font-weight: bold;
        }

        .dataTables_wrapper .dataTables_info {
            margin-top: 1rem;
            font-size: 0.875rem;
            color: #6b7280;
        }

        .dataTables_wrapper .dataTables_scroll {
            border: 1px solid #e5e7eb;
            border-radius: 0.375rem;
            overflow: hidden;
        }

        .dataTables_wrapper .dataTables_scroll .dataTables_scrollHead {
            background-color: #f8fafc;
            border-bottom: 1px solid #e5e7eb;
        }

        .dataTables_wrapper .dataTables_scroll .dataTables_scrollBody {
            background-color: white;
        }

        .dataTables_wrapper .dataTables_scroll .dataTables_scrollBody tr:hover {
            background-color: rgba(59, 130, 246, 0.05);
        }

        .dataTables_wrapper .dataTables_scroll .dataTables_scrollBody td {
            padding: 0.75rem;
            border-bottom: 1px solid #e5e7eb;
        }

        .dataTables_wrapper .dataTables_scroll .dataTables_scrollBody td:last-child {
            border-right: none;
        }

        .dt-buttons {
            margin-bottom: 1rem;
        }

        .dt-button {
            background-color: #f3f4f6 !important;
            border-color: #d1d5db !important;
            color: #374151 !important;
            border-radius: 0.375rem !important;
            padding: 0.375rem 0.75rem !important;
            font-size: 0.875rem !important;
        }

        .dt-button:hover {
            background-color: #e5e7eb !important;
            border-color: #9ca3af !important;
        }

        .modal-content {
            border-radius: 0.75rem;
            border: none;
        }

        .modal-header {
            border-top-left-radius: 0.75rem;
            border-top-right-radius: 0.75rem;
            background-color: #f8fafc;
        }

        .form-check-input:checked {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }

        .wrap-text {
            white-space: normal;
            word-wrap: break-word;
            max-width: 250px;
        }
    </style>
    <style>
        /* Sidebar collapse functionality */
        #sidebar {
            min-width: 250px;
            max-width: 250px;
            transition: all 0.3s;
            z-index: 999;
        }

        #sidebar.active {
            min-width: 80px;
            max-width: 80px;
        }

        #sidebar.active .sidebar-text,
        #sidebar.active h6.textWhite:not(.sidebar-icon) {
            display: none;
        }

        #sidebar.active .col-2 {
            width: 100% !important;
        }

        #sidebar.active .nav-link {
            text-align: center;
            padding: 10px 5px;
        }

        #main-content {
            transition: all 0.3s;
            margin-left: 250px;
            width: calc(100% - 250px);
        }

        /* When sidebar is collapsed, adjust main content */
        body.sidebar-collapsed #main-content {
            margin-left: 80px;
            width: calc(100% - 80px);
        }
    </style>

    <!-- Scripts -->
    @vite(['resources/css/app.css', 'resources/js/app.js'])
</head>

<body class="font-sans antialiased">
    <div class="min-h-screen bg-gray-100">
        @include('layouts.partials.navbar')

        <div class="container-fluid">
            <div class="row">
                <!-- Sidebar -->
                @include('layouts.partials.sidebar')

                <!-- Main Content Area -->
                <main role="main" class="col-md-10 col-lg-10 ms-auto px-4" id="main-content">
                    @yield('content')

                    <!-- Footer -->
                    <footer class="bg-white py-4 shadow-inner mt-auto">
                        <div class="container text-center text-gray-500">
                            <p class="text-sm">© {{ date('Y') }} {{ config('app.name', 'Faculty Portal') }}. All rights reserved.</p>
                        </div>
                    </footer>
                </main>
            </div>
        </div>
    </div>


    <!-- jQuery -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

    <!-- Bootstrap JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>

    <!-- DataTables JS -->
    <script src="https://cdn.datatables.net/1.13.1/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>

    <!-- Select2 JS -->
    <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>

    <!-- Chart JS -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0"></script>

    <script>
        $(document).ready(function() {
            $('#sidebarCollapse').on('click', function() {
                $('#sidebar').toggleClass('active');
                $('body').toggleClass('sidebar-collapsed');

                // Save state to localStorage
                if ($('#sidebar').hasClass('active')) {
                    localStorage.setItem('sidebarCollapsed', 'true');
                } else {
                    localStorage.setItem('sidebarCollapsed', 'false');
                }
            });

            // Check if sidebar was collapsed previously
            if (localStorage.getItem('sidebarCollapsed') === 'true') {
                $('#sidebar').addClass('active');
                $('body').addClass('sidebar-collapsed');
            }
        });
    </script>


    @yield('scripts')
</body>

</html>