@extends('emails.master')

@section('title','Booking Confirmation')

@section('content')

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

<p style="font-size:15px; color:#555; line-height:1.6;">
Your booking has been <strong>confirmed successfully</strong>. Here are the details of your session:
</p>

<table width="100%" cellpadding="0" cellspacing="0" style="border-collapse:collapse; margin-top:20px; font-size:14px;">
    <tbody>

        <tr>
            <td style="padding:10px; border:1px solid #eee; background:#f9f9f9; width:40%;">
                <strong>Tutor</strong>
            </td>
            <td style="padding:10px; border:1px solid #eee;">
                {{ $tutor->first_name . ' ' . $tutor->last_name }}
            </td>
        </tr>

        <tr>
            <td style="padding:10px; border:1px solid #eee; background:#f9f9f9;">
                <strong>Session Date & Time</strong>
            </td>

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

        <tr>
            <td style="padding:10px; border:1px solid #eee; background:#f9f9f9;">
                <strong>Total Amount</strong>
            </td>

            <td style="padding:10px; border:1px solid #eee;">
                ${{ number_format($totalAmount, 2) }}
            </td>
        </tr>

    </tbody>
</table>

<p style="margin-top:20px; font-size:14px; color:#555;">
We look forward to your session!
</p>

<div style="text-align:center; margin:30px 0;">
    <a href="{{ $dashboardUrl }}"
       style="background:#ffc107; color:#143453; padding:12px 28px; text-decoration:none; border-radius:6px; font-size:14px; font-weight:bold;">
        Go to Dashboard
    </a>
</div>

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

@endsection