
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&display=swap');

:root {
    --blue: #141a47;
    --blue-dark: #23477e;
    --text: #414456;
    --muted: #727585;
    --border: #dfe1e8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Be Vietnam Pro', Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(135deg, #f0f1f5 50%, #15244d 50%);
    padding: 25px 15px 40px;
    font-size: 10px;
    line-height: 1.55;
}

.toolbar {
    width: 210mm;
    max-width: 100%;
    margin: 0 auto 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 12px;
}

.toolbar button {
    background: white;
    color: #29447d;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.resume {
    width: 210mm;
    min-height: 297mm;
    max-width: 100%;
    margin: auto;
    background: white;
    display: grid;
    grid-template-columns: 34% 66%;
    box-shadow: 0 15px 50px #101a4330;
    overflow: hidden;
}

.sidebar {
    padding: 0 22px 25px;
    background: linear-gradient(155deg, #5964c7, #3e60aa 60%, #23477e);
    color: white;
}

.avatar {
    width: 180px;
    height: 180px;
    border: 4px solid white;
    border-radius: 50%;
    background: #46464a;
    margin: 27px auto 30px;
    overflow: hidden;
    box-shadow: 0 5px 15px #17244c30;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#avatarText {
    width: 100%;
    height: 100%;
    display: none;
    place-items: center;
    color: white;
    font-size: 32px;
    font-weight: 800;
}

.side-section {
    margin-bottom: 27px;
}

.side-section h2 {
    font-size: 10px;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.contact-item {
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.contact-item span {
    display: block;
    color: #dce5ff;
    font-size: 9px;
    margin-bottom: 0;
}

.contact-item p,
.contact-item a {
    color: white;
    text-decoration: none;
    font-size: 9px;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.2;
}


.contact-item a:hover {
    text-decoration: underline;
}

.side-section ul {
    list-style: none;
}

.side-section li {
    position: relative;
    padding-left: 12px;
    margin-bottom: 8px;
    font-size: 9px;
}

.side-section li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: white;
}

.main-content {
    min-width: 0;
    padding: 39px 29px 24px;
}

.header {
    margin-bottom: 27px;
}

.small-title {
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--muted);
    margin-bottom: 5px;
}

.header h1 {
    color: var(--blue);
    font-size: 25px;
    font-weight: 800;
    line-height: 1.3;
}

.header h3 {
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: 500;
    color: #707381;
    margin-top: 6px;
}

.line {
    width: 45px;
    height: 3px;
    border-radius: 3px;
    background: var(--blue);
    margin-top: 14px;
}

.content-section {
    margin-bottom: 23px;
}

.content-section h2 {
    color: var(--blue);
    font-size: 10px;
    letter-spacing: 1px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.content-section h2 span {
    margin-right: 6px;
    font-size: 13px;
}

.about-text {
    font-size: 9px;
    line-height: 1.7;
    text-align: justify;
    color: #5d6070;
}

.timeline-item {
    display: grid;
    grid-template-columns: 75px minmax(0, 1fr);
    gap: 9px;
    margin-bottom: 14px;
}

.date {
    font-size: 8px;
    color: #777b89;
    padding-top: 2px;
}

.details {
    min-width: 0;
}

.details h4 {
    font-size: 9.5px;
    color: #44495d;
    line-height: 1.5;
    margin-bottom: 3px;
}

.details p {
    font-size: 8.5px;
    color: #646979;
}

.details .role {
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 5px;
}

.details ul {
    padding-left: 12px;
    color: #5d6270;
}

.details li {
    font-size: 8.3px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.projects {
    margin-bottom: 15px;
}

.projects .timeline-item {
    margin-bottom: 12px;
}

.projects .date {
    color: var(--blue);
    font-weight: 700;
}

footer {
    border-top: 1px solid var(--border);
    padding-top: 9px;
    text-align: center;
    color: #858998;
    font-size: 8px;
    font-style: italic;
}

@media (max-width: 700px) {
    body {
        padding: 10px 7px;
        background: #eef0f7;
    }

    .resume {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 22px 25px;
    }

    .avatar {
        width: 110px;
        height: 110px;
        margin: 0 auto 22px;
    }

    .main-content {
        padding: 28px 22px;
    }

    .header h1 {
        font-size: 23px;
    }

    .timeline-item {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 8px;
    }
}

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

@media print {
    body {
        padding: 0;
        margin: 0;
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .toolbar {
        display: none;
    }

    .resume {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        box-shadow: none;
        grid-template-columns: 34% 66%;
    }

    .sidebar {
        padding-left: 22px;
        padding-right: 22px;
    }

    .main-content {
        padding: 34px 25px 20px;
    }

    .content-section {
        margin-bottom: 18px;
    }

    .timeline-item,
    .projects .timeline-item {
        margin-bottom: 9px;
    }
}


/* ===== TOI UU CV KHI XUAT PDF A4 ===== */
@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    html,
    body {
        width: 210mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .toolbar {
        display: none !important;
    }

    .resume {
        width: 210mm !important;
        min-height: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        grid-template-columns: 34% 66% !important;
    }

    .sidebar {
        padding: 12mm 7mm 8mm !important;
    }

    .avatar {
        width: 34mm !important;
        height: 34mm !important;
        margin: 0 auto 8mm !important;
    }

    .side-section {
        margin-bottom: 6mm !important;
    }

    .side-section h2 {
        margin-bottom: 3mm !important;
    }

    .side-section li {
        margin-bottom: 1.5mm !important;
        line-height: 1.4 !important;
    }

    .contact-item {
        margin-bottom: 3mm !important;
    }

    .main-content {
        padding: 10mm 7mm 6mm !important;
        min-width: 0 !important;
    }

    .header {
        margin-bottom: 6mm !important;
    }

    .header h1 {
        font-size: 22px !important;
    }

    .content-section {
        margin-bottom: 5mm !important;
        break-inside: auto;
    }

    .content-section h2 {
        margin-bottom: 2.5mm !important;
        padding-bottom: 1.5mm !important;
    }

    .about-text {
        font-size: 8.5px !important;
        line-height: 1.5 !important;
    }

    .timeline-item,
    .projects .timeline-item {
        gap: 2mm !important;
        margin-bottom: 3mm !important;
        break-inside: avoid;
    }

    .timeline-item {
        grid-template-columns: 19mm minmax(0, 1fr) !important;
    }

    .details h4 {
        font-size: 9px !important;
        line-height: 1.35 !important;
    }

    .details li {
        font-size: 7.8px !important;
        line-height: 1.35 !important;
        margin-bottom: 1mm !important;
    }

    .details p {
        line-height: 1.35 !important;
    }

    footer {
        font-size: 7px !important;
        padding-top: 2mm !important;
    }
}

/* ===== TANG CO CHU CV ===== */

/* Chữ nội dung chung */
body {
    font-size: 13px;
}

/* Họ tên */
.header h1 {
    font-size: 29px;
}

/* Chức danh */
.header h3 {
    font-size: 12px;
}

/* Tiêu đề các mục */
.content-section h2,
.side-section h2 {
    font-size: 15px;
}

/* Phần giới thiệu */
.about-text {
    font-size: 13px;
    line-height: 1.7;
}

/* Tên dự án và trường học */
.details h4 {
    font-size: 13px;
    line-height: 1.5;
}

/* Mô tả dự án */
.details li {
    font-size: 13px;
    line-height: 1.55;
}

/* Vai trò dự án và thông tin học vấn */
.details p {
    font-size: 13px;
    line-height: 1.5;
}

/* Chữ ở cột xanh */
.side-section li,
.contact-item p,
.contact-item a {
    font-size: 12px;
    line-height: 1.3;
}

/* Thông tin phụ */
.contact-item span,
.date {
    font-size: 10px;
}
.profile-photo {
    width: 130px;
    height: 130px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Thu gọn khoảng cách phần liên hệ */
.contact-item {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.1 !important;
}

.contact-item span {
    margin-top: 0 !important;
    margin-bottom: 2px !important;
    line-height: 1.1 !important;
}

.contact-item p,
.contact-item a {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.1 !important;
}