@foreach($upcomingEvents as $event)
@php
$daysUntil = now()->startOfDay()->diffInDays($event->start_date, false);
$urgencyClass = match(true) {
$daysUntil <= 1 => 'bg-red-50 text-red-600 border-red-200',
$daysUntil <= 3 => 'bg-orange-50 text-orange-600 border-orange-200',
$daysUntil <= 7 => 'bg-yellow-50 text-yellow-600 border-yellow-200',
default => 'bg-gray-50 text-gray-600 border-gray-200',
};
$typeIcon = match($event->type) {
'holiday', 'vacation' => 'fa-umbrella-beach',
'exam' => 'fa-file-alt',
'celebration', 'cultural' => 'fa-star',
'sports', 'camp' => 'fa-running',
'competition' => 'fa-trophy',
'meeting' => 'fa-handshake',
'workshop' => 'fa-tools',
'term_start', 'term_end' => 'fa-flag',
default => 'fa-calendar-check',
};
@endphp
{{-- Color dot + icon --}}
{{-- Event info --}}
{{ $event->title }}
{{ $event->start_date->format('D, d M') }}
@if($event->end_date && !$event->start_date->eq($event->end_date))
– {{ $event->end_date->format('d M') }}
@endif
{{-- Days badge --}}
@if($daysUntil === 0)
TODAY
@elseif($daysUntil === 1)
TOMORROW
@else
{{ $daysUntil }}d
@endif
@if($event->is_holiday)
HOLIDAY
@endif
@endforeach