/* ==========================================================================
   CV BUILDER - TEMPLATE WAVE (SÓNG LƯỢN)
   Á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 Wave Ribbon: Đỉnh trang full-width dạng dải sóng vòm cong mềm mại
     loang gradient từ màu primary sang nâu/đồng ấm, chứa Họ tên in hoa đậm và
     Chức danh căn giữa màu trắng.
   - Footer Wave: Đáy trang dạng dải sóng cong nhỏ đối xứng.
   - Cột trái (~32%): Khung avatar chữ nhật đứng bo góc 8px (3:4 hoặc 4:5),
     Khối Cá nhân & Thông tin liên hệ có icon tròn vàng nghệ/đồng.
   - Cột phải (~68%): Nền trắng sáng, Heading chữ in hoa đậm có đường gạch chân
     mỏng màu xanh dương kéo dài sang phải, Kinh nghiệm, Học vấn, Kỹ năng DUY NHẤT
     1 lần dạng bullet phẳng thanh nhã, Giải thưởng, Mong muốn và Tham khảo (AC06).
   ========================================================================== */

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

/* 1.1. Theme Ocean Wave (Xanh Biển & Nâu Đồng Sóng Lượn - Mặc định) */
.cv-template-wave,
.cv-template-wave[data-theme="ocean_wave"],
[data-theme="ocean_wave"] .cv-template-wave,
[data-theme="ocean_wave"]#cvWaveComponent,
#cvWaveComponent[data-theme="ocean_wave"],
[data-theme="ocean_wave"] {
    --cv-primary: #1e3a8a;
    --cv-primary-subtle: #eff6ff;
    --cv-primary-dark: #172554;
    --cv-primary-rgb: 30, 58, 138;
    --cv-wave-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #78350f 100%);
    --cv-accent: #3b82f6;
    --cv-gold-icon: #d97706;
    --cv-border: #bfdbfe;
    --cv-text-dark: #1e293b;
    --cv-mock-border: #bfdbfe;

    --cv-theme-primary: #1e3a8a;
    --cv-theme-primary-subtle: #eff6ff;
    --cv-theme-primary-dark: #172554;
    --cv-theme-accent: #3b82f6;
    --cv-theme-gold-icon: #d97706;
    --cv-theme-border: #bfdbfe;
    --cv-theme-text-dark: #1e293b;
}

/* 1.2. Theme Burgundy Wave (Đỏ Rượu Vang & Đỏ Hồng Sóng Lượn) */
.cv-template-wave[data-theme="burgundy_wave"],
[data-theme="burgundy_wave"] .cv-template-wave,
[data-theme="burgundy_wave"]#cvWaveComponent,
#cvWaveComponent[data-theme="burgundy_wave"],
[data-theme="burgundy_wave"] {
    --cv-primary: #881337;
    --cv-primary-subtle: #fff1f2;
    --cv-primary-dark: #4c0519;
    --cv-primary-rgb: 136, 19, 55;
    --cv-wave-gradient: linear-gradient(135deg, #881337 0%, #e11d48 50%, #713f12 100%);
    --cv-accent: #e11d48;
    --cv-gold-icon: #d97706;
    --cv-border: #fecdd3;
    --cv-text-dark: #1e293b;
    --cv-mock-border: #fecdd3;

    --cv-theme-primary: #881337;
    --cv-theme-primary-subtle: #fff1f2;
    --cv-theme-primary-dark: #4c0519;
    --cv-theme-accent: #e11d48;
    --cv-theme-gold-icon: #d97706;
    --cv-theme-border: #fecdd3;
    --cv-theme-text-dark: #1e293b;
}

/* 1.3. Theme Teal Wave (Xanh Mòng Két & Xanh Lam Đậm Sóng Lượn) */
.cv-template-wave[data-theme="teal_wave"],
[data-theme="teal_wave"] .cv-template-wave,
[data-theme="teal_wave"]#cvWaveComponent,
#cvWaveComponent[data-theme="teal_wave"],
[data-theme="teal_wave"] {
    --cv-primary: #0f766e;
    --cv-primary-subtle: #f0fdfa;
    --cv-primary-dark: #134e4a;
    --cv-primary-rgb: 15, 118, 110;
    --cv-wave-gradient: linear-gradient(135deg, #0f766e 0%, #14b8a6 50%, #1e3a5f 100%);
    --cv-accent: #14b8a6;
    --cv-gold-icon: #d97706;
    --cv-border: #99f6e4;
    --cv-text-dark: #1e293b;
    --cv-mock-border: #99f6e4;

    --cv-theme-primary: #0f766e;
    --cv-theme-primary-subtle: #f0fdfa;
    --cv-theme-primary-dark: #134e4a;
    --cv-theme-accent: #14b8a6;
    --cv-theme-gold-icon: #d97706;
    --cv-theme-border: #99f6e4;
    --cv-theme-text-dark: #1e293b;
}

/* ==========================================================================
   2. CLASS ĐỊNH HÌNH CẤU TRÚC TEMPLATE WAVE CHUẨN
   ========================================================================== */
.cv-template-wave {
    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: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 2.1. Header Wave Ribbon (Dải sóng vòm cong) */
.cv-wave-header {
    background: var(--cv-wave-gradient, linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #78350f 100%));
    border-bottom-left-radius: 50% 32px;
    border-bottom-right-radius: 50% 32px;
    padding: 30px 20px 32px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: background 0.25s ease;
}

.cv-wave-fullname {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    line-height: 1.25;
}

.cv-wave-title {
    font-size: 0.92rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.88);
}

/* 2.2. Footer Wave (Dải sóng cong đối xứng nhỏ ở đáy) */
.cv-wave-footer {
    background: var(--cv-wave-gradient, linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #78350f 100%));
    border-top-left-radius: 50% 20px;
    border-top-right-radius: 50% 20px;
    height: 28px;
    margin-top: 24px;
    transition: background 0.25s ease;
}

/* 2.3. Khung Avatar chữ nhật đứng bo góc 8px (3:4 hoặc 4:5) */
.cv-wave-avatar-container {
    width: 140px;
    height: 180px;
    display: inline-block;
}

.cv-wave-avatar {
    width: 140px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
}

.cv-wave-avatar-placeholder {
    width: 140px;
    height: 180px;
    border-radius: 8px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #94a3b8;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 2.4. Khối icon tròn vàng nghệ/đồng ở cột trái */
.cv-wave-icon-gold {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--cv-gold-icon, #d97706);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
}

.cv-wave-sidebar-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cv-primary, #1e3a8a);
    letter-spacing: 0.5px;
}

.cv-wave-contact-icon {
    width: 16px;
    text-align: center;
}

/* 2.5. Heading các mục ở cột phải (Đường gạch chân mỏng kéo dài) */
.cv-wave-heading {
    border-bottom: 1.5px solid var(--cv-accent, #3b82f6);
    padding-bottom: 4px;
    margin-bottom: 12px;
}

.cv-wave-heading-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cv-primary, #1e3a8a);
    letter-spacing: 0.5px;
}

/* 2.6. Bullet phẳng cho Kỹ năng (Duy nhất 1 lần) */
.cv-wave-skill-bullet {
    color: var(--cv-primary, #1e3a8a);
    font-weight: bold;
    font-size: 1.15rem;
    line-height: 1;
}

/* 2.7. Tag pill cho Công việc mong muốn */
.cv-wave-tag-pill {
    background-color: var(--cv-primary-subtle, #eff6ff);
    color: var(--cv-primary, #1e3a8a);
    border: 1px solid var(--cv-border, #bfdbfe);
    border-radius: 9999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 500;
    display: inline-block;
}

/* ==========================================================================
   3. DIRECT MODE COMPATIBILITY & FORM HOVER EFFECTS
   ========================================================================== */
.cv-template-wave .hover-border {
    border: 1px dashed transparent !important;
    border-radius: 4px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cv-template-wave .hover-border:hover,
.cv-template-wave .hover-border:focus {
    border-color: var(--cv-accent, #3b82f6) !important;
    background-color: rgba(59, 130, 246, 0.04) !important;
    outline: none !important;
}

/* Chỉnh viền trắng cho input họ tên và chức danh trong Header Wave */
.cv-wave-header .hover-border:hover,
.cv-wave-header .hover-border:focus {
    border-color: rgba(255, 255, 255, 0.6) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.cv-wave-direct-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--cv-primary, #1e3a8a);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.cv-wave-direct-add-btn:hover {
    background-color: var(--cv-accent, #3b82f6);
    transform: translateY(-1px);
}

.cv-wave-direct-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 0.68rem;
    color: #ef4444;
    background-color: #fee2e2;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.cv-wave-direct-remove-btn:hover {
    color: #ffffff;
    background-color: #ef4444;
    transform: scale(1.1);
}

/* Đảm bảo Virtual Select trong Direct Mode hiển thị phẳng và tinh tế */
.cv-template-wave .vscomp-wrapper {
    border: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.cv-template-wave .vscomp-wrapper:hover,
.cv-template-wave .vscomp-wrapper.focused {
    border: 1px dashed var(--cv-accent, #3b82f6) !important;
    border-radius: 4px;
}

/* ==========================================================================
   4. PRINT STYLES - TỐI ƯU KHỔ GIẤY A4
   ========================================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    body {
        background-color: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .cv-template-wave {
        width: 100% !important;
        min-height: 100% !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-wave-header,
    .cv-wave-footer {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-wave-icon-gold,
    .cv-wave-tag-pill,
    .cv-wave-avatar {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-wave-item,
    .cv-live-exp-item,
    .cv-live-edu-item,
    .cv-live-skill-item,
    .cv-live-award-item,
    .cv-live-ref-item,
    .cv-wave-sidebar-block {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }
}
