<div class="card">
    <div class="card-header"><h4 class="card-title mb-0">Google Ads — En Çok Harcayan Kampanyalar</h4></div>
    <div class="card-body p-0">
        <div class="table-responsive">
            <table class="table table-striped mb-0"><thead><tr><th>Tarih</th><th>Kampanya</th><th>Harcama</th><th>Tıklama</th><th>Gösterim</th><th>Dönüşüm</th></tr></thead><tbody>
            @forelse($latestGoogleCampaigns as $row)
                <tr><td>{{ $row->date?->format('d.m.Y') }}</td><td>{{ $row->campaign_name }}</td><td>{{ number_format((float)$row->cost, 2, ',', '.') }}</td><td>{{ number_format($row->clicks, 0, ',', '.') }}</td><td>{{ number_format($row->impressions, 0, ',', '.') }}</td><td>{{ number_format((float)$row->conversions, 2, ',', '.') }}</td></tr>
            @empty
                <tr><td colspan="6" class="text-center text-muted py-4">Henüz Google kampanya snapshot yok.</td></tr>
            @endforelse
            </tbody></table>
        </div>
    </div>
</div>

<div class="card">
    <div class="card-header"><h4 class="card-title mb-0">Google Ads — Kelime ve Arama Terimi</h4></div>
    <div class="card-body p-0">
        <div class="table-responsive">
            <table class="table mb-0"><thead><tr><th>Tip</th><th>Tarih</th><th>Metin</th><th>Harcama</th><th>Tıklama</th><th>Dönüşüm</th></tr></thead><tbody>
            @foreach($latestGoogleKeywords as $row)
                <tr><td>Kelime</td><td>{{ $row->date?->format('d.m.Y') }}</td><td>{{ $row->keyword_text }}</td><td>{{ number_format((float)$row->cost, 2, ',', '.') }}</td><td>{{ number_format($row->clicks, 0, ',', '.') }}</td><td>{{ number_format((float)$row->conversions, 2, ',', '.') }}</td></tr>
            @endforeach
            @foreach($latestGoogleSearchTerms as $row)
                <tr><td>Arama Terimi</td><td>{{ $row->date?->format('d.m.Y') }}</td><td>{{ $row->search_term }}</td><td>{{ number_format((float)$row->cost, 2, ',', '.') }}</td><td>{{ number_format($row->clicks, 0, ',', '.') }}</td><td>{{ number_format((float)$row->conversions, 2, ',', '.') }}</td></tr>
            @endforeach
            @if($latestGoogleKeywords->isEmpty() && $latestGoogleSearchTerms->isEmpty())
                <tr><td colspan="6" class="text-center text-muted py-4">Henüz kelime veya arama terimi snapshot yok.</td></tr>
            @endif
            </tbody></table>
        </div>
    </div>
</div>
