@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

:root {
    --primary: #0f172a;
    --bg-body: #f8fafc;
    --text-main: #334155;
    --border-color: #e2e8f0;
}

* { box-sizing: border-box; }

body {
    background: var(--bg-body);
    font-family: 'Quicksand', sans-serif;
    color: var(--text-main);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ---- Modern Araç Çubuğu (Toolbar) ---- */
.toolbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.toolbar-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cv-status-message {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.page-counter {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}
.toolbar-right-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-clear-cookies {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-clear-cookies:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    transform: translateY(-1px);
}

/* ---- Dil Dropdown Menü Stilleri ---- */
.dropdown-container { position: relative; display: inline-block; }
.dropdown-toggle {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 8px 12px;
    border-radius: 10px;
    font-family: 'Quicksand', sans-serif;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.dropdown-toggle:hover { background: #f8fafc; border-color: #94a3b8; }
.dropdown-flag { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    width: 130px;
    display: none;
    flex-direction: column;
    padding: 5px;
    z-index: 1100;
}
.dropdown-container.open .dropdown-menu { display: flex; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: #334155;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    transition: background 0.15s;
}
.dropdown-item img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.dropdown-item:hover { background: #f1f5f9; color: #0f172a; }
.dropdown-item.active { background: #f8fafc; color: var(--primary); font-weight: 700; }

.toolbar-actions { display: flex; gap: 8px; align-items: center; }
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-print {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.btn-print:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-2px);
}

.btn-pdf {
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.25);
}
.btn-pdf:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.35);
}

.btn-login {
    background: #ffffff;
    color: #475569;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.btn-login:hover { background: #f8fafc; color: #0f172a; border-color: #cbd5e1; }

.clickable-photo {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.clickable-photo:hover {
    transform: scale(1.04);
    box-shadow: 0 0 15px rgba(15, 23, 42, 0.3);
}

.photo-lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.photo-lightbox-overlay.active { opacity: 1; visibility: visible; }
.photo-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.photo-lightbox-overlay.active .photo-lightbox-content { transform: scale(1); }
.photo-lightbox-content img {
    width: 320px;
    height: 320px;
    max-width: 80vw;
    max-height: 80vh;
    object-fit: cover;
    border-radius: 16px;
    border: 4px solid #ffffff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
    display: block;
}
.photo-lightbox-close {
    position: absolute;
    top: -14px; right: -14px;
    width: 36px; height: 36px;
    background: #ffffff;
    color: #0f172a;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: background 0.2s, transform 0.2s;
}
.photo-lightbox-close:hover { background: #f1f5f9; transform: scale(1.1); }

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-box {
    background: #ffffff;
    width: 100%;
    max-width: 380px;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal-box { transform: translateY(0) scale(1); }
.modal-icon-wrap {
    width: 48px; height: 48px;
    background: #fff1f2;
    color: #be123c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.modal-icon-wrap.success { background: #f0fdf4; color: #166534; }
.modal-box h3 { font-size: 17px; font-weight: 700; color: #0f172a; margin: 0 0 8px; }
.modal-box p { font-size: 13px; color: #64748b; margin: 0 0 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; }
.modal-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-family: 'Quicksand', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}
.modal-btn-cancel { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.modal-btn-cancel:hover { background: #e2e8f0; color: #0f172a; }
.modal-btn-confirm { background: #be123c; color: #ffffff; }
.modal-btn-confirm:hover { background: #9f1239; }

/* ---- A4 Sayfa Düzeni ---- */
.page-stage {
    padding: 35px 15px 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.a4-page {
    width: 210mm;
    height: 297mm;
    margin: 0 auto 16mm;
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    display: flex;
    overflow: hidden;
    position: relative;
    border-radius: 6px;
}
.pg-sidebar {
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 10mm 7mm;
    overflow: hidden;
    height: 100%;
}
.pg-main {
    flex: 1;
    padding: 10mm 9mm;
    overflow: hidden;
    min-width: 0;
    height: 100%;
}

/* ---- MOBİL UYGUN TASARIM (A4 yerine akan tek kolon) ---- */
@media screen and (max-width: 768px) {
    .toolbar { padding: 10px 12px; }
    .toolbar-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .toolbar-left, .toolbar-right-group, .toolbar-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .btn-action {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12px;
        min-width: 0;
    }
    .btn-clear-cookies span,
    .btn-action span { white-space: nowrap; }

    .page-stage {
        padding: 12px 10px 40px;
        display: block;
    }

    /* Mobilde A4 sayfaları yerine akan .mobile-cv kartı */
    .mobile-cv {
        max-width: 100%;
        background: #ffffff;
        border-radius: 12px;
        padding: 16px 14px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    }
    .mobile-cv .blk { margin-bottom: 12px; }
    .mobile-cv .card-box { padding: 12px 14px; }
    .mobile-cv .cv-photo { width: 120px; height: 120px; }
    .mobile-cv .cv-photo-placeholder { width: 120px; height: 120px; font-size: 40px; }
    .mobile-cv .name-title { font-size: 24px; }
    .mobile-cv .role-title { font-size: 14px; }
    .mobile-cv .about-text { font-size: 12.5px; line-height: 1.55; }
    .mobile-cv .timeline-role { font-size: 13px; }
    .mobile-cv .timeline-date { font-size: 11.5px; }
    .mobile-cv .timeline-org { font-size: 12px; }
    .mobile-cv .timeline-bullets { font-size: 12px; }
    .mobile-cv .info-row,
    .mobile-cv .contact-line,
    .mobile-cv .skill-row,
    .mobile-cv .hobby-list,
    .mobile-cv .extra-list { font-size: 12.5px; }
    .mobile-cv .section-title { font-size: 12px; }
    .mobile-cv .ability-badge { font-size: 11.5px; }
}

@media screen and (min-width: 480px) and (max-width: 768px) {
    .mobile-cv { padding: 20px 18px; }
}

/* ---- Bileşen Blokları ve Kartlar ---- */
.blk {
    margin-bottom: 9px;
    break-inside: avoid;
    page-break-inside: avoid;
}
.blk:last-child { margin-bottom: 0; }

.card-box {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.cv-photo-wrap { text-align: center; margin-bottom: 4px; }
.cv-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    display: inline-block;
}
.cv-photo-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: var(--primary);
    font-size: 34px;
    font-weight: 700;
    margin: 0 auto;
}

.section-title {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.8px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    break-after: avoid;
    page-break-after: avoid;
}
.section-title span { background: #ffffff; padding-right: 8px; }
.section-title::after {
    content: "";
    flex: 1;
    border-bottom: 1.5px solid var(--primary);
    margin-left: 6px;
}

.info-row { font-size: 11px; margin-bottom: 4px; display: flex; justify-content: space-between; }
.info-row .lbl { font-weight: 600; color: #475569; }
.info-row .val { color: #1e293b; text-align: right; }

.contact-line { font-size: 10.5px; margin-bottom: 5px; word-break: break-word; display: flex; align-items: center; gap: 6px; color: #475569; }
.contact-line .icon { font-size: 11px; }

.skill-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; margin-bottom: 5px; }
.skill-name { font-weight: 600; color: #334155; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; margin-left: 2px; }
.dot-filled { background: var(--primary); }

.hobby-list, .extra-list { margin: 0; padding-left: 14px; font-size: 11px; color: #475569; }
.hobby-list li, .extra-list li { margin-bottom: 3px; }

.profile-header-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 4px;
}
.name-title { color: var(--primary); font-weight: 700; font-size: 22px; margin: 0 0 2px; letter-spacing: -0.5px; }
.role-title { color: var(--primary); font-weight: 600; font-size: 12.5px; margin: 0 0 6px; opacity: 0.85; }
.about-text { font-size: 11px; line-height: 1.45; color: #475569; text-align: justify; }

.timeline-box { margin-bottom: 0; }
.timeline-head { display: flex; justify-content: space-between; align-items: baseline; }
.timeline-role { font-weight: 700; color: #1e293b; font-size: 11.5px; }
.timeline-date { color: #64748b; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.timeline-org { font-style: italic; color: #475569; font-size: 11px; margin-bottom: 2px; }
.timeline-bullets { margin: 3px 0 0; padding-left: 14px; font-size: 10.5px; color: #475569; }
.timeline-bullets li { margin-bottom: 2px; }

.ref-card .name { font-weight: 700; color: #1e293b; font-size: 11px; }
.ref-card .org { font-style: italic; color: #64748b; font-size: 10.5px; }
.ref-card .contact { font-size: 10px; color: #475569; margin-top: 2px; }

.ability-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.ability-badge {
    background: #f1f5f9;
    color: var(--primary);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 10.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #e2e8f0;
}

.qr-container { text-align: center; padding: 6px; }
.cv-qr-img {
    width: 75px;
    height: 75px;
    margin: 3px auto 2px;
    display: block;
    border-radius: 4px;
}
.qr-text { font-size: 9.5px; color: #64748b; font-weight: 500; }

/* ---- Yazdırma (Print) Kuralları ---- */
@media print {
    body { background: #fff; margin: 0; }
    .page-stage { padding: 0; }
    .no-print { display: none !important; }
    .a4-page { box-shadow: none; margin: 0; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .a4-page:last-child { page-break-after: auto; }
    .mobile-cv { box-shadow: none; padding: 0; border-radius: 0; }
    @page { size: A4; margin: 0; }
}