<!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: #1e293b; background: #fff; }

    .page { padding: 0; }

    /* Header band */
    .header-band {
        background: {{ $settings->primary_color ?? '#ff7b00' }};
        padding: 28px 36px 20px;
        color: #fff;
        position: relative;
    }
    .header-band .company-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
    }
    .header-band .company-name {
        font-size: 18pt;
        font-weight: bold;
        letter-spacing: 0.5px;
    }
    .header-band .logo-box img {
        max-height: 48px;
        max-width: 120px;
    }
    .header-band .position-label {
        font-size: 8pt;
        text-transform: uppercase;
        letter-spacing: 2px;
        opacity: 0.85;
        margin-bottom: 4px;
    }
    .header-band .position-title {
        font-size: 15pt;
        font-weight: bold;
    }

    /* White content area */
    .content { padding: 28px 36px; }

    /* Section title */
    .section-title {
        font-size: 9pt;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: {{ $settings->primary_color ?? '#ff7b00' }};
        border-bottom: 2px solid {{ $settings->primary_color ?? '#ff7b00' }};
        padding-bottom: 4px;
        margin-bottom: 14px;
        margin-top: 20px;
    }

    /* Two-column grid */
    .grid-2 { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
    .grid-2 td { width: 50%; vertical-align: top; padding: 0 8px 0 0; }
    .grid-2 td:last-child { padding-right: 0; }

    /* Field */
    .field { margin-bottom: 12px; }
    .field-label {
        font-size: 7.5pt;
        font-weight: bold;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        margin-bottom: 3px;
    }
    .field-line {
        border-bottom: 1.5px solid #cbd5e1;
        height: 22px;
        width: 100%;
    }
    .field-box {
        border: 1.5px solid #cbd5e1;
        border-radius: 4px;
        height: 60px;
        width: 100%;
    }

    /* Info chips */
    .info-chips { margin-bottom: 16px; }
    .chip {
        display: inline-block;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        border-radius: 20px;
        padding: 3px 10px;
        font-size: 8pt;
        color: #475569;
        margin-right: 6px;
        margin-bottom: 4px;
    }

    /* Checkbox list */
    .check-list { list-style: none; }
    .check-list li {
        padding: 5px 0;
        border-bottom: 1px solid #f1f5f9;
        font-size: 9pt;
        color: #334155;
        padding-left: 18px;
        position: relative;
    }
    .check-list li::before {
        content: "☐";
        position: absolute;
        left: 0;
        color: {{ $settings->primary_color ?? '#ff7b00' }};
    }

    /* Signature area */
    .signature-area {
        margin-top: 24px;
        border-top: 1px solid #e2e8f0;
        padding-top: 16px;
    }
    .sig-table { width: 100%; border-collapse: collapse; }
    .sig-table td { width: 50%; vertical-align: top; padding-right: 20px; }
    .sig-table td:last-child { padding-right: 0; }
    .sig-label { font-size: 8pt; color: #64748b; margin-bottom: 4px; }
    .sig-line { border-bottom: 1.5px solid #94a3b8; height: 32px; }

    /* KVKK box */
    .kvkk-box {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-left: 3px solid {{ $settings->primary_color ?? '#ff7b00' }};
        border-radius: 4px;
        padding: 10px 14px;
        font-size: 7.5pt;
        color: #64748b;
        line-height: 1.5;
        margin-top: 16px;
    }

    /* Footer */
    .footer {
        background: #f8fafc;
        border-top: 1px solid #e2e8f0;
        padding: 10px 36px;
        font-size: 7.5pt;
        color: #94a3b8;
        display: flex;
        justify-content: space-between;
        margin-top: 20px;
    }
    .footer .contact-info span { margin-right: 14px; }
</style>
</head>
<body>
<div class="page">

    {{-- Header --}}
    <div class="header-band">
        <div class="company-row">
            <div class="company-name">{{ $settings->company_name ?? 'Şirket Adı' }}</div>
            @if($settings->company_logo_path)
            <div class="logo-box">
                <img src="{{ storage_path('app/public/' . $settings->company_logo_path) }}" alt="Logo">
            </div>
            @endif
        </div>
        <div class="position-label">Başvuru Formu</div>
        <div class="position-title">{{ $job->title }}</div>
    </div>

    <div class="content">

        {{-- İlan bilgileri --}}
        <div class="info-chips">
            <span class="chip">📍 {{ $job->location }}</span>
            <span class="chip">💼 {{ $job->employment_type }}</span>
            @if($job->department)<span class="chip">🏢 {{ $job->department }}</span>@endif
            @if($job->closes_at)<span class="chip">📅 Son: {{ $job->closes_at->format('d.m.Y') }}</span>@endif
        </div>

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

        {{-- İletişim --}}
        <div class="section-title">İletişim Bilgileri</div>
        <table class="grid-2">
            <tr>
                <td>
                    <div class="field">
                        <div class="field-label">E-posta Adresi</div>
                        <div class="field-line"></div>
                    </div>
                </td>
                <td>
                    <div class="field">
                        <div class="field-label">Telefon Numarası</div>
                        <div class="field-line"></div>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div class="field">
                        <div class="field-label">İkametgah Adresi</div>
                        <div class="field-line"></div>
                    </div>
                </td>
            </tr>
        </table>

        {{-- Eğitim & Deneyim --}}
        <div class="section-title">Eğitim & Deneyim</div>
        <table class="grid-2">
            <tr>
                <td>
                    <div class="field">
                        <div class="field-label">En Yüksek Eğitim Seviyesi</div>
                        <div class="field-line"></div>
                    </div>
                    <div class="field">
                        <div class="field-label">Okul / Bölüm</div>
                        <div class="field-line"></div>
                    </div>
                    <div class="field">
                        <div class="field-label">Mezuniyet Yılı</div>
                        <div class="field-line"></div>
                    </div>
                </td>
                <td>
                    <div class="field">
                        <div class="field-label">Toplam İş Deneyimi</div>
                        <div class="field-line"></div>
                    </div>
                    <div class="field">
                        <div class="field-label">Son Çalıştığı Şirket</div>
                        <div class="field-line"></div>
                    </div>
                    <div class="field">
                        <div class="field-label">Son Pozisyon</div>
                        <div class="field-line"></div>
                    </div>
                </td>
            </tr>
        </table>

        {{-- Ek Bilgiler --}}
        <div class="section-title">Ek Bilgiler</div>
        <table class="grid-2">
            <tr>
                <td>
                    <div class="field">
                        <div class="field-label">Yabancı Dil(ler)</div>
                        <div class="field-line"></div>
                    </div>
                    <div class="field">
                        <div class="field-label">Beklenen Maaş</div>
                        <div class="field-line"></div>
                    </div>
                </td>
                <td>
                    <div class="field">
                        <div class="field-label">Başlangıç Tarihi</div>
                        <div class="field-line"></div>
                    </div>
                    <div class="field">
                        <div class="field-label">Nasıl Öğrendiniz?</div>
                        <div class="field-line"></div>
                    </div>
                </td>
            </tr>
        </table>

        <div class="field">
            <div class="field-label">Kendinizi Kısaca Tanıtın</div>
            <div class="field-box"></div>
        </div>

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

        {{-- İmza --}}
        <div class="signature-area">
            <table class="sig-table">
                <tr>
                    <td>
                        <div class="sig-label">Tarih</div>
                        <div class="sig-line"></div>
                    </td>
                    <td>
                        <div class="sig-label">Başvuran İmzası</div>
                        <div class="sig-line"></div>
                    </td>
                </tr>
            </table>
        </div>

        {{-- KVKK --}}
        @if($settings->form_footer_text)
        <div class="kvkk-box">
            <strong>KVKK Aydınlatma Metni:</strong> {{ $settings->form_footer_text }}
        </div>
        @endif

    </div>

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

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