<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<style>
    * { margin: 0; padding: 0; box-sizing: border-box; }
    body { font-family: DejaVu Sans, sans-serif; font-size: 10pt; color: #111827; background: #fff; }

    .page { padding: 36px 44px; }

    /* Header — minimal, just text */
    .header {
        border-bottom: 3px solid #111827;
        padding-bottom: 14px;
        margin-bottom: 20px;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }
    .header-left .company { font-size: 13pt; font-weight: bold; color: #111827; }
    .header-left .form-type { font-size: 8pt; color: #6b7280; margin-top: 2px; }
    .header-right { text-align: right; }
    .header-right .position { font-size: 11pt; font-weight: bold; color: #111827; }
    .header-right .meta { font-size: 8pt; color: #6b7280; margin-top: 2px; }
    .header-right img { max-height: 40px; max-width: 100px; display: block; margin-bottom: 4px; margin-left: auto; }

    /* Section */
    .section { margin-bottom: 18px; }
    .section-title {
        font-size: 8pt;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: #6b7280;
        margin-bottom: 10px;
    }

    /* Field row */
    .field-row { display: flex; gap: 16px; margin-bottom: 10px; }
    .field { flex: 1; }
    .field-label { font-size: 7.5pt; color: #9ca3af; margin-bottom: 3px; }
    .field-line { border-bottom: 1px solid #d1d5db; height: 20px; }
    .field-box { border: 1px solid #d1d5db; height: 56px; }

    /* Table layout for fields */
    .fields-table { width: 100%; border-collapse: collapse; }
    .fields-table td { vertical-align: top; padding-right: 16px; padding-bottom: 10px; }
    .fields-table td:last-child { padding-right: 0; }
    .fields-table .w-half { width: 50%; }
    .fields-table .w-full { width: 100%; }

    /* Divider */
    .divider { border: none; border-top: 1px solid #e5e7eb; margin: 14px 0; }

    /* Checkbox list */
    .doc-list { list-style: none; margin-top: 6px; }
    .doc-list li {
        font-size: 9pt;
        color: #374151;
        padding: 4px 0 4px 16px;
        position: relative;
        border-bottom: 1px dotted #e5e7eb;
    }
    .doc-list li::before { content: "□"; position: absolute; left: 0; color: #9ca3af; }

    /* Signature */
    .sig-section { margin-top: 20px; }
    .sig-table { width: 100%; border-collapse: collapse; }
    .sig-table td { width: 50%; padding-right: 24px; vertical-align: top; }
    .sig-table td:last-child { padding-right: 0; }
    .sig-label { font-size: 7.5pt; color: #9ca3af; margin-bottom: 4px; }
    .sig-line { border-bottom: 1px solid #374151; height: 28px; }

    /* KVKK */
    .kvkk {
        margin-top: 16px;
        font-size: 7pt;
        color: #9ca3af;
        line-height: 1.6;
        border-top: 1px solid #e5e7eb;
        padding-top: 10px;
    }

    /* Footer */
    .footer {
        margin-top: 20px;
        border-top: 1px solid #e5e7eb;
        padding-top: 8px;
        font-size: 7.5pt;
        color: #9ca3af;
        display: flex;
        justify-content: space-between;
    }
</style>
</head>
<body>
<div class="page">

    {{-- Header --}}
    <div class="header">
        <div class="header-left">
            <div class="company">{{ $settings->company_name ?? 'Şirket Adı' }}</div>
            <div class="form-type">İş Başvuru Formu</div>
        </div>
        <div class="header-right">
            @if($settings->company_logo_path)
            <img src="{{ storage_path('app/public/' . $settings->company_logo_path) }}" alt="Logo">
            @endif
            <div class="position">{{ $job->title }}</div>
            <div class="meta">
                {{ $job->location }} &nbsp;·&nbsp; {{ $job->employment_type }}
                @if($job->closes_at) &nbsp;·&nbsp; Son: {{ $job->closes_at->format('d.m.Y') }}@endif
            </div>
        </div>
    </div>

    {{-- Kişisel Bilgiler --}}
    <div class="section">
        <div class="section-title">Kişisel Bilgiler</div>
        <table class="fields-table">
            <tr>
                <td class="w-half">
                    <div class="field-label">Ad Soyad</div>
                    <div class="field-line"></div>
                </td>
                <td class="w-half">
                    <div class="field-label">T.C. Kimlik No</div>
                    <div class="field-line"></div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="field-label">Doğum Tarihi</div>
                    <div class="field-line"></div>
                </td>
                <td>
                    <div class="field-label">Cinsiyet</div>
                    <div class="field-line"></div>
                </td>
            </tr>
        </table>
    </div>

    <hr class="divider">

    {{-- İletişim --}}
    <div class="section">
        <div class="section-title">İletişim</div>
        <table class="fields-table">
            <tr>
                <td class="w-half">
                    <div class="field-label">E-posta</div>
                    <div class="field-line"></div>
                </td>
                <td class="w-half">
                    <div class="field-label">Telefon</div>
                    <div class="field-line"></div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="field-label">Adres</div>
                    <div class="field-line"></div>
                </td>
            </tr>
        </table>
    </div>

    <hr class="divider">

    {{-- Eğitim & Deneyim --}}
    <div class="section">
        <div class="section-title">Eğitim & Deneyim</div>
        <table class="fields-table">
            <tr>
                <td class="w-half">
                    <div class="field-label">Eğitim Seviyesi</div>
                    <div class="field-line"></div>
                </td>
                <td class="w-half">
                    <div class="field-label">Okul / Bölüm</div>
                    <div class="field-line"></div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="field-label">Toplam Deneyim</div>
                    <div class="field-line"></div>
                </td>
                <td>
                    <div class="field-label">Son Çalıştığı Şirket / Pozisyon</div>
                    <div class="field-line"></div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="field-label">Yabancı Dil</div>
                    <div class="field-line"></div>
                </td>
                <td>
                    <div class="field-label">Beklenen Maaş</div>
                    <div class="field-line"></div>
                </td>
            </tr>
        </table>
    </div>

    <hr class="divider">

    {{-- Notlar --}}
    <div class="section">
        <div class="section-title">Ek Notlar</div>
        <div class="field-label">Kendinizi kısaca tanıtın</div>
        <div class="field-box"></div>
    </div>

    {{-- Gerekli Belgeler --}}
    @if($job->required_documents)
    <hr class="divider">
    <div class="section">
        <div class="section-title">Görüşmeye Getirilmesi Gereken Belgeler</div>
        <ul class="doc-list">
            @foreach(array_filter(explode("\n", $job->required_documents)) as $doc)
            <li>{{ trim($doc) }}</li>
            @endforeach
        </ul>
    </div>
    @endif

    {{-- İmza --}}
    <div class="sig-section">
        <table class="sig-table">
            <tr>
                <td>
                    <div class="sig-label">Tarih</div>
                    <div class="sig-line"></div>
                </td>
                <td>
                    <div class="sig-label">İmza</div>
                    <div class="sig-line"></div>
                </td>
            </tr>
        </table>
    </div>

    {{-- KVKK --}}
    @if($settings->form_footer_text)
    <div class="kvkk">{{ $settings->form_footer_text }}</div>
    @endif

    {{-- Footer --}}
    <div class="footer">
        <div>
            @if($settings->company_phone){{ $settings->company_phone }}@endif
            @if($settings->company_email) · {{ $settings->company_email }}@endif
            @if($settings->company_website) · {{ $settings->company_website }}@endif
        </div>
        <div>{{ now()->format('d.m.Y') }}</div>
    </div>

</div>
</body>
</html>