/* ==========================================================================
   CV BUILDER - TEMPLATE ARTISTIC (NGHỆ THUẬT)
   Á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:
   - Cột trái (~33%): Dải hoa văn Line Art mềm mại, Avatar vòm cong (Arched Avatar),
     Họ tên/Chức danh font serif thanh lịch, Dải phân cách 3 chấm nhỏ, Liên hệ,
     Thông tin cá nhân compact.
   - Cột phải (~67%): Tóm tắt, Kinh nghiệm làm việc (timeline dọc thanh mảnh chấm tròn),
     Học vấn, Kỹ năng bullet phẳng, Giải thưởng & Chứng chỉ, Mong muốn công việc.
   - Toàn bộ heading có đường gạch chân mỏng kéo dài toàn bộ chiều rộng.
   ========================================================================== */

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

/* 1.1. Theme Lilac (Tím Tử Đinh Hương - Mặc định) */
.cv-template-artistic,
.cv-template-artistic[data-theme="lilac"],
[data-theme="lilac"] .cv-template-artistic,
[data-theme="lilac"]#cvArtisticComponent,
#cvArtisticComponent[data-theme="lilac"],
[data-theme="lilac"] {
    --cv-primary: #7c3aed;
    --cv-primary-subtle: #f5f3ff;
    --cv-primary-dark: #5b21b6;
    --cv-primary-rgb: 124, 58, 237;
    --cv-sidebar-bg: #f5f3ff;
    --cv-line-art: #ddd6fe;
    --cv-accent: #a855f7;
    --cv-border: #e9d5ff;
    --cv-text-dark: #1e293b;
    --cv-mock-border: #e9d5ff;

    --cv-theme-primary: #7c3aed;
    --cv-theme-primary-subtle: #f5f3ff;
    --cv-theme-primary-dark: #5b21b6;
    --cv-theme-sidebar-bg: #f5f3ff;
    --cv-theme-line-art: #ddd6fe;
    --cv-theme-accent: #a855f7;
    --cv-theme-border: #e9d5ff;
    --cv-theme-text-dark: #1e293b;
}

/* 1.2. Theme Soft Peach (Cam Đào Nhạt) */
.cv-template-artistic[data-theme="soft_peach"],
[data-theme="soft_peach"] .cv-template-artistic,
[data-theme="soft_peach"]#cvArtisticComponent,
#cvArtisticComponent[data-theme="soft_peach"],
[data-theme="soft_peach"] {
    --cv-primary: #ea580c;
    --cv-primary-subtle: #fff7ed;
    --cv-primary-dark: #c2410c;
    --cv-primary-rgb: 234, 88, 12;
    --cv-sidebar-bg: #fff7ed;
    --cv-line-art: #fed7aa;
    --cv-accent: #f97316;
    --cv-border: #fed7aa;
    --cv-text-dark: #1e293b;
    --cv-mock-border: #fed7aa;

    --cv-theme-primary: #ea580c;
    --cv-theme-primary-subtle: #fff7ed;
    --cv-theme-primary-dark: #c2410c;
    --cv-theme-sidebar-bg: #fff7ed;
    --cv-theme-line-art: #fed7aa;
    --cv-theme-accent: #f97316;
    --cv-theme-border: #fed7aa;
    --cv-theme-text-dark: #1e293b;
}

/* 1.3. Theme Sage (Xanh Xô Thơm Mềm Mại) */
.cv-template-artistic[data-theme="sage"],
[data-theme="sage"] .cv-template-artistic,
[data-theme="sage"]#cvArtisticComponent,
#cvArtisticComponent[data-theme="sage"],
[data-theme="sage"] {
    --cv-primary: #4d7c0f;
    --cv-primary-subtle: #f7fee7;
    --cv-primary-dark: #3f6212;
    --cv-primary-rgb: 77, 124, 15;
    --cv-sidebar-bg: #f7fee7;
    --cv-line-art: #d9f99d;
    --cv-accent: #65a30d;
    --cv-border: #ecfccb;
    --cv-text-dark: #1e293b;
    --cv-mock-border: #ecfccb;

    --cv-theme-primary: #4d7c0f;
    --cv-theme-primary-subtle: #f7fee7;
    --cv-theme-primary-dark: #3f6212;
    --cv-theme-sidebar-bg: #f7fee7;
    --cv-theme-line-art: #d9f99d;
    --cv-theme-accent: #65a30d;
    --cv-theme-border: #ecfccb;
    --cv-theme-text-dark: #1e293b;
}

/* 2. COLOR SWATCHES CHO PALETTE BUTTONS */
.cv-swatch-lilac {
    background-color: #7c3aed;
}

.cv-swatch-soft_peach {
    background-color: #ea580c;
}

.cv-swatch-sage {
    background-color: #4d7c0f;
}

/* 3. CLASS ĐỊNH HÌNH CẤU TRÚC TEMPLATE ARTISTIC CHUẨN */
.cv-template-artistic {
    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;
    overflow: hidden;
}

/* 3.1. Dải trang trí hoa văn Line Art */
.cv-artistic-decor-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    color: var(--cv-theme-line-art, #ddd6fe);
    overflow: hidden;
}

.cv-artistic-lineart-svg {
    width: 100%;
    height: auto;
    min-height: 100%;
    display: block;
}

.cv-artistic-decor-topright {
    position: absolute;
    top: 0;
    right: 0;
    width: 160px;
    height: 100px;
    pointer-events: none;
    z-index: 0;
    color: var(--cv-theme-line-art, #ddd6fe);
    overflow: hidden;
}

.cv-artistic-top-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cv-artistic-content-row {
    position: relative;
    z-index: 1;
}

/* 3.2. Cột Sidebar trái */
.cv-artistic-sidebar {
    background-color: var(--cv-theme-primary-subtle, #f5f3ff);
    border-right: 1px solid var(--cv-theme-border, #e9d5ff);
    position: relative;
    z-index: 1;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

/* Khung avatar vòm cong (Arched Avatar) */
.cv-artistic-avatar-wrap {
    position: relative;
    width: 110px;
    height: 136px;
}

.cv-artistic-avatar {
    width: 110px;
    height: 136px;
    border-radius: 55px 55px 12px 12px;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cv-artistic-avatar-placeholder {
    width: 110px;
    height: 136px;
    border-radius: 55px 55px 12px 12px;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background-color: var(--cv-theme-primary-subtle, #f5f3ff);
    color: var(--cv-theme-primary, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

/* Họ tên & Chức danh serif thanh lịch */
.cv-artistic-fullname {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--cv-theme-primary, #7c3aed);
    line-height: 1.25;
}

.cv-artistic-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.8rem;
    font-style: italic;
    color: #64748b;
    line-height: 1.3;
}

/* Dải phân cách 3 chấm thanh nhã (* * *) */
.cv-artistic-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.cv-artistic-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--cv-theme-primary, #7c3aed);
    opacity: 0.7;
    display: inline-block;
}

/* Liên hệ & Icon */
.cv-artistic-contact-item {
    color: #334155;
}

.cv-artistic-contact-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ffffff;
    color: var(--cv-theme-primary, #7c3aed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.cv-artistic-sub-border {
    border-color: var(--cv-theme-border, #e9d5ff) !important;
}

/* 3.3. Cột Main phải */
.cv-artistic-main {
    background-color: #ffffff;
    position: relative;
    z-index: 1;
}

/* Heading gạch chân thanh mảnh kéo dài */
.cv-artistic-heading {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--cv-theme-primary, #7c3aed);
    text-transform: uppercase;
    border-bottom: 1.5px solid var(--cv-theme-primary, #7c3aed);
    padding-bottom: 4px;
    margin-bottom: 14px;
    position: relative;
}

.cv-artistic-body-text {
    color: #475569;
}

.cv-artistic-item-title {
    font-family: "Playfair Display", Georgia, serif;
    color: #1e293b;
}

.cv-artistic-company {
    color: var(--cv-theme-primary, #7c3aed);
}

/* Timeline dọc thanh mảnh chấm tròn */
.cv-artistic-timeline {
    border-left: 1px solid var(--cv-theme-border, #e9d5ff);
    position: relative;
}

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

.cv-artistic-timeline-dot {
    position: absolute;
    left: -20px;
    top: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--cv-theme-primary, #7c3aed);
    box-shadow: 0 0 0 2px #ffffff;
}

/* Kỹ năng dạng bullet phẳng thanh nhã */
.cv-artistic-skill-bullet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    background-color: var(--cv-theme-primary-subtle, #f5f3ff);
    border: 1px solid var(--cv-theme-border, #e9d5ff);
}

.cv-artistic-skill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--cv-theme-primary, #7c3aed);
    display: inline-block;
}

/* Giải thưởng */
.cv-artistic-award-item {
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--cv-theme-border, #e9d5ff);
}

.cv-artistic-award-item:last-child {
    border-bottom: none;
}

/* Tag pill Desired Job */
.cv-artistic-tag-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--cv-theme-border, #e9d5ff);
    background-color: var(--cv-theme-primary-subtle, #f5f3ff);
    color: var(--cv-theme-primary, #7c3aed);
    font-size: 0.75rem;
    font-weight: 500;
}

/* 4. TƯƠNG THÍCH ĐỒNG BỘ JS REPEATER LIVE PREVIEW
   Hàm syncAllRepeaters() trong create_form.blade.php tự động sinh các class cv-simple-*
   khi người dùng thêm/sửa item. Khối này trung hòa để hiển thị chuẩn phong cách artistic */

/* 4.1. Khối Kinh nghiệm & Học vấn do JS dựng */
.cv-template-artistic .cv-artistic-main .cv-simple-timeline-card,
.cv-template-artistic .cv-artistic-main .cv-simple-education-card {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 0 10px 0 !important;
    margin-bottom: 6px !important;
    border-bottom: 1px dashed var(--cv-theme-border, #e9d5ff) !important;
}

.cv-template-artistic .cv-artistic-main .cv-simple-timeline-card:last-child,
.cv-template-artistic .cv-artistic-main .cv-simple-education-card:last-child {
    border-bottom: none !important;
}

.cv-template-artistic .cv-artistic-main .cv-simple-title {
    font-family: "Playfair Display", Georgia, serif !important;
    color: var(--cv-theme-primary, #7c3aed) !important;
    font-weight: 600 !important;
}

.cv-template-artistic .cv-artistic-main .cv-live-exp-pos,
.cv-template-artistic .cv-artistic-main .cv-live-edu-school {
    font-family: "Playfair Display", Georgia, serif !important;
    color: #1e293b !important;
    font-weight: 700 !important;
}

.cv-template-artistic .cv-artistic-main .cv-live-exp-company,
.cv-template-artistic .cv-artistic-main .cv-live-edu-major {
    color: var(--cv-theme-primary, #7c3aed) !important;
    font-weight: 600 !important;
}

/* 4.2. Khối Kỹ năng do JS dựng (JS tạo col-6 bg-light border + sao FontAwesome)
   -> Chuẩn hóa thành dạng bullet thanh nhã, ẩn sao rating hoặc đổi màu sao sang theme */
.cv-template-artistic .cv-artistic-main .cv-live-skill-item.col-6 {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
}

.cv-template-artistic .cv-artistic-main .cv-live-skill-item .bg-light {
    background-color: var(--cv-theme-primary-subtle, #f5f3ff) !important;
    border: 1px solid var(--cv-theme-border, #e9d5ff) !important;
    border-radius: 20px !important;
    padding: 3px 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
}

.cv-template-artistic .cv-artistic-main .cv-live-skill-stars {
    display: none !important; /* Ẩn sao để giữ bullet phẳng thanh nhã */
}

.cv-template-artistic .cv-artistic-main .cv-live-skill-name {
    color: #1e293b !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

/* 4.3. Khối Giải thưởng do JS dựng */
.cv-template-artistic .cv-artistic-main .cv-simple-award-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 6px 0 !important;
    border-bottom: 1px dashed var(--cv-theme-border, #e9d5ff) !important;
}

.cv-template-artistic .cv-artistic-main .cv-simple-tag-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--cv-theme-border, #e9d5ff);
    background-color: var(--cv-theme-primary-subtle, #f5f3ff);
    color: var(--cv-theme-primary, #7c3aed);
    font-size: 0.75rem;
    font-weight: 500;
}

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

    /* Ẩn toolbar, topbar, buttons khi in */
    .cv-show-topbar,
    .cv-public-topbar,
    .btn,
    .cv-preview-control,
    .cv-preview-actions,
    .no-print,
    header,
    footer,
    nav {
        display: none !important;
    }

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

    .cv-a4-sheet {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        width: 100% !important;
    }

    .cv-template-artistic {
        width: 100% !important;
        background-color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-template-artistic .cv-artistic-sidebar {
        background-color: var(--cv-theme-primary-subtle, #f5f3ff) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

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

    .cv-template-artistic .cv-artistic-decor-left,
    .cv-template-artistic .cv-artistic-decor-topright {
        -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-artistic .break-inside-avoid,
    .cv-artistic-contact-item,
    .cv-artistic-skill-bullet,
    .cv-artistic-timeline-item,
    .cv-artistic-award-item,
    .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-card {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }
}
