@extends('layouts.default')
@section('content')
<div class="container-fluid">
    <div class="row mb-3">
        <div class="col-md-8"><h3>{{ $brandKit->name }}</h3><p class="text-muted mb-0">{{ $brandKit->description }}</p></div>
        <div class="col-md-4 text-md-end">
            <form method="POST" action="{{ route('admin.brand-kits.duplicate', $brandKit) }}" class="d-inline">@csrf<button class="btn btn-outline-primary">Kopyala</button></form>
            <a href="{{ route('admin.brand-kits.edit', $brandKit) }}" class="btn btn-primary">Düzenle</a>
        </div>
    </div>

    <div class="row">
        <div class="col-xl-5">
            <div class="card"><div class="card-body">
                <div class="rounded p-5 text-white mb-3" style="background: {{ $brandKit->previewGradient() }}; min-height:220px;">
                    <h2 class="text-white">Dijital Performans Raporu</h2>
                    <p class="mb-4">{{ $brandKit->agency_name ?: 'Ajans adı' }}</p>
                    <span class="badge bg-light text-dark">{{ ucfirst($brandKit->cover_style) }} kapak</span>
                </div>
                <div class="d-flex gap-2 flex-wrap">
                    @foreach(['primary_color'=>'Ana','accent_color'=>'Vurgu','secondary_color'=>'Arka Plan','text_color'=>'Metin','muted_color'=>'Yardımcı'] as $key => $label)
                        <span class="badge" style="background:{{ $brandKit->{$key} ?: '#888' }}">{{ $label }}</span>
                    @endforeach
                </div>
            </div></div>
        </div>
        <div class="col-xl-7">
            <div class="card"><div class="card-body">
                <h4>Detaylar</h4>
                <table class="table">
                    <tr><th>Kapsam</th><td>{{ $brandKit->client?->company_name ?: 'Genel marka kiti' }}</td></tr>
                    <tr><th>Ajans</th><td>{{ $brandKit->agency_name ?: '-' }}</td></tr>
                    <tr><th>Web</th><td>{{ $brandKit->website_url ?: '-' }}</td></tr>
                    <tr><th>İletişim</th><td>{{ $brandKit->contact_email ?: '-' }} {{ $brandKit->contact_phone ? ' / '.$brandKit->contact_phone : '' }}</td></tr>
                    <tr><th>Alt Bilgi</th><td>{{ $brandKit->footer_note ?: '-' }}</td></tr>
                    <tr><th>Durum</th><td>@if($brandKit->is_active)<span class="badge badge-success">Aktif</span>@else<span class="badge badge-secondary">Pasif</span>@endif @if($brandKit->is_default)<span class="badge badge-primary">Varsayılan</span>@endif</td></tr>
                </table>
                <h5 class="mt-4">Bağlı Rapor Şablonları</h5>
                <ul class="list-group">
                    @forelse($brandKit->reportTemplates as $template)
                        <li class="list-group-item d-flex justify-content-between"><span>{{ $template->name }}</span><a href="{{ route('admin.report-templates.edit', $template) }}">Düzenle</a></li>
                    @empty
                        <li class="list-group-item text-muted">Bu marka kitine bağlı şablon yok.</li>
                    @endforelse
                </ul>
            </div></div>
        </div>
    </div>
</div>
@endsection
