@extends('layouts.default')
@section('title', $page_title)
@section('content')
<div class="container-fluid">
    @include('admin.partials.page-header', ['actions' => new \Illuminate\Support\HtmlString('<a href="'.route('admin.report-templates.edit', $reportTemplate).'" class="btn btn-primary">Düzenle</a>')])
    <div class="row">
        <div class="col-xl-9">
            <div class="card"><div class="card-body p-0">
                <div style="background:{{ $templateSettings['primary_color'] }};color:#fff;padding:42px 48px;border-radius:8px 8px 0 0;">
                    <div style="font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:{{ $templateSettings['accent_color'] }};font-weight:700;">{{ $templateSettings['agency_name'] }}</div>
                    <h1 class="mt-3 mb-2 text-white">{{ $templateSettings['cover_title'] }}</h1>
                    <p class="mb-0" style="opacity:.85;max-width:720px;">{{ $templateSettings['cover_subtitle'] }}</p>
                </div>
                <div class="p-4">
                    <p class="text-muted">{{ $templateSettings['intro_text'] }}</p>
                    <div class="row">
                        @foreach(['Toplam Harcama'=>'24.850 TL','Tıklama'=>'8.420','Dönüşüm'=>'186','Organik Tıklama'=>'12.950'] as $label => $value)
                            <div class="col-md-3 mb-3"><div class="border rounded p-3"><span class="text-muted d-block small">{{ $label }}</span><strong class="fs-4">{{ $value }}</strong></div></div>
                        @endforeach
                    </div>
                    <h4>Bölüm Önizleme</h4>
                    <div class="row">
                        @foreach($templateSections as $key => $enabled)
                            @if($enabled)<div class="col-md-4 mb-2"><div class="border rounded p-2"><span class="badge badge-primary me-1">Açık</span>{{ str_replace('_',' ', $key) }}</div></div>@endif
                        @endforeach
                    </div>
                    <hr>
                    <p class="mb-0 text-muted">{{ $templateSettings['footer_note'] }}</p>
                </div>
            </div></div>
        </div>
        <div class="col-xl-3">
            <div class="card"><div class="card-header border-0 pb-0"><h4 class="card-title mb-0">Şablon</h4></div><div class="card-body">
                <p><strong>{{ $reportTemplate->name }}</strong></p>
                <p class="text-muted">{{ $reportTemplate->description }}</p>
                <hr>
                <span class="text-muted d-block">Kanallar</span>
                @foreach($channels as $channel)<span class="badge badge-light me-1 mb-1">{{ str_replace('_',' ', strtoupper($channel)) }}</span>@endforeach
                <a href="{{ route('admin.report-templates.show', $reportTemplate) }}" class="btn btn-light w-100 mt-3">Detaya Dön</a>
            </div></div>
        </div>
    </div>
</div>
@endsection
