@extends('layouts.app')

@section('content')
<div class="container-fluid py-4">
    <div class="row">
        @include('partials.sidebar-student')

        <div class="col-lg-10">
            <h2 class="mb-4 text-success"><i class="fas fa-bullhorn me-2"></i>Latest Campus Notices</h2>

            @if(session('success'))
                <div class="alert alert-success">{{ session('success') }}</div>
            @endif

            {{-- Sample Notices --}}
            @php
                $notices = [
                    ['title' => 'Mid-Semester Exams Start 22 July 2025', 'content' => 'All students are advised that mid-semester exams commence on 22 July 2025. Please ensure you check your timetable and venue in advance.', 'date' => '2025-07-15'],
                    ['title' => 'Library Registration Ends 19 July', 'content' => 'Students who haven’t registered with the library must do so by 19 July to access course materials and online journals.', 'date' => '2025-07-14'],
                    ['title' => 'New Wi-Fi Password Available', 'content' => 'The campus Wi-Fi password has been updated. Please visit the ICT office with your student ID to get access credentials.', 'date' => '2025-07-13'],
                ];
            @endphp

            @foreach ($notices as $notice)
                <div class="card mb-3 shadow-sm border-start border-4 border-success">
                    <div class="card-body">
                        <h5 class="card-title text-success"><i class="fas fa-circle-info me-1"></i>{{ $notice['title'] }}</h5>
                        <p class="card-text">{{ $notice['content'] }}</p>
                        <small class="text-muted">Posted on {{ \Carbon\Carbon::parse($notice['date'])->format('d M Y') }}</small>
                    </div>
                </div>
            @endforeach

            {{-- No Notices Message --}}
            @if (empty($notices))
                <div class="alert alert-info">No notices available at this time.</div>
            @endif
        </div>
    </div>
</div>
@endsection
