<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Enrollment Confirmed</title>
</head>
<body style="margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f3f4f6;">
    <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="max-width: 600px; margin: 0 auto; background-color: #ffffff;">
        <!-- Header -->
        <tr>
            <td style="background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%); padding: 40px 30px; text-align: center;">
                <div style="width: 60px; height: 60px; background-color: rgba(255,255,255,0.2); border-radius: 50%; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center;">
                    <span style="font-size: 30px;">🎓</span>
                </div>
                <h1 style="margin: 0; color: #ffffff; font-size: 28px; font-weight: 600;">
                    Enrollment Confirmed!
                </h1>
            </td>
        </tr>
        
        <!-- Body -->
        <tr>
            <td style="padding: 40px 30px;">
                <p style="margin: 0 0 20px; font-size: 16px; color: #374151; line-height: 1.6;">
                    Dear {{ $userName }},
                </p>
                
                <p style="margin: 0 0 20px; font-size: 16px; color: #374151; line-height: 1.6;">
                    Congratulations! You are now fully enrolled in <strong>{{ $trainingName }}</strong>. We're excited to have you on this learning journey!
                </p>
                
                <!-- Schedule Overview Card -->
                <table role="presentation" width="100%" style="background-color: #f5f3ff; border: 1px solid #ede9fe; border-radius: 8px; margin: 30px 0;">
                    <tr>
                        <td style="padding: 25px;">
                            <h3 style="margin: 0 0 15px; color: #5b21b6; font-size: 18px;">
                                📋 Training Schedule
                            </h3>
                            <p style="margin: 0 0 20px; color: #6d28d9; font-size: 14px; line-height: 1.6;">
                                {{ $schedule }}
                            </p>
                        </td>
                    </tr>
                </table>
                
                @if($sessions->count() > 0)
                <!-- Sessions List -->
                <table role="presentation" width="100%" style="background-color: #f9fafb; border-radius: 8px; margin: 30px 0;">
                    <tr>
                        <td style="padding: 25px;">
                            <h3 style="margin: 0 0 20px; color: #111827; font-size: 18px;">
                                Upcoming Sessions
                            </h3>
                            @foreach($sessions as $session)
                            <table role="presentation" width="100%" style="border: 1px solid #e5e7eb; border-radius: 6px; margin-bottom: 15px;">
                                <tr>
                                    <td style="padding: 15px; background-color: #ffffff;">
                                        <h4 style="margin: 0 0 10px; color: #111827; font-size: 15px;">
                                            {{ $session['name'] }}
                                        </h4>
                                        <table role="presentation" width="100%" cellspacing="0" cellpadding="4">
                                            <tr>
                                                <td style="color: #6b7280; font-size: 13px; width: 30%;">📅 Date:</td>
                                                <td style="color: #374151; font-size: 13px;">{{ $session['date'] }}</td>
                                            </tr>
                                            <tr>
                                                <td style="color: #6b7280; font-size: 13px;">⏰ Time:</td>
                                                <td style="color: #374151; font-size: 13px;">{{ $session['time'] }}</td>
                                            </tr>
                                            <tr>
                                                <td style="color: #6b7280; font-size: 13px;">📍 Venue:</td>
                                                <td style="color: #374151; font-size: 13px;">{{ $session['venue'] }}</td>
                                            </tr>
                                            @if($session['meeting_link'])
                                            <tr>
                                                <td style="color: #6b7280; font-size: 13px;">🔗 Link:</td>
                                                <td style="color: #374151; font-size: 13px;">
                                                    <a href="{{ $session['meeting_link'] }}" style="color: #7c3aed;">Join Online</a>
                                                </td>
                                            </tr>
                                            @endif
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            @endforeach
                        </td>
                    </tr>
                </table>
                @endif
                
                <!-- Important Notes -->
                <table role="presentation" width="100%" style="background-color: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; margin: 30px 0;">
                    <tr>
                        <td style="padding: 20px;">
                            <h4 style="margin: 0 0 10px; color: #92400e; font-size: 15px;">
                                ⚠️ Important Notes
                            </h4>
                            <ul style="margin: 0; padding-left: 20px; color: #78350f; font-size: 13px; line-height: 1.8;">
                                <li>Please arrive 10 minutes early for in-person sessions</li>
                                <li>Test your connection before online sessions</li>
                                <li>Bring a notebook and pen for taking notes</li>
                                <li>Contact us if you have any accessibility requirements</li>
                            </ul>
                        </td>
                    </tr>
                </table>
                
                <!-- Call to Action -->
                <table role="presentation" width="100%" style="margin: 30px 0;">
                    <tr>
                        <td align="center">
                            <a href="{{ route('training.registrations.my') }}" style="display: inline-block; background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%); color: #ffffff; padding: 14px 32px; text-decoration: none; border-radius: 6px; font-size: 15px; font-weight: 500;">
                                Access Training Materials
                            </a>
                        </td>
                    </tr>
                </table>
                
                <p style="margin: 0; font-size: 14px; color: #6b7280; line-height: 1.6;">
                    Best regards,<br>
                    <strong>{{ config('app.name') }}</strong> Training Team
                </p>
            </td>
        </tr>
        
        <!-- Footer -->
        <tr>
            <td style="background-color: #f3f4f6; padding: 30px; text-align: center; border-top: 1px solid #e5e7eb;">
                <p style="margin: 0 0 10px; font-size: 13px; color: #6b7280;">
                    &copy; {{ date('Y') }} {{ config('app.name') }}. All rights reserved.
                </p>
                <p style="margin: 0; font-size: 12px; color: #9ca3af;">
                    We look forward to seeing you at the training!
                </p>
            </td>
        </tr>
    </table>
</body>
</html>
