/* ═══════════════════════════════════════════════════════════════
   CV Page Styles – Fixed A4 Layout + Mobile Scaling + Clean Print
   ═══════════════════════════════════════════════════════════════ */

:root {
    --cv-blue: #1a6dff;
    --cv-text: #000000;
    --cv-gray: #555555;
}

/* ─── Body Reset ─── */
body {
    margin: 0;
    padding: 0;
    background: #0a0a0a;
}

/* ─── Viewer Wrapper ─── */
.cv-viewer {
    min-height: 100vh;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    overflow-x: hidden;
}

/* ─── Top Bar ─── */
.cv-top-bar {
    width: 794px;
    max-width: 96vw;
    margin: 0 auto 1rem auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.cv-back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Inter', Arial, sans-serif;
}

.cv-back-button:hover {
    color: #00d4ff;
}

.cv-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #00d4ff, #0066cc);
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', Arial, sans-serif;
    transition: opacity 0.3s ease;
}

.cv-download-btn:hover {
    opacity: 0.85;
}

.cv-download-btn.downloading {
    opacity: 0.6;
    pointer-events: none;
}

/* ─── Scale Wrapper (JS sets transform on mobile) ─── */
.scale-wrapper {
    transform-origin: top center;
}

/* ─── A4 Page (FIXED 794px = 210mm at 96dpi) ─── */
.page {
    width: 794px;
    min-height: 1123px;
    /* 297mm at 96dpi */
    padding: 60px 75px 60px 75px;
    /* ~15mm top/bottom, ~20mm left/right */
    background: white;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 10.5pt;
    line-height: 1.4;
    color: #000000;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.page *,
.page *::before,
.page *::after {
    box-sizing: border-box;
}

.page p,
.page ul,
.page h1,
.page h2 {
    margin: 0;
    padding: 0;
}

/* ─── Footer ─── */
.cv-footer {
    background: #0a0a0a;
    border-top: 1px solid #333;
    padding: 2rem 0;
    text-align: center;
    font-family: 'Inter', Arial, sans-serif;
}

.cv-footer p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   CV Content Styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── Header ─── */
.cv-header {
    text-align: center;
    margin-bottom: 8pt;
}

.cv-name {
    font-size: 26pt;
    font-weight: bold;
    color: #000000;
    margin-bottom: 2pt;
    letter-spacing: -0.3px;
}

.cv-titles {
    font-size: 12pt;
    color: #1a6dff;
    margin-bottom: 4pt;
}

.cv-titles .separator {
    margin: 0 6px;
    color: #000000;
}

/* Contact row */
.cv-contact-row {
    font-size: 10pt;
    color: #555555;
    margin-bottom: 3pt;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.cv-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cv-contact-row i {
    color: black;
    font-size: 10pt;
}

.cv-contact-row .separator {
    margin: 0 8px;
    color: #555555;
}

/* Links row */
.cv-links-row {
    font-size: 10pt;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cv-link-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cv-link-item i {
    color: black;
    font-size: 10pt;
}

.cv-links-row a {
    color: #1a6dff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cv-links-row .separator {
    margin: 0 8px;
    color: #555555;
}

/* ─── Sections ─── */
.cv-section {
    margin-bottom: 10pt;
}

.page .cv-section-title {
    font-size: 11pt;
    font-weight: bold;
    text-transform: uppercase;
    color: #1a6dff;
    padding-bottom: 3pt;
    margin-bottom: 8pt;
    border-bottom: 1.5px solid #1a6dff;
}

/* ─── Summary ─── */
.cv-summary p {
    text-align: justify;
}

/* ─── Skills ─── */
.cv-skills-list {
    display: flex;
    flex-direction: column;
    gap: 2pt;
}

.cv-skill-row {
    line-height: 1.4;
}

.cv-skill-category {
    font-weight: bold;
}

/* ─── Experience ─── */
.cv-experience-entry {
    margin-bottom: 10pt;
}

.cv-experience-entry:last-child {
    margin-bottom: 0;
}

.cv-exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
}

.cv-exp-title {
    font-weight: bold;
}

.cv-exp-company-separator {
    font-weight: normal;
}

.cv-exp-company {
    color: #1a6dff;
    font-weight: bold;
}

.cv-exp-duration {
    font-style: italic;
    color: #555555;
    font-size: 10pt;
    white-space: nowrap;
}

.cv-exp-location {
    font-style: italic;
    color: #555555;
    font-size: 10pt;
    margin-bottom: 3pt;
}

.cv-exp-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cv-exp-bullets li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 2pt;
    text-align: justify;
    line-height: 1.4;
}

.cv-exp-bullets li::before {
    content: '•';
    position: absolute;
    left: 4px;
    top: 0;
}

/* ─── Projects ─── */
.cv-project-entry {
    margin-bottom: 8pt;
}

.cv-project-entry:last-child {
    margin-bottom: 0;
}

.cv-project-name {
    font-weight: bold;
}

.cv-project-separator {
    font-weight: normal;
}

.cv-project-tech {
    color: #1a6dff;
    font-style: italic;
}

.cv-project-desc {
    margin-top: 1pt;
    text-align: justify;
}

/* ─── Education ─── */
.cv-education-entry {
    margin-bottom: 6pt;
}

.cv-edu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
}

.cv-edu-degree {
    font-weight: bold;
}

.cv-edu-duration {
    font-style: italic;
    color: #555555;
    font-size: 10pt;
    white-space: nowrap;
}

.cv-edu-institution {
    color: #1a6dff;
}

.cv-edu-note {
    font-style: italic;
    color: #555555;
    font-size: 10pt;
}

/* ─── Courses ─── */
.cv-courses-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cv-course-item {
    position: relative;
    padding-left: 18px;
    margin-bottom: 2pt;
    line-height: 1.4;
}

.cv-course-item::before {
    content: '•';
    position: absolute;
    left: 4px;
    top: 0;
}

.cv-course-title {
    font-weight: bold;
}

/* ─── Achievements ─── */
.cv-achievements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cv-achievements-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 2pt;
    line-height: 1.4;
}

.cv-achievements-list li::before {
    content: '•';
    position: absolute;
    left: 4px;
    top: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Print / PDF — ONLY show the .page, hide everything else
   ═══════════════════════════════════════════════════════════════ */

@page {
    size: A4;
    margin: 60px 0;
}

@media print {
    /* Remove any viewer padding that compounds with @page margins */
    .cv-viewer {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Remove scaling on print */
    .scale-wrapper {
        transform: none !important;
        height: auto !important;
    }

    /* Ensure body has no extra spacing */
    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    /* Show only the CV page and its children */
    .page {
        width: 794px;
        min-height: auto;
        box-shadow: none;
        padding: 0 75px;
        /* Use @page margins for vertical spacing */
        margin: 0 auto;
    }

    /* Ensure sections don't break awkwardly */
    .cv-experience-entry,
    .cv-project-entry,
    .cv-education-entry {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Hide no-print elements */
    .no-print {
        display: none !important;
    }
}