@extends('layouts.app') @section('content')
@php $mainImage = $car->mainImage ?? $car->images->first(); $imagePath = $mainImage ? $mainImage->path : null; $imageUrl = $imagePath ? (str_starts_with($imagePath, 'http') ? $imagePath : asset('storage/'.$imagePath)) : asset('images/login-bg.png'); @endphp {{ $car->title }}
{{ $car->status }}
@if($car->images->count() > 1)
@foreach($car->images as $image) Thumbnail @endforeach
@endif

{{ $car->title }}

{{ $car->brand->name ?? 'Unknown' }} | {{ $car->carModel->name ?? 'Unknown' }} | {{ $car->year }}

{{ number_format($car->price ?? $car->daily_price, 0) }}
{{ app()->getLocale() == 'ar' ? 'ر.س' : 'SAR' }}
{{ app()->getLocale() == 'ar' ? 'سنة' : 'Year' }}
{{ $car->year }}
{{ app()->getLocale() == 'ar' ? 'المسافة' : 'Mileage' }}
{{ number_format($car->mileage ?? 0) }}
km
{{ app()->getLocale() == 'ar' ? 'المقاعد' : 'Seats' }}
{{ $car->seats ?? '—' }}
{{ app()->getLocale() == 'ar' ? 'الأبواب' : 'Doors' }}
{{ $car->doors ?? '—' }}

{{ app()->getLocale() == 'ar' ? '⚙️ المواصفات' : '⚙️ Specifications' }}

{{ app()->getLocale() == 'ar' ? 'نوع الوقود' : 'Fuel Type' }}
{{ $car->fuel_type ?? '—' }}
{{ app()->getLocale() == 'ar' ? 'الناقل' : 'Transmission' }}
{{ $car->transmission ?? '—' }}
{{ app()->getLocale() == 'ar' ? 'نوع المحرك' : 'Engine Size' }}
{{ $car->engine_size ?? '—' }}
{{ app()->getLocale() == 'ar' ? 'القوة الحصانية' : 'Horsepower' }}
{{ $car->horsepower ?? '—' }} HP
{{ app()->getLocale() == 'ar' ? 'نوع المحرك' : 'Drive Type' }}
{{ $car->drive_type ?? '—' }}
{{ app()->getLocale() == 'ar' ? 'نوع الجسم' : 'Body Type' }}
{{ $car->body_type ?? '—' }}
{{ app()->getLocale() == 'ar' ? 'اللون الخارجي' : 'Exterior Color' }}
@if($car->color_ext)
@endif {{ $car->color_ext ?? '—' }}
{{ app()->getLocale() == 'ar' ? 'اللون الداخلي' : 'Interior Color' }}
@if($car->color_int)
@endif {{ $car->color_int ?? '—' }}
@if($car->description)

{{ app()->getLocale() == 'ar' ? '📝 الوصف' : '📝 Description' }}

{{ $car->description }}

@endif @php $features = is_string($car->features) ? json_decode($car->features, true) : $car->features; @endphp @if($features && count($features) > 0)

{{ app()->getLocale() == 'ar' ? '✨ المميزات' : '✨ Features' }}

@foreach($features as $feature)
{{ $feature }}
@endforeach
@endif @if($insurances->count() > 0)

{{ app()->getLocale() == 'ar' ? '🛡️ التأمين' : '🛡️ Insurance' }}

@foreach($insurances as $insurance)
{{ $insurance->company->name ?? 'Unknown' }}
{{ app()->getLocale() == 'ar' ? 'رقم البوليصة' : 'Policy #' }}: {{ $insurance->policy_number }}
{{ $insurance->isExpired() ? (app()->getLocale() == 'ar' ? 'منتهي' : 'Expired') : (app()->getLocale() == 'ar' ? 'نشط' : 'Active') }}
{{ app()->getLocale() == 'ar' ? 'النوع' : 'Type' }}: {{ $insurance->insurance_type }}
{{ app()->getLocale() == 'ar' ? 'المبلغ المغطى' : 'Coverage' }}: {{ number_format($insurance->coverage_amount, 0) }}
{{ app()->getLocale() == 'ar' ? 'من' : 'From' }}: {{ $insurance->start_date->format('Y-m-d') }}
{{ app()->getLocale() == 'ar' ? 'إلى' : 'To' }}: {{ $insurance->end_date->format('Y-m-d') }}
@endforeach
@endif @if($maintenance->count() > 0)

{{ app()->getLocale() == 'ar' ? '🔧 سجل الصيانة' : '🔧 Maintenance History' }}

@foreach($maintenance as $record)
{{ $record->description }}
{{ number_format($record->cost, 0) }} {{ app()->getLocale() == 'ar' ? 'ر.س' : 'SAR' }}
{{ $record->maintenance_date->format('Y-m-d H:i') }} @if($record->next_due_km) {{ app()->getLocale() == 'ar' ? 'الصيانة التالية عند' : 'Next due at' }}: {{ number_format($record->next_due_km) }} km @endif
@endforeach
@endif @if($documents->count() > 0)

{{ app()->getLocale() == 'ar' ? '📄 الوثائق' : '📄 Documents' }}

@foreach($documents as $doc)
{{ app()->getLocale() == 'ar' ? 'وثائق السيارة' : 'Vehicle Documents' }}
{{ $doc->calculated_status === 'valid' ? (app()->getLocale() == 'ar' ? '✓ صالح' : '✓ Valid') : ($doc->calculated_status === 'expiring_soon' ? (app()->getLocale() == 'ar' ? '⚠️ ينتهي قريباً' : '⚠️ Expiring Soon') : (app()->getLocale() == 'ar' ? '✕ منتهي' : '✕ Expired')) }}
{{ app()->getLocale() == 'ar' ? 'صلاحية التسجيل' : 'Registration Expiry' }} {{ $doc->registration_expiry_date->format('Y-m-d') }}
{{ app()->getLocale() == 'ar' ? 'صلاحية الفحص' : 'Inspection Expiry' }} {{ $doc->inspection_expiry_date->format('Y-m-d') }}
{{ app()->getLocale() == 'ar' ? 'تاريخ الفحص' : 'Inspection Date' }} {{ $doc->inspection_date->format('Y-m-d') }}
{{ app()->getLocale() == 'ar' ? 'الحالة' : 'Status' }} {{ $doc->status }}
@if($doc->notes)
{{ app()->getLocale() == 'ar' ? 'ملاحظات' : 'Notes' }}: {{ $doc->notes }}
@endif
@endforeach
@endif

{{ app()->getLocale() == 'ar' ? '💰 الأسعار' : '💰 Pricing' }}

@if($car->daily_price)
{{ app()->getLocale() == 'ar' ? 'السعر اليومي' : 'Daily' }} {{ number_format($car->daily_price, 0) }}
@endif @if($car->weekly_price)
{{ app()->getLocale() == 'ar' ? 'السعر الأسبوعي' : 'Weekly' }} {{ number_format($car->weekly_price, 0) }}
@endif @if($car->monthly_price)
{{ app()->getLocale() == 'ar' ? 'السعر الشهري' : 'Monthly' }} {{ number_format($car->monthly_price, 0) }}
@endif

{{ app()->getLocale() == 'ar' ? 'ℹ️ معلومات إضافية' : 'ℹ️ Additional Info' }}

{{ app()->getLocale() == 'ar' ? 'رقم الهيكل (VIN)' : 'VIN' }}
{{ $car->vin ?? '—' }}
{{ app()->getLocale() == 'ar' ? 'رقم اللوحة' : 'Plate Number' }}
{{ $car->plate_number ?? '—' }}
{{ app()->getLocale() == 'ar' ? 'الحالة' : 'Condition' }}
{{ ucfirst($car->condition) ?? '—' }}
@if($car->insurance_deposit)
{{ app()->getLocale() == 'ar' ? 'تأمين التأجير' : 'Insurance Deposit' }}
{{ number_format($car->insurance_deposit, 0) }}
@endif

{{ app()->getLocale() == 'ar' ? '📊 الإحصائيات' : '📊 Statistics' }}

{{ app()->getLocale() == 'ar' ? 'إجمالي العقود' : 'Total Rentals' }} {{ $totalRentals }}
{{ app()->getLocale() == 'ar' ? 'العقود النشطة' : 'Active Rentals' }} {{ $activeRentals }}
{{ app()->getLocale() == 'ar' ? 'الاستفسارات' : 'Inquiries' }} {{ $inquiries }}
@if($car->branch)

{{ app()->getLocale() == 'ar' ? '🏢 الفرع' : '🏢 Branch' }}

{{ $car->branch->name }}
@endif

{{ app()->getLocale() == 'ar' ? '⚙️ العمليات' : '⚙️ Actions' }}

{{ app()->getLocale() == 'ar' ? '✏️ تعديل' : '✏️ Edit' }}
@csrf @method('DELETE')
@endsection