@extends('emails.layout')

@section('content')
    <h2>Hello {{ $user->name }},</h2>
    <p>Your leave request has been processed.</p>

    <div style="margin: 20px 0; border: 1px solid #eee; padding: 15px; border-radius: 8px;">
        <p style="margin: 0;"><strong>Type:</strong> {{ ucfirst($leave->type) }}</p>
        <p style="margin: 0;"><strong>Period:</strong> {{ $leave->start_date->format('d M') }} to
            {{ $leave->end_date->format('d M, Y') }}</p>
        <p style="margin: 0;"><strong>Total Days:</strong> {{ $leave->total_days }}</p>
        <p style="margin: 10px 0;"><strong>Status:</strong>
            <span class="badge {{ $leave->status == 'approved' ? 'bg-success' : 'bg-danger' }}">
                {{ ucfirst($leave->status) }}
            </span>
        </p>
    </div>

    @if ($leave->status == 'approved')
        <p>Your leave request has been <strong>Approved</strong>. Please ensure your tasks are handed over before you leave.
        </p>
    @else
        <p>Unfortunately, your leave request was <strong>Rejected</strong>. Please contact your manager for further
            clarification.</p>
    @endif

    <a href="{{ route('leaves.index') }}" class="button">My Leave History</a>
@endsection
