@php
// Country codes for FlagCDN
$languageCodes = [
'korean' => 'kr',
'japanese' => 'jp',
'spanish' => 'es',
'spain' => 'es',
'tagalog' => 'ph',
'arabic' => 'sa',
'hindi' => 'in',
'english' => 'gb',
'malay' => 'my',
'mandarin' => 'cn',
'chinese' => 'cn',
'russian' => 'ru',
'thai' => 'th',
'french' => 'fr',
'france' => 'fr',
'german' => 'de',
'germany' => 'de',
'italian' => 'it',
'portuguese' => 'pt',
'vietnamese' => 'vn',
'indonesian' => 'id',
'latin' => 'va', // Vatican - Latin is the official language
];
@endphp
@foreach($enrolledCourses as $course)
@php
$code = $languageCodes[strtolower($course)] ?? null;
$flagUrl = $code ? "https://flagcdn.com/w40/{$code}.png" : null;
@endphp
@endforeach
@else
{{-- No enrolled courses - show only General Knowledge --}}
💡 Enroll in language courses to unlock more quizzes!