@csrf
<div class="row">
    <div class="col-xl-8">
        <div class="card">
            <div class="card-header"><h4 class="card-title mb-0">Müşteri Bilgileri</h4></div>
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6 mb-3">
                        <label class="form-label">Firma Adı *</label>
                        <input type="text" name="company_name" class="form-control" value="{{ old('company_name', $client->company_name) }}" required>
                    </div>
                    <div class="col-md-6 mb-3">
                        <label class="form-label">Yetkili Kişi</label>
                        <input type="text" name="contact_person" class="form-control" value="{{ old('contact_person', $client->contact_person) }}">
                    </div>
                    <div class="col-md-6 mb-3">
                        <label class="form-label">E-posta</label>
                        <input type="email" name="email" class="form-control" value="{{ old('email', $client->email) }}">
                    </div>
                    <div class="col-md-6 mb-3">
                        <label class="form-label">Telefon</label>
                        <input type="text" name="phone" class="form-control" value="{{ old('phone', $client->phone) }}">
                    </div>
                    <div class="col-md-6 mb-3">
                        <label class="form-label">Web Sitesi</label>
                        <input type="text" name="website" class="form-control" value="{{ old('website', $client->website) }}" placeholder="https://">
                    </div>
                    <div class="col-md-6 mb-3">
                        <label class="form-label">Sektör</label>
                        <input type="text" name="sector" class="form-control" value="{{ old('sector', $client->sector) }}">
                    </div>
                    <div class="col-md-4 mb-3">
                        <label class="form-label">Durum *</label>
                        <select name="status" class="form-control default-select" required>
                            @foreach(['active' => 'Aktif', 'paused' => 'Beklemede', 'passive' => 'Pasif'] as $value => $label)
                                <option value="{{ $value }}" @selected(old('status', $client->status) === $value)>{{ $label }}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="col-md-4 mb-3">
                        <label class="form-label">Para Birimi *</label>
                        <input type="text" name="currency_code" class="form-control" value="{{ old('currency_code', $client->currency_code ?: 'TRY') }}" maxlength="3" required>
                    </div>
                    <div class="col-md-4 mb-3">
                        <label class="form-label">Rapor Dili *</label>
                        <select name="report_language" class="form-control default-select" required>
                            <option value="tr" @selected(old('report_language', $client->report_language) === 'tr')>Türkçe</option>
                            <option value="en" @selected(old('report_language', $client->report_language) === 'en')>English</option>
                        </select>
                    </div>
                    <div class="col-md-6 mb-3">
                        <label class="form-label">Zaman Dilimi *</label>
                        <input type="text" name="timezone" class="form-control" value="{{ old('timezone', $client->timezone ?: 'Europe/Istanbul') }}" required>
                    </div>
                    <div class="col-md-6 mb-3">
                        <label class="form-label">Marka Rengi</label>
                        <input type="text" name="primary_color" class="form-control" value="{{ old('primary_color', $client->primary_color) }}" placeholder="#2953E8">
                    </div>
                    <div class="col-12 mb-3">
                        <label class="form-label">Rapor Alıcıları</label>
                        <textarea name="report_recipients_raw" class="form-control" rows="3" placeholder="Her satıra bir e-posta yazılabilir">{{ old('report_recipients_raw', implode("\n", $client->report_recipients ?? [])) }}</textarea>
                    </div>
                    <div class="col-md-6 mb-3">
                        <label class="form-label">Müşteri Notu</label>
                        <textarea name="notes" class="form-control" rows="5">{{ old('notes', $client->notes) }}</textarea>
                    </div>
                    <div class="col-md-6 mb-3">
                        <label class="form-label">Ajans İçi Not</label>
                        <textarea name="internal_notes" class="form-control" rows="5">{{ old('internal_notes', $client->internal_notes) }}</textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-xl-4">
        <div class="card">
            <div class="card-header"><h4 class="card-title mb-0">İşlem</h4></div>
            <div class="card-body">
                <button type="submit" class="btn btn-primary w-100 mb-2">Kaydet</button>
                <a href="{{ route('admin.clients.index') }}" class="btn btn-light w-100">Vazgeç</a>
            </div>
        </div>
        <div class="card">
            <div class="card-body">
                <h5 class="mb-2">Sonraki adım</h5>
                <p class="text-muted mb-0">Müşteri kaydından sonra Google Ads, Meta Ads, Search Console ve GA4 bağlantıları müşteri detayından eklenecek.</p>
            </div>
        </div>
    </div>
</div>
