@extends('emails.master')

@section('title','Session Reschedule Request')

@section('content')

<h2 style="color:#0b3a6f; margin-top:0;">
Hello {{ $tutor->first_name . ' ' . $tutor->last_name }},
</h2>

<p style="font-size:15px; color:#555; line-height:1.6;">
{{ $student->name }} has requested to <strong>reschedule a session</strong>.
Please review the proposed new time slots below.
</p>

<div style="background:#fff8e1; padding:12px; border-left:4px solid #ffc107; margin:20px 0; font-size:14px; color:#555;">
This request requires your approval before the session is updated.
</div>

<h3 style="color:#143453; margin-top:20px;">Requested New Slots</h3>

<table width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse; margin-top:10px; font-size:14px;">
    <thead>
        <tr style="background:#f5f5f5;">
            <th style="padding:10px; border:1px solid #eee; text-align:left;">Date</th>
            <th style="padding:10px; border:1px solid #eee; text-align:left;">Start Time</th>
            <th style="padding:10px; border:1px solid #eee; text-align:left;">End Time</th>
            <th style="padding:10px; border:1px solid #eee; text-align:left;">Duration</th>
        </tr>
    </thead>

    <tbody>
        @foreach($slots as $slot)
        <tr>
            <td style="padding:10px; border:1px solid #eee;">
                {{ \Carbon\Carbon::parse($slot['date'])->format('d M Y') }}
            </td>

            <td style="padding:10px; border:1px solid #eee;">
                {{ \Carbon\Carbon::parse($slot['start_time'])->format('h:i A') }}
            </td>

            <td style="padding:10px; border:1px solid #eee;">
                {{ \Carbon\Carbon::parse($slot['end_time'])->format('h:i A') }}
            </td>

            <td style="padding:10px; border:1px solid #eee;">
                {{ \Carbon\Carbon::parse($slot['start_time'])->diffInHours(\Carbon\Carbon::parse($slot['end_time'])) }} hour(s)
            </td>
        </tr>
        @endforeach
    </tbody>
</table>

<p style="margin-top:20px; font-size:14px; color:#555;">
Please log in to your dashboard to approve or decline this reschedule request.
</p>

<br>

<p style="font-size:14px;">
Thanks,<br>
<strong>Tutera Team</strong>
</p>

@endsection