<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Prescription Approved</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; margin: 0; padding: 0; background: #f5f5f5; color: #333; }
.wrapper { max-width: 600px; margin: 0 auto; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.header { background: linear-gradient(135deg, #0d9488, #059669); color: #fff; padding: 32px 40px; text-align: center; }
.header h1 { margin: 0; font-size: 26px; font-weight: 700; }
.header p { margin: 8px 0 0; opacity: .85; font-size: 15px; }
.body { padding: 32px 40px; }
.greeting { font-size: 17px; margin-bottom: 20px; }
.info-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 16px 20px; margin-bottom: 24px; }
.info-box p { margin: 6px 0; font-size: 14px; color: #166534; }
.info-box strong { color: #14532d; }
.notes-box { background: #f9fafb; border-left: 4px solid #0d9488; border-radius: 0 8px 8px 0; padding: 12px 16px; margin-bottom: 24px; font-size: 14px; color: #374151; }
.cta { text-align: center; margin: 28px 0; }
.btn { display: inline-block; background: #0d9488; color: #fff; padding: 12px 28px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 15px; }
.warning-box { background: #fefce8; border: 1px solid #fde047; border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; color: #713f12; }
.footer { background: #f9fafb; padding: 20px 40px; text-align: center; font-size: 12px; color: #9ca3af; border-top: 1px solid #f0f0f0; }
</style>
</head>
<body>
<div class="wrapper">
<div class="header">
<div style="font-size:40px; margin-bottom:8px;">✅</div>
<h1>Prescription Approved!</h1>
<p>You're ready to order your medicines.</p>
</div>
<div class="body">
<p class="greeting">Hi {{ $prescription->customer?->name ?? 'Valued Customer' }},</p>
<p>Great news! Your prescription (Rx #{{ $prescription->id }}) has been reviewed and <strong>approved</strong> by our pharmacist. You can now proceed to checkout for any prescription medicines in your cart.</p>
<div class="info-box">
<p><strong>Prescription Reference:</strong> Rx #{{ $prescription->id }}</p>
<p><strong>Status:</strong> ✅ Approved</p>
<p><strong>Approved on:</strong> {{ $prescription->reviewed_at?->format('d M Y, h:i A') }}</p>
@if($prescription->valid_until)
<p><strong>Valid Until:</strong> {{ $prescription->valid_until->format('d M Y') }}</p>
@endif
@if($prescription->reviewer)
<p><strong>Reviewed by:</strong> {{ $prescription->reviewer->name }}</p>
@endif
</div>
@if($prescription->pharmacist_notes)
<div class="notes-box">
<strong>Pharmacist Notes:</strong><br>
{{ $prescription->pharmacist_notes }}
</div>
@endif
<div class="warning-box">
⚠️ This prescription is valid for 6 months from the date of approval. Please ensure you use it within the validity period. Prescription medicines can only be dispensed against this approved prescription.
</div>
<div class="cta">
<a href="{{ url('/') }}" class="btn">Shop Prescription Medicines →</a>
</div>
<p style="font-size:13px; color:#6b7280;">If you have any questions about your prescription or need assistance, please contact our pharmacy helpline or reply to this email.</p>
</div>
<div class="footer">
<p>© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.</p>
<p style="margin-top:4px;">This email was sent regarding Prescription Rx #{{ $prescription->id }}</p>
</div>
</div>
</body>
</html>