<?php $__env->startSection('content'); ?>
<div class="row mb-4 align-items-center">
    <div class="col-md-6">
        <h2 class="fw-bold text-dark mb-1">Notice Board</h2>
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb mb-0">
                <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>" class="text-decoration-none text-muted">Dashboard</a></li>
                <li class="breadcrumb-item active fw-medium text-primary" aria-current="page"></li>
            </ol>
        </nav>
    </div>
    <div class="col-md-6 text-md-end">
        <a href="<?php echo e(route('notices.create')); ?>" class="btn btn-primary btn-lg shadow-sm rounded-3 px-4 py-2">
            <i class="bi bi-plus-circle-fill me-2"></i> Publish New Notice
        </a>
    </div>
</div>

<?php if(session('success')): ?>
    <div class="alert alert-success alert-dismissible fade show rounded-4 shadow-sm mb-4 border-0 p-3" role="alert">
        <div class="d-flex align-items-center">
            <div class="bg-success text-white rounded-circle p-2 me-3 d-flex align-items-center justify-content-center" style="width: 32px; height: 32px;">
                <i class="bi bi-check-lg"></i>
            </div>
            <div>
                <strong class="d-block">Success!</strong>
                <span class="small"><?php echo e(session('success')); ?></span>
            </div>
        </div>
        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
    </div>
<?php endif; ?>

<div class="card border-0 shadow-sm rounded-4 overflow-hidden">
    <div class="card-header bg-white border-bottom py-3 px-4 d-flex align-items-center justify-content-between">
        <h6 class="m-0 fw-bold text-dark">Active Notices</h6>
        <div class="dropdown">
            <button class="btn btn-light btn-sm rounded-3 border" type="button" data-bs-toggle="dropdown">
                <i class="bi bi-three-dots-vertical"></i>
            </button>
            <ul class="dropdown-menu dropdown-menu-end shadow border-0 rounded-3">
                <li><a class="dropdown-item py-2" href="#"><i class="bi bi-download me-2"></i> Export Data</a></li>
                <li><a class="dropdown-item py-2" href="#"><i class="bi bi-printer me-2"></i> Print List</a></li>
            </ul>
        </div>
    </div>
    <div class="card-body p-0">
        <div class="table-responsive">
            <table class="table table-hover align-middle mb-0">
                <thead class="bg-slate-50 text-secondary small text-uppercase fw-bold" style="background-color: #f8fafc;">
                    <tr>
                        <th class="px-4 py-3" style="width: 80px;">ID</th>
                        <th class="py-3">Title & Details</th>
                        <th class="py-3">Attached File</th>
                        <th class="py-3">Posted Date</th>
                        <th class="px-4 py-3 text-end">Management</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $notices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $notice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="transition-all">
                            <td class="px-4 py-4 text-secondary fw-medium">#<?php echo e($notice->id); ?></td>
                            <td class="py-4">
                                <div class="d-flex align-items-center">
                                    <div class="bg-primary-subtle text-primary rounded-3 p-2 me-3 d-flex align-items-center justify-content-center" style="width: 40px; height: 40px;">
                                        <i class="bi bi-megaphone"></i>
                                    </div>
                                    <div>
                                        <span class="d-block fw-bold text-dark h6 mb-1"><?php echo e($notice->title); ?></span>
                                        <span class="text-secondary small"><i class="bi bi-person me-1"></i> Posted by Administrator</span>
                                    </div>
                                </div>
                            </td>
                            <td class="py-4">
                                <?php if($notice->uploads): ?>
                                    <?php
                                        $ext = pathinfo($notice->uploads, PATHINFO_EXTENSION);
                                        $icon = 'bi-file-earmark';
                                        $color = 'text-primary';
                                        if(in_array($ext, ['pdf'])) { $icon = 'bi-file-earmark-pdf'; $color = 'text-danger'; }
                                        elseif(in_array($ext, ['jpg', 'png', 'jpeg'])) { $icon = 'bi-file-earmark-image'; $color = 'text-success'; }
                                    ?>
                                    <a href="<?php echo e(asset($notice->uploads)); ?>" target="_blank" class="text-decoration-none d-flex align-items-center group">
                                        <div class="file-icon bg-light rounded-2 p-2 me-2 transition-all">
                                            <i class="bi <?php echo e($icon); ?> <?php echo e($color); ?> fs-5"></i>
                                        </div>
                                        <span class="text-dark small fw-medium group-hover-text-primary transition-all">View Document</span>
                                    </a>
                                <?php else: ?>
                                    <span class="badge bg-light text-secondary border px-3 py-2 rounded-pill font-monospace small">NO_ATTACHMENT</span>
                                <?php endif; ?>
                            </td>
                            <td class="py-4 text-secondary">
                                <span class="d-block small fw-bold text-dark mb-1"><?php echo e($notice->created_at->format('d M, Y')); ?></span>
                                <span class="text-secondary small"><?php echo e($notice->created_at->diffForHumans()); ?></span>
                            </td>
                            <td class="px-4 py-4 text-end">
                                <div class="d-flex justify-content-end gap-2">
                                    <?php if($notice->uploads): ?>
                                        <a href="<?php echo e(asset($notice->uploads)); ?>" target="_blank" class="btn btn-light btn-sm rounded-3 border text-info" title="View File">
                                            <i class="bi bi-eye"></i>
                                        </a>
                                    <?php endif; ?>
                                    <a href="<?php echo e(route('notices.edit', $notice)); ?>" class="btn btn-light btn-sm rounded-3 border text-primary" title="Edit Notice">
                                        <i class="bi bi-pencil-square"></i>
                                    </a>
                                    <form action="<?php echo e(route('notices.destroy', $notice)); ?>" method="POST" onsubmit="return confirm('Delete this notice permanently?')" class="d-inline">
                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('DELETE'); ?>
                                        <button type="submit" class="btn btn-light btn-sm rounded-3 border text-danger" title="Delete Notice">
                                            <i class="bi bi-trash3"></i>
                                        </button>
                                    </form>
                                </div>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="5" class="text-center py-5">
                                <img src="https://illustrations.popsy.co/gray/empty-inbox.svg" alt="Empty" style="width: 150px;" class="mb-4 opacity-50">
                                <h5 class="text-dark fw-bold">No Notices Published</h5>
                                <p class="text-secondary mb-4">You haven't posted any notices yet. Keep your team updated!</p>
                                <a href="<?php echo e(route('notices.create')); ?>" class="btn btn-primary rounded-3 px-4">Create First Notice</a>
                            </td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('styles'); ?>
<style>
    .transition-all { transition: all 0.2s ease-in-out; }
    .table tbody tr:hover { background-color: #f8fafc !important; transform: scale(1.002); }
    .group:hover .file-icon { background-color: #e0e7ff !important; transform: translateY(-2px); }
    .group-hover-text-primary:hover { color: #3b82f6 !important; }
    .bg-primary-subtle { background-color: #eff6ff !important; }
    .breadcrumb-item + .breadcrumb-item::before { content: "•"; color: #cbd5e1; }
</style>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\portfolio\resources\views/notices/index.blade.php ENDPATH**/ ?>