<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{{ get_phrase('Payment Successful') }} | {{ config('app.name') }}</title>
    <style>
        /* Reset & Base */
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: #f9fafb;
            margin: 0;
            padding: 20px;
            line-height: 1.5;
            color: #374151;
        }
        
        .email-container {
            max-width: 600px;
            margin: 0 auto;
            background: #ffffff;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
            border: 1px solid #e5e7eb;
        }
        
        /* Header */
        .email-header {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            padding: 40px 30px;
            text-align: center;
            position: relative;
        }
        
        .header-icon {
            font-size: 48px;
            margin-bottom: 16px;
            display: block;
        }
        
        .header-title {
            font-size: 28px;
            font-weight: 700;
            margin: 0 0 8px 0;
            letter-spacing: -0.025em;
        }
        
        .header-subtitle {
            font-size: 16px;
            opacity: 0.9;
            font-weight: 400;
            margin: 0;
        }
        
        /* Content */
        .email-body {
            padding: 40px 30px;
        }
        
        .greeting {
            font-size: 18px;
            color: #111827;
            margin-bottom: 24px;
            font-weight: 500;
        }
        
        .greeting strong {
            color: #059669;
        }
        
        .intro-text {
            font-size: 16px;
            color: #4b5563;
            margin-bottom: 32px;
            line-height: 1.6;
        }
        
        /* Info Box */
        .info-box {
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            border-radius: 12px;
            padding: 28px;
            margin: 32px 0;
            border: 1px solid #e2e8f0;
        }
        
        .info-box-title {
            font-size: 18px;
            font-weight: 700;
            color: #1e293b;
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .info-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 0;
            border-bottom: 1px solid #e2e8f0;
        }
        
        .info-row:last-child {
            border-bottom: none;
        }
        
        .info-label {
            font-weight: 500;
            color: #64748b;
            font-size: 15px;
            min-width: 120px;
        }
        
        .info-value {
            font-weight: 600;
            color: #1e293b;
            font-size: 16px;
            text-align: right;
        }
        
        .va-number {
            background: white;
            padding: 12px 16px;
            border-radius: 8px;
            font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
            font-size: 18px;
            letter-spacing: 1.5px;
            color: #1e293b;
            border: 2px solid #cbd5e1;
            display: inline-block;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }
        
        .amount {
            color: #059669;
            font-size: 22px;
            font-weight: 700;
        }
        
        /* Courses Section */
        .courses-section {
            margin: 32px 0;
        }
        
        .section-title {
            font-size: 18px;
            font-weight: 700;
            color: #1e293b;
            margin-bottom: 20px;
            padding-bottom: 12px;
            border-bottom: 2px solid #e2e8f0;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .course-item {
            background: white;
            border-radius: 10px;
            padding: 18px;
            margin-bottom: 12px;
            border: 1px solid #e2e8f0;
            transition: all 0.2s ease;
        }
        
        .course-item:hover {
            border-color: #059669;
            box-shadow: 0 4px 12px rgba(5, 150, 105, 0.1);
        }
        
        .course-title {
            font-size: 16px;
            font-weight: 600;
            color: #374151;
            margin: 0;
        }
        
        /* Next Steps */
        .next-steps {
            background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
            border-radius: 12px;
            padding: 28px;
            margin: 32px 0;
            border: 1px solid #93c5fd;
        }
        
        .next-steps-title {
            font-size: 18px;
            font-weight: 700;
            color: #1e40af;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .steps-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .steps-list li {
            padding: 10px 0 10px 32px;
            position: relative;
            font-size: 15px;
            color: #374151;
            line-height: 1.5;
        }
        
        .steps-list li:before {
            content: '→';
            position: absolute;
            left: 0;
            color: #3b82f6;
            font-weight: bold;
            font-size: 14px;
            width: 24px;
            height: 24px;
            background: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        /* CTA Buttons */
        .cta-buttons {
            text-align: center;
            margin: 40px 0 32px;
        }
        
        .cta-button {
            display: inline-block;
            background: linear-gradient(135deg, #059669 0%, #047857 100%);
            color: white !important;
            text-decoration: none;
            padding: 16px 32px;
            border-radius: 12px;
            font-weight: 600;
            font-size: 16px;
            margin: 0 8px;
            transition: all 0.3s ease;
            box-shadow: 0 4px 16px rgba(5, 150, 105, 0.25);
            border: none;
            cursor: pointer;
        }
        
        .cta-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(5, 150, 105, 0.35);
        }
        
        .cta-button-secondary {
            display: inline-block;
            background: white !important;
            color: #059669 !important;
            text-decoration: none;
            padding: 14px 28px;
            border-radius: 12px;
            font-weight: 600;
            font-size: 15px;
            margin: 0 8px;
            border: 2px solid #059669;
            transition: all 0.3s ease;
        }
        
        .cta-button-secondary:hover {
            background: #f0fdf4;
        }
        
        /* Final Message */
        .final-message {
            text-align: center;
            margin: 32px 0;
            padding: 24px;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            border-radius: 12px;
            border: 1px solid #e2e8f0;
        }
        
        .final-text {
            font-size: 15px;
            color: #4b5563;
            margin-bottom: 12px;
        }
        
        .final-subtext {
            font-size: 18px;
            color: #1e293b;
            font-weight: 600;
            margin: 0;
        }
        
        /* Footer */
        .email-footer {
            background: #1e293b;
            color: #cbd5e1;
            padding: 32px;
            text-align: center;
            font-size: 14px;
        }
        
        .footer-brand {
            font-size: 20px;
            font-weight: 700;
            color: white;
            margin-bottom: 16px;
            letter-spacing: 0.5px;
        }
        
        .footer-disclaimer {
            font-size: 13px;
            color: #94a3b8;
            margin-top: 20px;
            line-height: 1.5;
        }
        
        /* Responsive */
        @media (max-width: 640px) {
            body {
                padding: 16px;
            }
            
            .email-body {
                padding: 30px 24px;
            }
            
            .email-header {
                padding: 32px 24px;
            }
            
            .header-title {
                font-size: 24px;
            }
            
            .info-row {
                flex-direction: column;
                align-items: flex-start;
                gap: 6px;
                padding: 16px 0;
            }
            
            .info-label {
                min-width: auto;
            }
            
            .info-value {
                text-align: left;
                width: 100%;
            }
            
            .va-number {
                font-size: 16px;
                padding: 10px 14px;
                letter-spacing: 1px;
                display: block;
                text-align: center;
            }
            
            .cta-button,
            .cta-button-secondary {
                display: block;
                width: 100%;
                margin: 8px 0;
                text-align: center;
            }
            
            .cta-buttons {
                margin: 32px 0 24px;
            }
        }
        
        @media (max-width: 480px) {
            .email-body {
                padding: 24px 20px;
            }
            
            .email-header {
                padding: 28px 20px;
            }
            
            .info-box,
            .next-steps {
                padding: 20px;
            }
        }
    </style>
</head>
<body>
    <div class="email-container">
        
        <div class="email-header">
            <div class="header-icon">🎉</div>
            <h1 class="header-title">{{ get_phrase('Payment Successful') }}</h1>
            <p class="header-subtitle">{{ get_phrase('Your courses are now available!') }}</p>
        </div>

        <div class="email-body">
            <div class="greeting">
                {{ get_phrase('Congratulations') }}, <strong>{{ $user->name }}</strong>! 🎊
            </div>

            <p class="intro-text">
                {{ get_phrase('We have successfully processed your payment. Your courses are now available for immediate access. Thank you for your purchase!') }}
            </p>

            <!-- Payment Details Box -->
            <div class="info-box">
                <div class="info-box-title">
                    <span>💳</span>
                    {{ get_phrase('Payment Details') }}
                </div>
                
                <div class="info-row">
                    <span class="info-label">{{ get_phrase('Virtual Account') }}</span>
                    <div class="info-value">
                        <div class="va-number">{{ chunk_split($payment->va_number, 4, ' ') }}</div>
                    </div>
                </div>
                
                <div class="info-row">
                    <span class="info-label">{{ get_phrase('Amount Paid') }}</span>
                    <span class="info-value amount">Rp {{ number_format($payment->total_amount, 0, ',', '.') }}</span>
                </div>
                
                <div class="info-row">
                    <span class="info-label">{{ get_phrase('Payment Date') }}</span>
                    <span class="info-value">
                        📅 {{ optional($payment->paid_at)->format('l, F d, Y \a\t H:i') }}
                    </span>
                </div>
                
                <div class="info-row">
                    <span class="info-label">{{ get_phrase('Transaction ID') }}</span>
                    <span class="info-value">
                        #{{ $payment->id }}
                    </span>
                </div>
            </div>

            <!-- Courses Section -->
            @if($courses->count() > 0)
            <div class="courses-section">
                <div class="section-title">📚 {{ get_phrase('Your Courses Are Now Available') }}</div>
                
                @foreach($courses as $course)
                <div class="course-item">
                    <div class="course-title">{{ $course->title }}</div>
                </div>
                @endforeach
            </div>
            @endif

            <!-- Next Steps -->
            <div class="next-steps">
                <div class="next-steps-title">🚀 {{ get_phrase('What You Can Do Now') }}</div>
                <ul class="steps-list">
                    <li>{{ get_phrase('Access all course materials immediately') }}</li>
                    <li>{{ get_phrase('Join course discussions and forums') }}</li>
                    <li>{{ get_phrase('Complete assignments and quizzes') }}</li>
                    <li>{{ get_phrase('Track your learning progress') }}</li>
                </ul>
            </div>

            <!-- CTA Buttons -->
            <div class="cta-buttons">
                <a href="{{ url('/my-courses') }}" class="cta-button">
                    {{ get_phrase('Start Learning Now') }}
                </a>
                <a href="{{ url('/') }}" class="cta-button-secondary">
                    {{ get_phrase('Browse More Courses') }}
                </a>
            </div>

            <!-- Final Message -->
            <div class="final-message">
                <p class="final-text">
                    {{ get_phrase('If you need any assistance with your courses, our support team is always ready to help.') }}
                </p>
                <p class="final-subtext">
                    {{ get_phrase('Happy Learning!') }} 📚✨
                </p>
            </div>
        </div>

        <!-- Footer -->
        <div class="email-footer">
            <div class="footer-brand">{{ config('app.name') }}</div>
            
            <div class="footer-disclaimer">
                {{ get_phrase('This is an automated email. Please do not reply to this message.') }}<br>
                {{ get_phrase('If you have any questions about your purchase, please contact our support team.') }}
            </div>
        </div>
    </div>
</body>
</html>