@extends('layouts.base')
@section('title', __('Booking confirmed'))

@section('body')
<div class="container py-5" style="max-width:30rem">
    <div class="mb-card p-4 text-center">
        <div style="font-size:3rem">✅</div>
        <h1 class="h4 fw-bold">{{ __('Booking confirmed') }}</h1>
        <p class="mb-muted">{{ __('We sent the details to your WhatsApp.') }}</p>
        <hr style="border-color:var(--mb-line)">
        <dl class="row text-start mb-0">
            <dt class="col-5">{{ __('Clinic') }}</dt><dd class="col-7">{{ $tenant->name }}</dd>
            <dt class="col-5">{{ __('Dentist') }}</dt><dd class="col-7">{{ $appointment->dentist->name }}</dd>
            <dt class="col-5">{{ __('Date') }}</dt><dd class="col-7">{{ $localStart->translatedFormat('l, d M Y') }}</dd>
            <dt class="col-5">{{ __('Time') }}</dt><dd class="col-7" dir="ltr">{{ $localStart->format('H:i') }}</dd>
        </dl>
        <hr style="border-color:var(--mb-line)">
        <form method="POST" action="{{ route('public.booking.cancel', $appointment->uuid) }}"
              onsubmit="return confirm('{{ __('Cancel this appointment?') }}')">
            @csrf
            <button class="btn mb-btn-ghost btn-sm">{{ __('Cancel this appointment') }}</button>
        </form>
    </div>
</div>

@if($tenant->whatsapp_number)
    <a class="wa-fab" target="_blank" rel="noopener" aria-label="WhatsApp"
       href="https://wa.me/{{ preg_replace('/\D+/', '', $tenant->whatsapp_number) }}">💬</a>
@endif
@endsection
