/* ==========================================================================
   CV BUILDER - TEMPLATE PASTEL (TƯƠI SÁNG)
   Áp dụng kiến trúc CSS phân tầng độc lập & hỗ trợ đa bảng màu theo [data-theme]
   Bố cục:
   - Header banner: Khung chữ nhật bo góc tròn lớn (24px) nền mint pastel nhạt,
     Avatar tròn viền trắng nổi bật, Họ tên in hoa lớn màu cam rực rỡ,
     Chức danh màu xanh ngọc đậm.
   - Cột trái (Sidebar ~33%): Các khối Bubble Cards kẹo ngọt bo góc tròn (20px),
     nền mint nhạt mềm mại: Thông tin cá nhân (icon tròn màu cam), Mục tiêu nghề nghiệp,
     Kỹ năng (bullet phẳng màu cam, DUY NHẤT 1 lần, ẩn sao), Danh hiệu và giải thưởng.
   - Cột phải (Main ~67%): Heading dạng thanh pill bo tròn màu mint pastel có icon
     tròn bên trái, vạch timeline dọc màu cam nối các mốc Học vấn & Kinh nghiệm làm việc,
     Mong muốn công việc & Thông tin compact giữ trọn AC06, Người tham khảo (ẩn khi rỗng).
   ========================================================================== */

/* 1. THEME VARIABLES CHO CÁC BẢNG MÀU CỦA TEMPLATE PASTEL */

/* 1.1. Theme Mint Orange (Xanh Mint & Cam Tươi Sáng - Mặc định) */
.cv-template-pastel,
.cv-template-pastel[data-theme="mint_orange"],
[data-theme="mint_orange"] .cv-template-pastel,
[data-theme="mint_orange"]#cvPastelComponent,
#cvPastelComponent[data-theme="mint_orange"],
[data-theme="mint_orange"] {
    --cv-primary: #ea580c;
    --cv-primary-subtle: #ecfdf5;
    --cv-primary-dark: #c2410c;
    --cv-primary-rgb: 234, 88, 12;
    --cv-secondary: #10b981;
    --cv-banner-bg: #d1fae5;
    --cv-bubble-bg: #ecfdf5;
    --cv-accent: #059669;
    --cv-border: #a7f3d0;
    --cv-text-dark: #1e293b;
    --cv-timeline-line: #fde68a;
    --cv-mock-border: #a7f3d0;

    --cv-theme-primary: #ea580c;
    --cv-theme-primary-subtle: #ecfdf5;
    --cv-theme-primary-dark: #c2410c;
    --cv-theme-secondary: #10b981;
    --cv-theme-banner-bg: #d1fae5;
    --cv-theme-bubble-bg: #ecfdf5;
    --cv-theme-accent: #059669;
    --cv-theme-border: #a7f3d0;
    --cv-theme-text-dark: #1e293b;
    --cv-theme-timeline-line: #fde68a;
}

/* 1.2. Theme Sky Rose (Xanh Da Trời & Hồng Đỏ Kẹo Ngọt) */
.cv-template-pastel[data-theme="sky_rose"],
[data-theme="sky_rose"] .cv-template-pastel,
[data-theme="sky_rose"]#cvPastelComponent,
#cvPastelComponent[data-theme="sky_rose"],
[data-theme="sky_rose"] {
    --cv-primary: #e11d48;
    --cv-primary-subtle: #f0f9ff;
    --cv-primary-dark: #be123c;
    --cv-primary-rgb: 225, 29, 72;
    --cv-secondary: #0284c7;
    --cv-banner-bg: #bae6fd;
    --cv-bubble-bg: #f0f9ff;
    --cv-accent: #0369a1;
    --cv-border: #7dd3fc;
    --cv-text-dark: #1e293b;
    --cv-timeline-line: #fecdd3;
    --cv-mock-border: #7dd3fc;

    --cv-theme-primary: #e11d48;
    --cv-theme-primary-subtle: #f0f9ff;
    --cv-theme-primary-dark: #be123c;
    --cv-theme-secondary: #0284c7;
    --cv-theme-banner-bg: #bae6fd;
    --cv-theme-bubble-bg: #f0f9ff;
    --cv-theme-accent: #0369a1;
    --cv-theme-border: #7dd3fc;
    --cv-theme-text-dark: #1e293b;
    --cv-theme-timeline-line: #fecdd3;
}

/* 1.3. Theme Lavender Gold (Tím Oải Hương & Vàng Kim Sang Trọng) */
.cv-template-pastel[data-theme="lavender_gold"],
[data-theme="lavender_gold"] .cv-template-pastel,
[data-theme="lavender_gold"]#cvPastelComponent,
#cvPastelComponent[data-theme="lavender_gold"],
[data-theme="lavender_gold"] {
    --cv-primary: #d97706;
    --cv-primary-subtle: #faf5ff;
    --cv-primary-dark: #b45309;
    --cv-primary-rgb: 217, 119, 6;
    --cv-secondary: #7c3aed;
    --cv-banner-bg: #e9d5ff;
    --cv-bubble-bg: #faf5ff;
    --cv-accent: #6d28d9;
    --cv-border: #d8b4fe;
    --cv-text-dark: #1e293b;
    --cv-timeline-line: #fef08a;
    --cv-mock-border: #d8b4fe;

    --cv-theme-primary: #d97706;
    --cv-theme-primary-subtle: #faf5ff;
    --cv-theme-primary-dark: #b45309;
    --cv-theme-secondary: #7c3aed;
    --cv-theme-banner-bg: #e9d5ff;
    --cv-theme-bubble-bg: #faf5ff;
    --cv-theme-accent: #6d28d9;
    --cv-theme-border: #d8b4fe;
    --cv-theme-text-dark: #1e293b;
    --cv-theme-timeline-line: #fef08a;
}

/* 2. CLASS ĐỊNH HÌNH CẤU TRÚC TEMPLATE PASTEL CHUẨN */
.cv-template-pastel {
    background-color: #ffffff;
    width: 100%;
    min-height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 24px;
    box-sizing: border-box;
}

/* 2.1. Header Banner bo góc tròn lớn 24px */
.cv-pastel-header {
    background-color: var(--cv-theme-banner-bg, #d1fae5);
    border-radius: 24px;
    border: 1px solid var(--cv-theme-border, #a7f3d0);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.cv-pastel-avatar-wrap {
    width: 90px;
    height: 90px;
    display: inline-block;
}

.cv-pastel-avatar {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    background-color: #ffffff;
}

.cv-pastel-avatar-placeholder {
    width: 90px;
    height: 90px;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    background-color: #ffffff;
    color: var(--cv-theme-secondary, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.cv-pastel-fullname {
    color: var(--cv-theme-primary, #ea580c);
    font-size: 1.55rem;
    line-height: 1.25;
    letter-spacing: 0.5px;
}

.cv-pastel-title {
    color: var(--cv-theme-accent, #059669);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* 2.2. Thân 2 cột */
.cv-pastel-body {
    min-height: calc(100% - 150px);
}

/* 2.3. Cột trái Sidebar: Bubble Cards */
.cv-pastel-sidebar {
    box-sizing: border-box;
}

.cv-pastel-bubble-card {
    background-color: var(--cv-theme-bubble-bg, #ecfdf5);
    border-radius: 20px;
    border: 1px solid var(--cv-theme-border, #a7f3d0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Pill badge nhỏ tiêu đề trong card */
.cv-pastel-pill-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    background-color: #ffffff;
    border-radius: 9999px;
    border: 1px solid var(--cv-theme-border, #a7f3d0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.cv-pastel-pill-badge-text {
    color: var(--cv-theme-primary, #ea580c);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Icon tròn màu cam trong thông tin liên hệ */
.cv-pastel-icon-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--cv-theme-primary, #ea580c);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
}

.cv-pastel-summary-text {
    color: #334155;
}

/* Kỹ năng */
.cv-pastel-skill-row {
    padding: 1px 0;
}

.cv-pastel-skill-bullet {
    color: var(--cv-theme-primary, #ea580c);
    font-size: 1.1rem;
    line-height: 1;
}

.cv-pastel-skill-name {
    color: var(--cv-theme-primary, #ea580c);
}

/* Giải thưởng */
.cv-pastel-award-time {
    color: var(--cv-theme-primary, #ea580c);
}

.cv-pastel-award-name {
    color: #1e293b;
    line-height: 1.35;
}

/* 2.4. Cột phải Main: Heading thanh pill & Timeline */
.cv-pastel-main {
    box-sizing: border-box;
}

.cv-pastel-section-pill {
    display: inline-flex;
    align-items: center;
    background-color: var(--cv-theme-banner-bg, #d1fae5);
    border-radius: 9999px;
    padding: 4px 16px 4px 6px;
    border: 1px solid var(--cv-theme-border, #a7f3d0);
    gap: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.cv-pastel-pill-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--cv-theme-secondary, #10b981);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.cv-pastel-pill-text {
    color: var(--cv-theme-primary, #ea580c);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Đường timeline dọc màu cam */
.cv-pastel-timeline {
    border-left: 2px solid var(--cv-theme-timeline-line, #fde68a);
    margin-left: 12px;
    position: relative;
}

.cv-pastel-timeline-item {
    position: relative;
}

/* Chấm tròn cam nối mốc timeline cho Học vấn */
.cv-pastel-timeline-marker {
    position: absolute;
    left: -22px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--cv-theme-primary, #ea580c);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--cv-theme-timeline-line, #fde68a);
}

/* Icon tròn nhỏ xanh ngọc nối mốc timeline cho Kinh nghiệm */
.cv-pastel-timeline-icon-marker {
    position: absolute;
    left: -26px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--cv-theme-secondary, #10b981);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    box-shadow: 0 0 0 2px #ffffff;
}

.cv-pastel-item-school,
.cv-pastel-item-pos {
    color: var(--cv-theme-primary, #ea580c);
}

.cv-pastel-item-time {
    color: var(--cv-theme-primary, #ea580c);
}

.cv-pastel-item-major,
.cv-pastel-item-company {
    color: #1e293b;
}

.cv-pastel-tag-pill {
    display: inline-block;
    padding: 2px 9px;
    background-color: var(--cv-theme-bubble-bg, #ecfdf5);
    border: 1px solid var(--cv-theme-border, #a7f3d0);
    color: var(--cv-theme-accent, #059669);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
}

/* 3. DIRECT MODE TÙY BIẾN CHO TEMPLATE PASTEL */
.cv-template-pastel input.form-control-plaintext,
.cv-template-pastel select.form-control-plaintext,
.cv-template-pastel textarea.form-control-plaintext {
    color: inherit;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cv-template-pastel .hover-border {
    border: 1px dashed transparent !important;
    border-radius: 4px;
}

.cv-template-pastel .hover-border:hover,
.cv-template-pastel .hover-border:focus {
    border-color: var(--cv-theme-primary, #ea580c) !important;
    background-color: rgba(255, 255, 255, 0.7) !important;
}

.cv-template-pastel .cv-avatar-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--cv-theme-primary, #ea580c);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cv-pastel-direct-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 9999px;
    background-color: #ffffff;
    border: 1px solid var(--cv-theme-border, #a7f3d0);
    color: var(--cv-theme-primary, #ea580c);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cv-pastel-direct-add-btn:hover {
    background-color: var(--cv-theme-primary, #ea580c);
    color: #ffffff;
    border-color: var(--cv-theme-primary, #ea580c);
}

.cv-pastel-direct-remove-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.cv-pastel-direct-remove-btn:hover {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

/* 4. TƯƠNG THÍCH ĐỒNG BỘ JS REPEATER LIVE PREVIEW */
/* Đồng bộ các phần tử do Javascript Live Preview render vào container */
#livePreviewSkillContainer .cv-simple-star {
    display: none !important;
}

#livePreviewSkillContainer .cv-simple-skill-item {
    display: flex;
    align-items: center;
    padding: 1px 0;
}

#livePreviewSkillContainer .cv-simple-skill-item::before {
    content: "•";
    color: var(--cv-theme-primary, #ea580c);
    font-size: 1.1rem;
    font-weight: bold;
    margin-right: 8px;
    line-height: 1;
}

#livePreviewSkillContainer .cv-simple-skill-name {
    color: var(--cv-theme-primary, #ea580c) !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
}

/* Học vấn do JS dựng */
#livePreviewEducationContainer .cv-simple-item,
#livePreviewEducationContainer .cv-live-edu-item {
    position: relative;
    padding-bottom: 8px;
}

#livePreviewEducationContainer .cv-simple-item::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--cv-theme-primary, #ea580c);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--cv-theme-timeline-line, #fde68a);
}

#livePreviewEducationContainer .cv-simple-item-title,
#livePreviewEducationContainer .cv-live-edu-school {
    color: var(--cv-theme-primary, #ea580c) !important;
    font-weight: 700 !important;
}

#livePreviewEducationContainer .cv-simple-time,
#livePreviewEducationContainer .cv-live-edu-time {
    color: var(--cv-theme-primary, #ea580c) !important;
    font-weight: 600 !important;
}

/* Kinh nghiệm do JS dựng */
#livePreviewExperienceContainer .cv-simple-item,
#livePreviewExperienceContainer .cv-live-exp-item {
    position: relative;
    padding-bottom: 12px;
}

#livePreviewExperienceContainer .cv-simple-item::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--cv-theme-secondary, #10b981);
    box-shadow: 0 0 0 2px #ffffff;
}

#livePreviewExperienceContainer .cv-simple-item-title,
#livePreviewExperienceContainer .cv-live-exp-pos {
    color: var(--cv-theme-primary, #ea580c) !important;
    font-weight: 700 !important;
}

#livePreviewExperienceContainer .cv-simple-time,
#livePreviewExperienceContainer .cv-live-exp-time {
    color: var(--cv-theme-primary, #ea580c) !important;
    font-weight: 600 !important;
}

#livePreviewAwardContainer .cv-simple-time,
#livePreviewAwardContainer .cv-live-award-time {
    color: var(--cv-theme-primary, #ea580c) !important;
    font-weight: 700 !important;
}

/* 5. TỐI ƯU IN ẤN VÀ XUẤT PDF KHỔ A4 (PRINT STYLES) */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-template-pastel {
        padding: 18mm 14mm !important;
        background-color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-pastel-header,
    .cv-pastel-bubble-card,
    .cv-pastel-section-pill,
    .cv-pastel-pill-badge,
    .cv-pastel-icon-circle,
    .cv-pastel-tag-pill {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        break-inside: avoid;
    }

    .cv-pastel-section,
    .cv-pastel-timeline-item,
    .cv-pastel-bubble-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Ẩn các nút hành động Direct Mode khi in ấn */
    .cv-pastel-direct-add-btn,
    .cv-pastel-direct-remove-btn,
    .cv-avatar-badge {
        display: none !important;
    }
}
