<?php $__env->startSection('content'); ?>
    <section class="section-padding section-bg fix">
        <div class="container">
            <div class="dashboard-layout">
                <?php echo $__env->make('student.partials.sidebar', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

                <div class="dashboard-main">
                    <div class="section-title-area wow fadeInUp" style="margin-bottom: 30px;">
                        <div class="section-title">
                            <h6><?php echo e(__('student.my_assignments_title')); ?></h6>
                            <h2><?php echo e(__('student.my_assignments_title')); ?></h2>
                            <p><?php echo e(__('student.assignments_desc')); ?></p>
                        </div>
                    </div>

                    <div class="dashboard-stats-minimal" style="margin-bottom: 40px;">
                        <div class="stat-card-minimal">
                            <div class="stat-icon-minimal stat-icon-1">
                                <i class="fa-solid fa-clipboard-list"></i>
                            </div>
                            <div class="stat-content-minimal">
                                <div class="stat-value-minimal"><?php echo e($summary['total_submissions']); ?></div>
                                <div class="stat-label-minimal"><?php echo e(__('student.total_submissions')); ?></div>
                            </div>
                        </div>
                        <div class="stat-card-minimal">
                            <div class="stat-icon-minimal stat-icon-2">
                                <i class="fa-solid fa-paper-plane"></i>
                            </div>
                            <div class="stat-content-minimal">
                                <div class="stat-value-minimal"><?php echo e($summary['graded_assignments']); ?></div>
                                <div class="stat-label-minimal"><?php echo e(__('student.graded_label')); ?></div>
                            </div>
                        </div>
                        <div class="stat-card-minimal">
                            <div class="stat-icon-minimal stat-icon-3">
                                <i class="fa-solid fa-hourglass-half"></i>
                            </div>
                            <div class="stat-content-minimal">
                                <div class="stat-value-minimal">
                                    <?php echo e($summary['pending_assignments'] + $summary['returned_assignments']); ?></div>
                                <div class="stat-label-minimal"><?php echo e(__('student.awaiting_feedback')); ?></div>
                            </div>
                        </div>
                    </div>

                    <div class="assignments-filter-card wow fadeInUp" data-wow-delay=".1s">
                        <form method="GET" action="<?php echo e(route('student.assignments')); ?>" class="assignments-filter-form">
                            <div class="filter-group">
                                <label for="student-assignment-course"><?php echo e(__('student.course_label')); ?></label>
                                <div class="filter-select">
                                    <select id="student-assignment-course" name="course_id" class="nice-select">
                                        <option value=""><?php echo e(__('student.all_courses')); ?></option>
                                        <?php $__currentLoopData = $courses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $course): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($course->id); ?>"
                                                <?php echo e($selectedCourseId === $course->id ? 'selected' : ''); ?>>
                                                <?php echo e($course->title); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>
                            <div class="filter-group">
                                <label for="student-assignment-status"><?php echo e(__('student.status_label')); ?></label>
                                <div class="filter-select">
                                    <select id="student-assignment-status" name="status" class="nice-select">
                                        <?php $__currentLoopData = $statusOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($value); ?>"
                                                <?php echo e($statusFilter === $value ? 'selected' : ''); ?>>
                                                <?php echo e($label); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>
                            <div class="filter-group">
                                <label for="student-assignment-search"><?php echo e(__('student.search_label')); ?></label>
                                <div class="filter-search">
                                    <input type="search" id="student-assignment-search" name="search" class="search-input"
                                        value="<?php echo e($searchTerm); ?>" placeholder="<?php echo e(__('student.search_assignment_title')); ?>">
                                    <i class="fa-solid fa-magnifying-glass"></i>
                                </div>
                            </div>
                            <div class="filter-actions">
                                <button type="submit" class="filter-submit-btn">
                                    <i class="fa-solid fa-search"></i>
                                    <span><?php echo e(__('student.apply')); ?></span>
                                </button>
                                <?php if($selectedCourseId || $statusFilter || $searchTerm): ?>
                                    <a href="<?php echo e(route('student.assignments')); ?>" class="filter-reset-btn">
                                        <i class="fa-solid fa-rotate-left"></i>
                                        <span><?php echo e(__('student.reset_label')); ?></span>
                                    </a>
                                <?php endif; ?>
                            </div>
                        </form>
                    </div>

                    <div class="assignments-grid">
                        <?php $__empty_1 = true; $__currentLoopData = $assignments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $assignment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div class="assignment-card wow fadeInUp" data-wow-delay=".05s">
                                <div class="assignment-card-header">
                                    <div class="assignment-icon">
                                        <i class="fa-solid fa-file-lines"></i>
                                    </div>
                                    <div>
                                        <h3><?php echo e($assignment->title); ?></h3>
                                        <p>
                                            <i class="fa-solid fa-graduation-cap"></i>
                                            <?php echo e(optional($assignment->topic->course)->title ?? __('student.unknown_course')); ?>

                                        </p>
                                    </div>
                                </div>

                                <div class="assignment-card-body">
                                    <p class="assignment-description"><?php echo e($assignment->short_description); ?></p>

                                    <div class="assignment-stats">
                                        <div class="assignment-stat">
                                            <span class="stat-label"><?php echo e(__('student.status_label')); ?></span>
                                            <span class="stat-value">
                                                <span
                                                    class="status-badge-table <?php echo e($assignment->student_submission['status_class']); ?>">
                                                    <?php echo e($assignment->student_submission['status_label']); ?>

                                                </span>
                                            </span>
                                        </div>
                                        <div class="assignment-stat">
                                            <span class="stat-label"><?php echo e(__('student.grade_label')); ?></span>
                                            <span class="stat-value">
                                                <?php echo e($assignment->student_submission['grade'] !== null ? $assignment->student_submission['grade'] . '%' : '—'); ?>

                                            </span>
                                        </div>
                                        <div class="assignment-stat">
                                            <span class="stat-label"><?php echo e(__('student.submitted_label')); ?></span>
                                            <span
                                                class="stat-value"><?php echo e($assignment->student_submission['submitted_at'] ?? '—'); ?></span>
                                        </div>
                                        <div class="assignment-stat">
                                            <span class="stat-label"><?php echo e(__('student.files_label')); ?></span>
                                            <span class="stat-value"><?php echo e($assignment->files_count); ?></span>
                                        </div>
                                    </div>
                                </div>

                                <div class="assignment-card-footer">
                                    <a href="<?php echo e(route('student.courses.access', optional($assignment->topic)->course_id)); ?>"
                                        class="assignment-action-btn">
                                        <i class="fa-solid fa-arrow-up-right-from-square"></i>
                                        <?php echo e(__('student.open_course')); ?>

                                    </a>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <div class="dashboard-empty-state">
                                <i class="fa-solid fa-clipboard-question"></i>
                                <h3><?php echo e(__('student.no_assignments_display')); ?></h3>
                                <p><?php echo e(__('student.no_assignments_desc')); ?></p>
                            </div>
                        <?php endif; ?>
                    </div>

                    <?php if($assignments->hasPages()): ?>
                        <div class="table-pagination">
                            <div class="pagination-info">
                                Showing <?php echo e($assignments->firstItem()); ?> to <?php echo e($assignments->lastItem()); ?> of
                                <?php echo e($assignments->total()); ?> assignments
                            </div>
                            <div class="pagination-links">
                                <?php if($assignments->onFirstPage()): ?>
                                    <span class="pagination-btn disabled">
                                        <i class="fa-solid fa-chevron-left"></i>
                                        <?php echo e(__('student.previous')); ?>

                                    </span>
                                <?php else: ?>
                                    <a href="<?php echo e($assignments->previousPageUrl()); ?>" class="pagination-btn">
                                        <i class="fa-solid fa-chevron-left"></i>
                                        <?php echo e(__('student.previous')); ?>

                                    </a>
                                <?php endif; ?>

                                <div class="pagination-numbers">
                                    <?php $__currentLoopData = $assignments->getUrlRange(max(1, $assignments->currentPage() - 2), min($assignments->lastPage(), $assignments->currentPage() + 2)); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $page => $url): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php if($page === $assignments->currentPage()): ?>
                                            <span class="pagination-number active"><?php echo e($page); ?></span>
                                        <?php else: ?>
                                            <a href="<?php echo e($url); ?>"
                                                class="pagination-number"><?php echo e($page); ?></a>
                                        <?php endif; ?>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>

                                <?php if($assignments->hasMorePages()): ?>
                                    <a href="<?php echo e($assignments->nextPageUrl()); ?>" class="pagination-btn">
                                        <?php echo e(__('student.next')); ?>

                                        <i class="fa-solid fa-chevron-right"></i>
                                    </a>
                                <?php else: ?>
                                    <span class="pagination-btn disabled">
                                        <?php echo e(__('student.next')); ?>

                                        <i class="fa-solid fa-chevron-right"></i>
                                    </span>
                                <?php endif; ?>
                            </div>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.student', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/mahmudul/Codecanyone/edu_ex_full/Eduex_laravel/resources/views/student/assignments/index.blade.php ENDPATH**/ ?>