@extends('layouts.dashboard') @section('title', $country->country_name . ' — Risk Profile') @push('styles') @endpush @section('content') {{-- BREADCRUMB --}} {{-- COUNTRY BANNER --}}
{{-- Risk Gauge --}}
{{-- Track --}} {{-- Fill (animated via JS) --}} {{ number_format($riskScore?->total_score ?? 0, 1) }} / 100
{{ $riskScore?->risk_level ?? 'No Data' }}
{{-- INFO CARDS --}}
💰
GDP
{{ $economic?->formatted_gdp ?? 'N/A' }}
World Bank {{ $economic?->year ?? '—' }}
📈
Inflation
{{ $economic ? number_format($economic->inflation ?? 0, 2) . '%' : 'N/A' }}
Consumer Price Index
👥
Population
@if($economic?->population) {{ number_format((int) $economic->population) }} @else N/A @endif
{{ $country->country_name }}
💱
Exchange Rate
{{ $currency ? '1 USD = ' . number_format($currency->exchange_rate, 4) . ' ' . $currency->target_currency : 'N/A' }}
Open Exchange Rates
📦
Exports
@php $exports = $economic?->exports; $exportsFormatted = match(true) { $exports === null => 'N/A', $exports >= 1_000_000_000_000 => '$' . round($exports / 1_000_000_000_000, 2) . 'T', $exports >= 1_000_000_000 => '$' . round($exports / 1_000_000_000, 2) . 'B', $exports >= 1_000_000 => '$' . round($exports / 1_000_000, 2) . 'M', default => '$' . number_format($exports, 0), }; @endphp
{{ $exportsFormatted }}
Economic Cache
🛳️
Imports
@php $imports = $economic?->imports; $importsFormatted = match(true) { $imports === null => 'N/A', $imports >= 1_000_000_000_000 => '$' . round($imports / 1_000_000_000_000, 2) . 'T', $imports >= 1_000_000_000 => '$' . round($imports / 1_000_000_000, 2) . 'B', $imports >= 1_000_000 => '$' . round($imports / 1_000_000, 2) . 'M', default => '$' . number_format($imports, 0), }; @endphp
{{ $importsFormatted }}
Economic Cache
{{ $weather?->weather_icon ?? '🌡️' }}
Temperature
{{ $weather ? $weather->temperature . '°C' : 'N/A' }}
{{ $weather?->weather_condition ?? 'Open Meteo' }}
💨
Wind Speed
{{ $weather ? $weather->wind_speed . ' km/h' : 'N/A' }}
Humidity: {{ $weather ? $weather->humidity . '%' : 'N/A' }}
⚓
Ports
{{ $ports->count() }}
Active Ports
📰
News
{{ $news->count() }}
Recent Articles
{{-- MAIN CONTENT: Charts + Risk + Recommendation + Ports + News --}}
{{-- LEFT: Charts + News --}}
{{-- GDP + Inflation Chart --}} @if($economicHistory->isNotEmpty())
Economic Trend
@endif {{-- News --}} {{-- Ports --}} @if($ports->isNotEmpty())
Ports in {{ $country->country_name }}
@foreach($ports as $port)
{{ $port->port_name }}
@if($port->city)
{{ $port->city }}
@endif
{{ $port->port_type }} ● {{ $port->status }}
@endforeach
@endif
{{-- RIGHT: Risk Breakdown + Recommendation --}}
{{-- Risk Score Breakdown --}}
Risk Breakdown
📰 News Sentiment {{ number_format($riskScore?->news_score ?? 0, 1) }} / 100
Weight: 40%
🌦️ Weather Risk {{ number_format($riskScore?->weather_score ?? 0, 1) }} / 100
Weight: 30%
📈 Inflation Risk {{ number_format($riskScore?->inflation_score ?? 0, 1) }} / 100
Weight: 20%
💱 Currency Risk {{ number_format($riskScore?->currency_score ?? 0, 1) }} / 100
Weight: 10%
{{-- Radar Chart --}}
{{-- AI Recommendation --}}
{{ match($recommendation['level']) { 'Low' => '✅', 'Medium' => '⚠️', 'High' => '🔶', 'Critical' => '🚨', default => '❓' } }}
Decision Recommendation
{{ $recommendation['action'] }}
@if(!empty($recommendation['positive']))
✓ Positive Factors
@foreach($recommendation['positive'] as $p)
{{ $p }}
@endforeach
@endif @if(!empty($recommendation['negative']))
⚠ Risk Factors
@foreach($recommendation['negative'] as $n)
{{ $n }}
@endforeach
@endif
@endsection @push('scripts') @endpush