/* ==========================================================================
   CSS Resume Theme (Classic, White, Professional)
   ========================================================================== */
:root {
    --theme-blue: #5c7b96;
    --theme-gold: #c99c6b;
    --text-main: #333333;
    --text-light: #555555;
    --bg-color: #f0f2f5;
    --paper-bg: #ffffff;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding: 2rem;
}

.resume-container {
    max-width: 850px;
    margin: 0 auto;
    background: var(--paper-bg);
    padding: 40px 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Header */
.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 10px;
}

.resume-title {
    font-size: 34px;
    font-weight: 500;
    color: var(--theme-blue);
    letter-spacing: 2px;
}

.resume-job-title {
    font-size: 15px;
    color: var(--theme-blue);
    font-weight: 600;
    margin-bottom: 6px;
}

/* Divider Lines */
.resume-divider {
    margin-bottom: 30px;
}
.blue-line {
    height: 6px;
    background-color: var(--theme-blue);
    width: 100%;
}
.gold-line {
    height: 6px;
    background-color: var(--theme-gold);
    width: 95%;
    margin-left: 5%;
}

/* Section Title */
.section-title {
    border-bottom: 1px solid var(--theme-blue);
    margin: 25px 0 15px 0;
    display: flex;
}
.section-title span {
    background-color: var(--theme-blue);
    color: #ffffff;
    padding: 5px 20px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Basic Info */
.basic-info-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 0 10px;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 30px;
    flex-grow: 1;
}
.info-item {
    font-size: 13px;
    color: var(--text-main);
}
.info-item span {
    display: inline-block;
    width: 85px;
    letter-spacing: 2px;
    color: var(--text-light);
}

/* Photo */
.photo {
    width: 95px;
    height: 130px;
    background: #e5e7eb;
    margin-left: 30px;
    flex-shrink: 0;
}
.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
}

/* Content Blocks */
.content-block {
    padding: 0 10px;
    margin-bottom: 20px;
}
.block-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-main);
}
.block-header .date {
    width: 30%;
}
.block-header .company {
    width: 40%;
    text-align: center;
}
.block-header .position {
    width: 30%;
    text-align: right;
}
.block-header a {
    color: var(--theme-blue);
    text-decoration: none;
}
.block-header a:hover {
    text-decoration: underline;
}

/* Lists */
.block-details ul {
    margin: 0;
    padding-left: 20px;
}
.block-details li {
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.6;
    color: var(--text-main);
}

/* Responsive (Mobile) */
@media screen and (max-width: 768px) {
    body { padding: 0; }
    .resume-container { padding: 20px; box-shadow: none; }
    .info-grid { grid-template-columns: 1fr; }
    .basic-info-container { flex-direction: column-reverse; gap: 20px; }
    .photo { margin-left: 0; }
    .block-header { flex-direction: column; gap: 5px; }
    .block-header .date, .block-header .company, .block-header .position {
        width: 100% !important;
        text-align: left !important;
    }
}

/* ==========================================================================
   Top Bar (Language Switcher + Print)
   ========================================================================== */
.top-bar {
    max-width: 850px;
    margin: 0 auto 15px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lang-switcher {
    display: flex;
    gap: 5px;
}

.lang-switcher a {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: var(--text-light);
    background: #f9fafb;
    transition: all 0.2s;
}

.lang-switcher a:hover {
    background: #e5e7eb;
    color: var(--text-main);
}

.lang-switcher a.active {
    background: var(--theme-blue);
    color: #ffffff;
    border-color: var(--theme-blue);
}

.print-btn {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--theme-blue);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.print-btn:hover {
    background-color: #4a637a;
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    @page {
        size: A4 portrait;
        margin: 0; /* Loại bỏ lề mặc định của trình duyệt để hiển thị header/footer rác */
    }

    .top-bar {
        display: none !important;
    }
    
    body {
        padding: 0;
        background-color: white;
    }
    
    .resume-container {
        box-shadow: none;
        margin: 0 auto;
        padding: 40px 50px; /* Giữ nguyên khoảng đệm giống như trên web */
        max-width: 100%;
        width: 100%;
    }

    /* Ngăn nội dung bị cắt ngang giữa 2 trang */
    .content-block, .basic-info-container {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .section-title {
        page-break-after: avoid;
        break-after: avoid;
    }
}
