@extends('layouts.default')
@section('title', $page_title)
@section('content')
<div class="container-fluid">
    @include('admin.partials.page-header')

    <div class="row">
        <div class="col-xl-3 col-sm-6"><div class="card"><div class="card-body"><p class="text-muted mb-1">Google Harcama</p><h3>{{ number_format($summary['google_cost'], 2, ',', '.') }}</h3></div></div></div>
        <div class="col-xl-3 col-sm-6"><div class="card"><div class="card-body"><p class="text-muted mb-1">Meta Harcama</p><h3>{{ number_format($summary['meta_spend'], 2, ',', '.') }}</h3></div></div></div>
        <div class="col-xl-3 col-sm-6"><div class="card"><div class="card-body"><p class="text-muted mb-1">Search Console Tıklama</p><h3>{{ number_format($summary['gsc_clicks'], 0, ',', '.') }}</h3></div></div></div>
        <div class="col-xl-3 col-sm-6"><div class="card"><div class="card-body"><p class="text-muted mb-1">GA4 Oturum</p><h3>{{ number_format($summary['ga4_sessions'], 0, ',', '.') }}</h3></div></div></div>
    </div>

    <div class="card">
        <div class="card-header"><h4 class="card-title mb-0">Kanal Özeti</h4></div>
        <div class="card-body p-0">
            <div class="table-responsive">
                <table class="table table-striped mb-0">
                    <thead><tr><th>Kanal</th><th>Harcama</th><th>Tıklama/Oturum</th><th>Dönüşüm/Lead</th><th>Ek Metrik</th></tr></thead>
                    <tbody>
                        <tr><td>Google Ads</td><td>{{ number_format($summary['google_cost'], 2, ',', '.') }}</td><td>{{ number_format($summary['google_clicks'], 0, ',', '.') }}</td><td>{{ number_format($summary['google_conversions'], 2, ',', '.') }}</td><td>-</td></tr>
                        <tr><td>Meta Ads</td><td>{{ number_format($summary['meta_spend'], 2, ',', '.') }}</td><td>{{ number_format($summary['meta_clicks'], 0, ',', '.') }}</td><td>{{ number_format($summary['meta_leads'], 2, ',', '.') }}</td><td>-</td></tr>
                        <tr><td>Search Console</td><td>-</td><td>{{ number_format($summary['gsc_clicks'], 0, ',', '.') }}</td><td>-</td><td>Gösterim: {{ number_format($summary['gsc_impressions'], 0, ',', '.') }}</td></tr>
                        <tr><td>GA4</td><td>-</td><td>{{ number_format($summary['ga4_sessions'], 0, ',', '.') }}</td><td>{{ number_format($summary['ga4_conversions'], 2, ',', '.') }}</td><td>-</td></tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    @if(in_array($platform, ['overview', 'google_ads'], true))
        @include('admin.performance.partials.google')
    @endif

    @if(in_array($platform, ['overview', 'meta_ads'], true))
        @include('admin.performance.partials.meta')
    @endif

    @if(in_array($platform, ['overview', 'search_console'], true))
        @include('admin.performance.partials.search-console')
    @endif

    @if(in_array($platform, ['overview', 'ga4'], true))
        @include('admin.performance.partials.ga4')
    @endif
</div>
@endsection
