<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta charset="utf-8">
<title>Yearly Planner</title>
<style>
    body { font-family: Calibri, Arial, sans-serif; font-size: 11pt; color: #222; }
    h1 { color: #4f46e5; font-size: 18pt; margin: 0 0 2pt; }
    .sub { color: #666; font-size: 9pt; margin-bottom: 14pt; }
    .plan { border: 1px solid #cccccc; padding: 8pt 10pt; margin-bottom: 12pt; }
    .plan h3 { margin: 0 0 4pt; font-size: 13pt; }
    .badges { font-size: 9pt; color: #555; margin-bottom: 4pt; }
    .badges b { color: #222; }
    .desc { margin-top: 4pt; }
    .img img { max-width: 480px; }
</style>
</head>
<body>
    <h1>Yearly Planner</h1>
    <div class="sub">{{ config('app.name') }} &middot; Generated {{ now()->format('d M Y') }} &middot; {{ $plans->count() }} plan(s)</div>

    @forelse($plans as $plan)
        <div class="plan">
            <h3>{{ $plan->title }}</h3>
            <div class="badges">
                <b>Class:</b> {{ $plan->schoolClass?->name }}{{ $plan->section ? ' / '.$plan->section->name : '' }} &nbsp;
                <b>Subject:</b> {{ $plan->subject?->name }} @if($plan->period)&nbsp; <b>Period:</b> {{ $plan->period }}@endif
            </div>
            @if($plan->description)<div class="desc">{!! nl2br(e($plan->description)) !!}</div>@endif
            @if($plan->image_data)<div class="img"><img src="{{ $plan->image_data }}"></div>@endif
        </div>
    @empty
        <p>No plans to show.</p>
    @endforelse
</body>
</html>
