<div class="assignment-content">
    <div class="mhq-courses-details-area">
        <div class="mhq-courses-details-wrapper">
            <div class="mhq-left-content">
                <h3 class="mb-4"><?php echo e($assignment->title); ?></h3>

                <?php if($assignment->description): ?>
                    <div class="assignment-description mb-4">
                        <?php echo $assignment->description; ?>

                    </div>
                <?php endif; ?>

                <?php if($assignment->instructions): ?>
                    <div class="assignment-instructions mb-4">
                        <h5 class="assignment-instructions-title">
                            <i class="fas fa-list-check assignment-instructions-icon"></i> <?php echo e(__('student.instructions')); ?>

                        </h5>
                        <div class="assignment-instructions-text">
                            <?php echo $assignment->instructions; ?>

                        </div>
                    </div>
                <?php endif; ?>

                <?php if($assignment->files->count() > 0): ?>
                    <div class="assignment-files mb-4">
                        <h5 class="assignment-files-title">
                            <i class="fas fa-paperclip assignment-files-icon"></i> <?php echo e(__('student.attachments')); ?>

                        </h5>
                        <ul class="list-group" style="border: none;">
                            <?php $__currentLoopData = $assignment->files; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $file): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li class="assignment-file-item">
                                    <a href="<?php echo e(asset('storage/' . $file->file_path)); ?>"
                                        download="<?php echo e($file->original_filename); ?>"
                                        class="assignment-file-link text-decoration-none">
                                        <i class="fas fa-file-download"></i> <?php echo e($file->original_filename); ?>

                                    </a>
                                    <span class="assignment-file-size">(<?php echo e($file->file_size ?? __('student.unknown_size')); ?>)</span>
                                </li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                    </div>
                <?php endif; ?>

                <?php if($submission): ?>
                    <div class="submission-status mb-4">
                        <div
                            class="submission-status-box submission-status-<?php echo e($submissionData['status_class'] ?? 'pending'); ?>">
                            <h5 class="submission-status-title">
                                <?php echo e(__('student.submission_status')); ?>: <span
                                    class="submission-status-text"><?php echo e($submissionData['status_label'] ?? __('student.pending')); ?></span>
                            </h5>
                            <?php if(!empty($submissionData['is_graded'])): ?>
                                <p style="margin-bottom: 10px;">
                                    <strong><?php echo e(__('student.grade_label')); ?>:</strong>
                                    <span class="submission-grade-value"><?php echo e($submission->grade ?? 'N/A'); ?>%</span>
                                </p>
                            <?php endif; ?>
                            <?php if($submission->instructor_notes): ?>
                                <p style="margin-bottom: 10px;">
                                    <strong><?php echo e(__('student.instructor_notes')); ?>:</strong>
                                    <span style="color: var(--text);"><?php echo e($submission->instructor_notes); ?></span>
                                </p>
                            <?php endif; ?>
                            <p style="margin-bottom: 0;">
                                <strong><?php echo e(__('student.submitted_label')); ?>:</strong>
                                <span style="color: var(--text);"><?php echo e($submissionData['submitted_at'] ?? '—'); ?></span>
                            </p>
                        </div>

                        <?php if($submission->submission_text): ?>
                            <div class="submission-text-box mb-4">
                                <h5 style="color: var(--header); margin-bottom: 15px;"><?php echo e(__('student.your_submission')); ?></h5>
                                <div class="submission-text-content">
                                    <?php echo $submission->submission_text; ?>

                                </div>
                            </div>
                        <?php endif; ?>

                        <?php if($submission->files->count() > 0): ?>
                            <div class="submission-files-box">
                                <h5 style="color: var(--header); margin-bottom: 20px;"><?php echo e(__('student.submitted_files')); ?></h5>
                                <ul class="list-group" style="border: none;">
                                    <?php $__currentLoopData = $submission->files; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $file): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li class="submission-file-item">
                                            <a href="<?php echo e($file->file_url); ?>" download="<?php echo e($file->original_filename); ?>"
                                                class="submission-file-link text-decoration-none">
                                                <i class="fas fa-file-download"></i> <?php echo e($file->original_filename); ?>

                                            </a>
                                        </li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </ul>
                            </div>
                        <?php endif; ?>
                    </div>

                    <?php if(!empty($submissionData['can_resubmit'])): ?>
                        <div class="assignment-form-resubmit mb-4">
                            <div class="assignment-form mb-3"
                                style="background: rgba(0, 79, 68, 0.05); padding: 20px; border-radius: 12px;">
                                <h5 style="margin-bottom: 10px; color: var(--header);"><?php echo e(__('student.ready_to_try_again')); ?></h5>
                                <p style="margin: 0; color: var(--text);"><?php echo e(__('student.resubmit_desc')); ?></p>
                            </div>

                            <form id="assignment-form" enctype="multipart/form-data"
                                data-assignment-id="<?php echo e($assignment->id); ?>"
                                data-course-id="<?php echo e($assignment->topic->course_id); ?>" class="assignment-form">
                                <div class="mb-4">
                                    <label for="submission_text" class="form-label assignment-form-label"><?php echo e(__('student.submission_text_optional')); ?></label>
                                    <textarea class="form-control assignment-form-textarea" id="submission_text" name="submission_text" rows="10"></textarea>
                                </div>

                                <div class="mb-4">
                                    <label for="files" class="form-label assignment-form-label"><?php echo e(__('student.upload_files_optional')); ?></label>
                                    <input type="file" class="form-control assignment-form-file-input" id="files"
                                        name="files[]" multiple
                                        accept=".pdf,.doc,.docx,.ppt,.pptx,.zip,.txt,.jpg,.jpeg,.png,.gif">
                                    <small class="assignment-form-help"><?php echo e(__('student.upload_help')); ?></small>
                                    <div id="file-preview" class="mt-3"></div>
                                </div>

                                <button type="submit" class="theme-btn py-2 px-4">
                                    <i class="fas fa-sync"></i> <?php echo e(__('student.resubmit_assignment')); ?>

                                </button>
                            </form>
                        </div>
                    <?php endif; ?>
                <?php else: ?>
                    <form id="assignment-form" enctype="multipart/form-data" data-assignment-id="<?php echo e($assignment->id); ?>"
                        data-course-id="<?php echo e($assignment->topic->course_id); ?>" class="assignment-form">
                        <div class="mb-4">
                            <label for="submission_text" class="form-label assignment-form-label"><?php echo e(__('student.submission_text_optional')); ?></label>
                            <textarea class="form-control assignment-form-textarea" id="submission_text" name="submission_text" rows="10"></textarea>
                        </div>

                        <div class="mb-4">
                            <label for="files" class="form-label assignment-form-label"><?php echo e(__('student.upload_files_optional')); ?></label>
                            <input type="file" class="form-control assignment-form-file-input" id="files"
                                name="files[]" multiple
                                accept=".pdf,.doc,.docx,.ppt,.pptx,.zip,.txt,.jpg,.jpeg,.png,.gif">
                            <small class="assignment-form-help"><?php echo e(__('student.upload_help')); ?></small>
                            <div id="file-preview" class="mt-3"></div>
                        </div>

                        <button type="submit" class="theme-btn py-2 px-4">
                            <i class="fas fa-paper-plane"></i> <?php echo e(__('student.submit_assignment')); ?>

                        </button>
                    </form>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>
<?php /**PATH /Users/mahmudul/Codecanyone/edu_ex_full/Eduex_laravel/resources/views/student/course-access/partials/assignment-content.blade.php ENDPATH**/ ?>