/* ==========================================================================
   CV BUILDER - TEMPLATE IT (CÔNG NGHỆ / IT)
   Á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: Banner Header màu theme (Họ tên + Avatar tròn), Thân 2 cột đối xứng (50-50)
   ngăn cách bằng đường kẻ dọc, tiêu đề mục dạng thẻ bo tròn con nhộng (rounded-pill).
   ========================================================================== */

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

/* 1.1. Theme Plum (Tím mận - Bản gốc & Mặc định) */
.cv-template-it,
.cv-template-it[data-theme="plum"],
[data-theme="plum"] .cv-template-it,
[data-theme="plum"]#cvItComponent,
#cvItComponent[data-theme="plum"],
[data-theme="plum"]#cvItPreview,
#cvItPreview[data-theme="plum"],
[data-theme="plum"]#cvSimpleLivePaper,
[data-theme="plum"] {
    --cv-primary: #a15277;
    --cv-primary-subtle: #fdf2f8;
    --cv-primary-dark: #833c5e;
    --cv-primary-rgb: 161, 82, 119;
    --cv-sidebar-bg: #fdf2f8;
    --cv-accent: #833c5e;
    --cv-border: #fbcfe8;
    --cv-text-dark: #701a75;
    --cv-mock-border: #fbcfe8;

    --cv-theme-primary: #a15277;
    --cv-theme-sidebar-bg: #fdf2f8;
    --cv-theme-accent: #833c5e;
    --cv-theme-border: #fbcfe8;
    --cv-theme-text-dark: #701a75;
}

/* 1.2. Theme Blue (Xanh công nghệ) */
.cv-template-it[data-theme="blue"],
[data-theme="blue"] .cv-template-it,
[data-theme="blue"]#cvItComponent,
#cvItComponent[data-theme="blue"],
[data-theme="blue"]#cvItPreview,
#cvItPreview[data-theme="blue"],
[data-theme="blue"]#cvSimpleLivePaper,
[data-theme="blue"] {
    --cv-primary: #2563eb;
    --cv-primary-subtle: #eff6ff;
    --cv-primary-dark: #1d4ed8;
    --cv-primary-rgb: 37, 99, 235;
    --cv-sidebar-bg: #eff6ff;
    --cv-accent: #1d4ed8;
    --cv-border: #bfdbfe;
    --cv-text-dark: #1e3a8a;
    --cv-mock-border: #bfdbfe;

    --cv-theme-primary: #2563eb;
    --cv-theme-sidebar-bg: #eff6ff;
    --cv-theme-accent: #1d4ed8;
    --cv-theme-border: #bfdbfe;
    --cv-theme-text-dark: #1e3a8a;
}

/* 1.3. Theme Slate (Đen xám IT) */
.cv-template-it[data-theme="slate"],
[data-theme="slate"] .cv-template-it,
[data-theme="slate"]#cvItComponent,
#cvItComponent[data-theme="slate"],
[data-theme="slate"]#cvItPreview,
#cvItPreview[data-theme="slate"],
[data-theme="slate"]#cvSimpleLivePaper,
[data-theme="slate"] {
    --cv-primary: #334155;
    --cv-primary-subtle: #f1f5f9;
    --cv-primary-dark: #0f172a;
    --cv-primary-rgb: 51, 65, 85;
    --cv-sidebar-bg: #f1f5f9;
    --cv-accent: #0f172a;
    --cv-border: #cbd5e1;
    --cv-text-dark: #0f172a;
    --cv-mock-border: #cbd5e1;

    --cv-theme-primary: #334155;
    --cv-theme-sidebar-bg: #f1f5f9;
    --cv-theme-accent: #0f172a;
    --cv-theme-border: #cbd5e1;
    --cv-theme-text-dark: #0f172a;
}

/* 1.4. Theme Emerald (Xanh lục bảo) */
.cv-template-it[data-theme="emerald"],
[data-theme="emerald"] .cv-template-it,
[data-theme="emerald"]#cvItComponent,
#cvItComponent[data-theme="emerald"],
[data-theme="emerald"]#cvItPreview,
#cvItPreview[data-theme="emerald"],
[data-theme="emerald"]#cvSimpleLivePaper,
[data-theme="emerald"] {
    --cv-primary: #059669;
    --cv-primary-subtle: #ecfdf5;
    --cv-primary-dark: #047857;
    --cv-primary-rgb: 5, 150, 105;
    --cv-sidebar-bg: #ecfdf5;
    --cv-accent: #047857;
    --cv-border: #a7f3d0;
    --cv-text-dark: #064e3b;
    --cv-mock-border: #a7f3d0;

    --cv-theme-primary: #059669;
    --cv-theme-sidebar-bg: #ecfdf5;
    --cv-theme-accent: #047857;
    --cv-theme-border: #a7f3d0;
    --cv-theme-text-dark: #064e3b;
}

/* 2. COLOR SWATCHES CHO PALETTE BUTTONS */
.cv-swatch-plum {
    background-color: #a15277;
}

.cv-swatch-blue {
    background-color: #2563eb;
}

.cv-swatch-slate {
    background-color: #334155;
}

.cv-swatch-emerald {
    background-color: #059669;
}

/* 3. CLASS ĐỊNH HÌNH CẤU TRÚC TEMPLATE IT CHUẨN GỐC */
.cv-template-it {
    background-color: #ffffff;
    width: 100%;
    min-height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #334155;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* 3.1. Header Banner Màu Theme */
.cv-it-header {
    background-color: var(--cv-theme-primary) !important;
    color: #ffffff !important;
    transition: background-color 0.2s ease-in-out;
}

.cv-it-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.cv-it-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: 4px solid #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.6rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.cv-it-fullname {
    color: #ffffff !important;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.cv-it-title {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 3.2. Tiêu Đề Mục Dạng Pill Bo Tròn */
.cv-it-pill {
    background-color: var(--cv-theme-primary) !important;
    color: #ffffff !important;
    border-radius: 50rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 6px 20px;
    display: inline-block;
    transition: background-color 0.2s ease-in-out;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cv-it-pill-left {
    padding: 6px 20px 6px 36px;
}

.cv-it-pill-right {
    padding: 6px 36px 6px 20px;
}

/* 3.3. Đường Kẻ Phân Cách Giữa 2 Cột */
.cv-it-divider {
    border-right: 2px solid var(--cv-theme-border) !important;
    transition: border-color 0.2s ease-in-out;
}

/* 3.4. Điểm Nhấn & Tags */
.cv-it-primary-text {
    color: var(--cv-theme-primary) !important;
    transition: color 0.2s ease-in-out;
}

.cv-it-tag-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 50rem;
    border: 1px solid var(--cv-theme-border);
    background-color: var(--cv-theme-sidebar-bg);
    color: var(--cv-theme-accent);
    font-size: 0.75rem;
    font-weight: 500;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.cv-it-star {
    color: #f59e0b;
    font-size: 0.8rem;
}

.cv-it-star-empty {
    color: #cbd5e1;
    font-size: 0.8rem;
}

.cv-it-icon {
    color: var(--cv-theme-primary);
    transition: color 0.2s ease-in-out;
}

/* 4. TƯƠNG THÍCH ĐỒNG BỘ JS REPEATER LIVE PREVIEW (KHI JS TẠO DÒNG ĐỘNG) */
.cv-template-it .cv-simple-title {
    color: var(--cv-theme-primary) !important;
}

.cv-template-it .cv-simple-timeline-card {
    border-left: 2px solid var(--cv-theme-primary) !important;
    padding-left: 10px;
    margin-bottom: 14px;
}

.cv-template-it .text-end .cv-simple-timeline-card {
    border-left: none !important;
    border-right: 2px solid var(--cv-theme-primary) !important;
    padding-left: 0;
    padding-right: 10px;
}

.cv-template-it .cv-simple-education-header {
    background-color: var(--cv-theme-primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px 4px 0 0;
    font-size: 0.85rem;
}

.cv-template-it .cv-simple-education-body {
    border: 1px solid var(--cv-theme-border) !important;
    border-top: none !important;
    border-radius: 0 0 4px 4px;
    padding: 10px 12px;
    background-color: #ffffff;
}

.cv-template-it .cv-simple-star {
    color: #f59e0b !important;
    font-size: 0.75rem;
}

.cv-template-it .cv-simple-star-empty {
    color: #cbd5e1 !important;
    font-size: 0.75rem;
}

.cv-template-it .cv-simple-tag-pill {
    border-color: var(--cv-theme-border) !important;
    background-color: var(--cv-theme-sidebar-bg) !important;
    color: var(--cv-theme-accent) !important;
    border-radius: 50rem !important;
}

/* 5. DIRECT MODE IT SHEET STYLING */
.cv-template-it .cv-avatar-badge {
    background-color: #ffffff;
    color: var(--cv-theme-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0;
    right: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.cv-template-it .cv-direct-add-btn {
    border: 1px dashed var(--cv-theme-border);
    background-color: transparent;
    color: var(--cv-theme-primary);
    border-radius: 50rem;
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.cv-template-it .cv-direct-add-btn:hover {
    background-color: var(--cv-theme-sidebar-bg) !important;
    border-color: var(--cv-theme-primary) !important;
    color: var(--cv-theme-primary) !important;
}

.cv-template-it .cv-it-direct-fullname::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.cv-template-it .cv-it-direct-title::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.cv-template-it .cv-direct-it-item {
    transition: all 0.15s ease-in-out;
}

/* 6. WIREFRAME MOCKUP TIỆN ÍCH (CHO CATALOG VÀ THẺ CV) */
.cv-mock-it {
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cv-mock-it-header {
    background-color: var(--cv-mock-primary, #a15277);
}

.cv-mock-it .cv-mock-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.cv-mock-it-divider {
    border-right: 1px solid var(--cv-mock-border, #fbcfe8);
}

.cv-mock-it-pill {
    background-color: var(--cv-mock-primary, #a15277);
    border-radius: 50rem;
}

/* 7. @MEDIA PRINT A4 CHUẨN: KHÔNG CẮT KHỐI, CHỐNG TRÀN LỀ, BẢO TOÀN MÀU NỀN */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    /* Ẩn hoàn toàn các thành phần điều khiển khi in */
    .cv-show-topbar,
    .cv-public-topbar,
    .btn,
    .cv-preview-control,
    .cv-preview-actions,
    .no-print,
    header,
    footer,
    nav,
    .cv-builder-header,
    .cv-form-toolbar {
        display: none !important;
    }

    /* Reset margin, padding, shadow cho stage, sheet & template */
    .cv-paper-stage,
    .cv-a4-sheet,
    .cv-template-it {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .cv-paper-stage {
        background: transparent !important;
    }

    .cv-template-it {
        background-color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-it-header {
        background-color: var(--cv-theme-primary) !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-it-pill {
        background-color: var(--cv-theme-primary) !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-it-divider {
        border-right: 2px solid var(--cv-theme-border) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-it-tag-pill {
        background-color: var(--cv-theme-sidebar-bg) !important;
        border-color: var(--cv-theme-border) !important;
        color: var(--cv-theme-accent) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Ngăn ngắt trang xấu giữa chừng các khối thông tin */
    .cv-template-it .break-inside-avoid,
    .cv-live-exp-item,
    .cv-live-edu-item,
    .cv-live-skill-item,
    .cv-live-award-item,
    .cv-live-ref-item,
    .cv-simple-timeline-card,
    .cv-simple-education-header,
    .cv-simple-education-body {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }
}
