/* ============================================
   CV ŞABLONLARI — 3 ATS uyumlu şablon
   Hepsi aynı HTML yapısını kullanır (cv-templates.js: renderLinear).
   Burada yalnızca görünüm farkları var.
   ============================================ */

/* ---------- Ortak temel ---------- */
.cv-tpl {
    /* İç elemanların margin'i şablon dışına taşmasın (PDF'te fazladan sayfa yapıyordu) */
    display: flow-root;
    box-sizing: border-box;
    font-size: 10pt;
    line-height: 1.5;
    color: #1a1a1a;
    background: #fff !important;
    word-wrap: break-word;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}
.cv-tpl *, .cv-tpl *::before, .cv-tpl *::after { box-sizing: border-box; }
.cv-tpl h1, .cv-tpl h2, .cv-tpl h3 { margin: 0; line-height: 1.2; }
.cv-tpl p { margin: 0 0 4px 0; }
.cv-tpl ul { margin: 2px 0 0 0; padding-left: 18px; }
.cv-tpl li { margin-bottom: 2px; }
.cv-tpl a { color: inherit; text-decoration: none; }

.cv-tpl .tpl-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.cv-tpl .tpl-header-text { flex: 1; min-width: 0; }
.cv-tpl .tpl-contact { font-size: 9.5pt; color: #374151; margin: 0 0 2px 0; word-break: break-word; }
.cv-tpl .tpl-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.cv-tpl .tpl-section { margin-top: 16px; }
.cv-tpl .tpl-entry { margin-bottom: 10px; }
.cv-tpl .tpl-entry:last-child { margin-bottom: 0; }
.cv-tpl .tpl-entry-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cv-tpl .tpl-entry-top h3 { font-size: 10.5pt; font-weight: 700; }
.cv-tpl .tpl-date { font-size: 9pt; color: #4b5563; white-space: nowrap; flex-shrink: 0; }
.cv-tpl .tpl-company { color: #374151; font-weight: 500; }
.cv-tpl .tpl-desc { color: #1f2937; }

/* PDF'te bölümler ve girdiler sayfa sonunda ikiye bölünmesin */
.tpl-entry, .tpl-header { page-break-inside: avoid; break-inside: avoid; }
.tpl-section h2 { page-break-after: avoid; break-after: avoid; }

/* ---------- 1. STANDART (ats) ---------- */
.cv-tpl-ats {
    font-family: Arial, Helvetica, sans-serif;
    padding: 36px 48px;
}
.cv-tpl-ats h1 { font-size: 22pt; margin-bottom: 6px; color: #111; }
.cv-tpl-ats .tpl-section h2 {
    font-size: 11.5pt;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0f766e;
    border-bottom: 1px solid #0f766e;
    padding-bottom: 3px;
    margin-bottom: 8px;
}

/* ---------- 2. KLASİK ---------- */
/* Not: Georgia ve Times New Roman, PDF'ten metin çıkarılırken harfleri ayırıyor ya da
   kelimeleri birleştiriyordu ("Türkiy e", "tamyığın"). ATS bunu yanlış okur.
   Source Serif 4 temiz çıkıyor (headless Chrome PDF testiyle doğrulandı). */
.cv-tpl-classic {
    font-family: 'Source Serif 4', Georgia, serif;
    padding: 40px 52px;
    color: #111;
}
.cv-tpl-classic .tpl-header {
    justify-content: center;
    text-align: center;
    border-bottom: 2px solid #111;
    padding-bottom: 12px;
}
.cv-tpl-classic h1 { font-size: 24pt; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; font-weight: 700; }
.cv-tpl-classic .tpl-contact { color: #333; }
.cv-tpl-classic .tpl-section h2 {
    font-size: 11.5pt;
    text-transform: uppercase;
    /* Geniş harf aralığı PDF metninde harfleri ayırır ("İ Ş DENEY İ Mİ"); küçük tut */
    letter-spacing: 0.5px;
    border-bottom: 1px solid #9ca3af;
    padding-bottom: 3px;
    margin-bottom: 8px;
}
.cv-tpl-classic .tpl-company { font-style: italic; font-weight: 400; }

/* ---------- 3. MODERN ---------- */
.cv-tpl-modern {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    padding: 36px 44px;
    border-top: 8px solid #1d4ed8;
}
.cv-tpl-modern h1 { font-size: 26pt; font-weight: 800; letter-spacing: -0.5px; color: #0f172a; margin-bottom: 6px; }
.cv-tpl-modern .tpl-contact { color: #475569; }
.cv-tpl-modern .tpl-section { margin-top: 18px; }
.cv-tpl-modern .tpl-section h2 {
    font-size: 10.5pt;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1d4ed8;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid #dbeafe;
}
.cv-tpl-modern .tpl-date { color: #1d4ed8; font-weight: 600; }
.cv-tpl-modern .tpl-photo { border: 3px solid #dbeafe; }

/* Not: Yeni şablonlarda yalnızca PDF metin çıkarımı test edilmiş fontlar (Arial, Inter,
   Source Serif 4) ve küçük harf aralığı (≤ 1px) kullanılır. Aksi halde ATS kelimeleri bölebilir. */

/* ---------- 4. KURUMSAL (executive) ---------- */
.cv-tpl-executive {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    padding: 0 44px 36px;
}
.cv-tpl-executive .tpl-header {
    background: #1e293b !important;
    color: #fff;
    margin: 0 -44px 4px;
    padding: 30px 44px;
}
.cv-tpl-executive h1 { font-size: 24pt; font-weight: 700; color: #fff; margin-bottom: 6px; }
.cv-tpl-executive .tpl-contact { color: #cbd5e1; }
.cv-tpl-executive .tpl-photo { border: 3px solid #475569; }
.cv-tpl-executive .tpl-section h2 {
    font-size: 11pt;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1e293b;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 3px;
    margin-bottom: 8px;
}
.cv-tpl-executive .tpl-date { color: #334155; font-weight: 600; }

/* ---------- 5. ZARİF (elegant) ---------- */
.cv-tpl-elegant {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    padding: 40px 52px;
}
.cv-tpl-elegant h1,
.cv-tpl-elegant .tpl-section h2,
.cv-tpl-elegant .tpl-entry-top h3 {
    font-family: 'Source Serif 4', Georgia, serif;
}
.cv-tpl-elegant .tpl-header { border-bottom: 1px solid #7f1d1d; padding-bottom: 12px; }
.cv-tpl-elegant h1 { font-size: 26pt; font-weight: 600; color: #1c1917; margin-bottom: 6px; }
.cv-tpl-elegant .tpl-section h2 {
    font-size: 13pt;
    font-weight: 600;
    color: #7f1d1d;
    margin-bottom: 8px;
}
.cv-tpl-elegant .tpl-entry-top h3 { font-size: 11pt; font-weight: 600; }
.cv-tpl-elegant .tpl-company { font-style: italic; font-weight: 400; }

/* ---------- 6. TEKNİK (tech) ---------- */
.cv-tpl-tech {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    padding: 36px 44px;
}
.cv-tpl-tech h1 { font-size: 24pt; font-weight: 800; color: #064e3b; margin-bottom: 6px; }
.cv-tpl-tech .tpl-header { border-bottom: 3px solid #047857; padding-bottom: 12px; }
.cv-tpl-tech .tpl-section h2 {
    font-size: 11pt;
    font-weight: 700;
    color: #047857;
    border-left: 4px solid #047857;
    padding-left: 8px;
    margin-bottom: 8px;
}
.cv-tpl-tech .tpl-date { color: #047857; font-weight: 600; }

/* ---------- 7. KOMPAKT (compact) ---------- */
.cv-tpl-compact {
    /* Arial küçük puntoda PDF metninde boşlukları yutuyordu ("C#,ASP.NET", "Tem2025"); Inter temiz çıkıyor */
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    font-size: 9pt;
    line-height: 1.4;
    padding: 26px 34px;
}
.cv-tpl-compact h1 { font-size: 18pt; margin-bottom: 4px; }
.cv-tpl-compact .tpl-contact { font-size: 8.5pt; }
.cv-tpl-compact .tpl-section { margin-top: 10px; }
.cv-tpl-compact .tpl-section h2 {
    font-size: 10pt;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #334155;
    border-bottom: 1px solid #94a3b8;
    padding-bottom: 2px;
    margin-bottom: 6px;
}
.cv-tpl-compact .tpl-entry { margin-bottom: 6px; }
.cv-tpl-compact .tpl-entry-top h3 { font-size: 9.5pt; }
.cv-tpl-compact .tpl-date { font-size: 8.5pt; }

/* ---------- Tek sayfaya sığdırma (cv-builder.js: fitOnePage) ----------
   CV bir sayfayı biraz aşınca önce bu sınıfla boşluklar daraltılır. */
.cv-tpl.tpl-tight { line-height: 1.38; }
.cv-tpl.tpl-tight:not(.cv-tpl-executive) { padding-top: 24px; padding-bottom: 20px; }
.cv-tpl.tpl-tight.cv-tpl-executive .tpl-header { padding-top: 20px; padding-bottom: 20px; }
.cv-tpl.tpl-tight .tpl-section { margin-top: 10px; }
.cv-tpl.tpl-tight .tpl-section h2 { margin-bottom: 5px; }
.cv-tpl.tpl-tight .tpl-entry { margin-bottom: 6px; }
.cv-tpl.tpl-tight li { margin-bottom: 1px; }
.cv-tpl.tpl-tight p { margin-bottom: 2px; }

/* ==============================
   YAZDIRMA (sayfa doğrudan yazdırılırsa)
   ============================== */
@media print {
    @page { margin: 0 !important; size: A4 portrait; }

    .builder-form-panel, .builder-nav, .mobile-panel-toggle, .preview-header, body > header, body > footer {
        display: none !important;
    }
    .builder-layout { display: block !important; }
    .builder-preview-panel {
        width: 100% !important; margin: 0 !important; padding: 0 !important;
        position: absolute !important; left: 0 !important; top: 0 !important;
    }
    #previewContent {
        width: 210mm !important; margin: 0 !important; padding: 0 !important;
        transform: none !important; transition: none !important;
    }
    .cv-tpl { width: 100% !important; margin: 0 !important; box-shadow: none !important; }
}
