/* CV Document Base Dimensions */
.cv-document {
    width: 210mm;
    min-height: 297mm;
    background: white;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    color: #333;
    position: relative;
    overflow: hidden;
    --cv-color: #2c3e50;
    /* Base var to be overridden via JS */
}

/* Print Specific */
@media print {
    body {
        margin: 0;
        background: none;
    }

    .cv-document {
        box-shadow: none;
        border: none;
        width: 100%;
        height: auto;
    }
}

/* Helper resetting */
.cv-document h1,
.cv-document h2,
.cv-document h3,
.cv-document h4,
.cv-document p,
.cv-document ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cv-document p {
    font-size: 10pt;
    line-height: 1.5;
    margin-bottom: 8pt;
    color: #555;
}

/* Components Defaults */
.cv-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.cv-item {
    margin-bottom: 12pt;
}

.cv-item-date {
    font-size: 9pt;
    color: var(--cv-color);
    font-weight: 600;
    margin-bottom: 4pt;
}

.cv-contact i {
    width: 20px;
    text-align: center;
    margin-right: 5px;
    color: var(--cv-color);
}

.cv-section {
    margin-bottom: 20pt;
}

.cv-section h3 {
    font-size: 14pt;
    color: var(--cv-color);
    text-transform: uppercase;
    margin-bottom: 10pt;
    border-bottom: 2px solid var(--cv-color);
    padding-bottom: 4px;
}

.cv-section.cv-certs h4 {
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.cv-contact li,
.cv-skills li,
.cv-langs li {
    font-size: 10pt;
    margin-bottom: 6pt;
}

/* =========================================
   TEMPLATE: cv-ribbon (Modern Banner Ribbon)
========================================= */
.cv-ribbon {
    padding: 0;
    min-height: 297mm;
    background: #fff;
}

.cv-ribbon .cv-header {
    background: var(--cv-color);
    padding: 60px 40px 80px;
    color: white;
    text-align: center;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 50% 100%, 0 90%);
    margin-bottom: 40px;
}

.cv-ribbon .cv-photo {
    width: 150px;
    height: 150px;
    border: 8px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin-bottom: 20px;
}

.cv-ribbon .cv-header h1 {
    font-size: 36pt;
    color: white;
    font-weight: 800;
    letter-spacing: -1px;
}

.cv-ribbon .cv-header h2 {
    font-size: 16pt;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 3px;
}

.cv-ribbon .cv-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11pt;
    max-width: 800px;
    margin: 15px auto 0;
    line-height: 1.6;
}

.cv-ribbon .cv-body {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
    padding: 0 50px 50px;
}

.cv-ribbon .cv-left-col {
    border-right: 1px solid #eee;
    padding-right: 30px;
}

.cv-ribbon .cv-section h3 {
    border-bottom: 3px solid var(--cv-color);
    padding-bottom: 5px;
    text-align: left;
    font-size: 12pt;
}

/* =========================================
   TEMPLATE 2: cv-modern (Left Solid Sidebar)
========================================= */
.cv-modern {
    display: flex;
    height: 297mm;
    padding: 0;
    overflow: hidden;
}

.cv-modern .cv-body {
    display: flex;
    width: 100%;
    height: 100%;
}

.cv-modern .cv-left-col {
    background: var(--cv-color);
    padding: 40px 20px;
    color: white;
    width: 75mm;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.cv-modern .cv-left-col::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cv-color);
    z-index: -1;
}

.cv-modern .cv-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cv-modern .cv-header {
    padding: 40px 40px 10px 40px;
    border-bottom: none;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-shrink: 0;
}

.cv-modern .cv-main-col {
    padding: 0 40px 40px 40px;
    flex: 1;
    overflow-y: auto;
}

.cv-modern .cv-photo {
    border-radius: 50%;
    width: 100px;
    height: 100px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: block;
    margin-bottom: 15px;
}

.cv-modern .cv-header h1 {
    font-size: 34pt;
    color: var(--cv-color);
    margin: 0;
    line-height: 1.1;
}

.cv-modern .cv-header h2 {
    font-size: 16pt;
    color: #666;
    font-weight: 300;
    margin-top: 5px;
}

/* Ensure Lists inside modern dark sidebar are readable */
.cv-modern .cv-left-col li,
.cv-modern .cv-left-col p {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Sections inside sidebar should stretch full width */
.cv-modern .cv-left-col .cv-section {
    width: 100%;
}

.cv-modern .cv-left-col h3 {
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.cv-modern .cv-left-col p {
    color: rgba(255, 255, 255, 0.8);
}

.cv-modern .cv-left-col .cv-contact i {
    color: white;
}

.cv-modern .cv-left-col .cv-item-date {
    color: rgba(255, 255, 255, 0.6);
}

.cv-modern .cv-left-col .cv-section:last-child {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Add spacer to fill remaining space in sidebar */
.cv-modern .cv-left-col::after {
    content: '';
    flex-grow: 1;
    min-height: 1px;
}

/* =========================================
   TEMPLATE 3: cv-elegant (Top Color Block)
========================================= */
.cv-elegant .cv-header {
    background: var(--cv-color);
    padding: 50px;
    color: white;
    text-align: center;
    display: block;
    position: relative;
}

.cv-elegant .cv-header h1 {
    color: white;
    font-size: 36pt;
    font-family: "Georgia", serif;
    letter-spacing: 2px;
}

.cv-elegant .cv-header h2 {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16pt;
    font-family: "Georgia", serif;
    font-weight: normal;
    font-style: italic;
}

.cv-elegant .cv-header .cv-photo {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid white;
    border-radius: 50%;
}

.cv-elegant .cv-body {
    padding: 90px 50px 50px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}

.cv-elegant h3 {
    border: none;
    padding-bottom: 0;
    color: var(--cv-color);
    font-family: "Georgia", serif;
    margin-bottom: 15pt;
    text-transform: none;
    font-size: 16pt;
}

.cv-elegant .cv-contact i {
    background: var(--cv-color);
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    line-height: 25px;
    font-size: 10px;
}

/* Make summary text readable on dark header */
.cv-elegant .cv-header p {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 15px;
    font-size: 11pt;
}

/* =========================================
   TEMPLATE: cv-solid-side (Image 3 Inspired)
========================================= */
.cv-solid-side {
    display: flex;
    flex-direction: column;
    min-height: 297mm;
}

.cv-solid-side .cv-body {
    display: flex;
    flex: 1;
    width: 100%;
}

.cv-solid-side .cv-left-col {
    background: var(--cv-color);
    padding: 40px 25px;
    color: white;
    width: 75mm;
    flex-shrink: 0;
}

.cv-solid-side .cv-main-col {
    padding: 50px;
    flex: 1;
}

.cv-solid-side .cv-header {
    display: none;
    /* Side header used instead */
}

.cv-solid-side .cv-photo {
    width: 150px;
    height: 150px;
    aspect-ratio: 1;
    border: 5px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto 30px;
    display: block;
    border-radius: 50%;
}

.cv-solid-side .cv-left-col h1 {
    font-size: 24pt;
    color: white;
    margin-bottom: 5px;
}

.cv-solid-side .cv-left-col h2 {
    font-size: 13pt;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.cv-solid-side .cv-left-col h3 {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    font-size: 12pt;
}

.cv-solid-side .cv-left-col li,
.cv-solid-side .cv-left-col p {
    color: white !important;
    font-size: 9pt;
}

.cv-solid-side .cv-left-col i {
    color: white;
}

.cv-solid-side .cv-item h4 {
    color: var(--cv-color);
    position: relative;
    padding-left: 15px;
}

.cv-solid-side .cv-item h4::before {
    content: "■";
    position: absolute;
    left: 0;
    font-size: 8pt;
    top: 2px;
}

/* =========================================
   TEMPLATE 5: cv-timeline (Vertical Timeline)
========================================= */
.cv-timeline {
    padding: 40px;
}

.cv-timeline .cv-header {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    align-items: flex-end;
}

.cv-timeline .cv-photo {
    border-radius: 15px;
    box-shadow: 10px 10px 0 var(--cv-color);
}

.cv-timeline .cv-header h1 {
    font-size: 38pt;
    font-weight: 900;
    color: #111;
}

.cv-timeline .cv-header h2 {
    font-size: 14pt;
    background: var(--cv-color);
    color: white;
    display: inline-block;
    padding: 4px 15px;
    border-radius: 20px;
    margin-top: 10px;
}

.cv-timeline .cv-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    grid-template-areas: "main side";
}

.cv-timeline .cv-left-col {
    grid-area: side;
}

.cv-timeline .cv-main-col {
    grid-area: main;
    border-left: 2px solid #eee;
    padding-left: 30px;
    position: relative;
}

.cv-timeline .cv-item {
    position: relative;
    margin-bottom: 25pt;
}

.cv-timeline .cv-item::before {
    content: "";
    position: absolute;
    left: -37px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cv-color);
    border: 3px solid white;
    box-shadow: 0 0 0 1px var(--cv-color);
}

/* =========================================
   TEMPLATE 6: cv-professional (Right Sidebar)
========================================= */
.cv-professional {
    display: grid;
    grid-template-columns: 5fr 2fr;
    grid-template-areas: "header sidebar" "main sidebar";
    grid-template-rows: auto 1fr;
    min-height: 297mm;
    padding: 0;
}

.cv-professional .cv-body {
    display: contents;
}

.cv-professional .cv-left-col {
    grid-area: sidebar;
    background: #f4f6f8;
    padding: 40px;
    border-left: 4px solid var(--cv-color);
    grid-row: 1 / -1;
}

.cv-professional .cv-main-col {
    grid-area: main;
    padding: 0 50px 50px;
}

.cv-professional .cv-header {
    grid-area: header;
    padding: 50px 50px 20px;
    display: flex;
    gap: 30px;
    align-items: center;
}

.cv-professional .cv-photo {
    display: block;
    border-radius: 50%;
    border: 3px solid var(--cv-color);
    width: 120px;
    height: 120px;
}

.cv-professional .cv-header h1 {
    font-size: 32pt;
    color: var(--cv-color);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
    line-height: 1.1;
}

.cv-professional .cv-header h2 {
    font-size: 14pt;
    color: #666;
    font-weight: normal;
    margin-top: 5px;
}

.cv-professional .cv-left-col h3 {
    color: #333;
    border-color: #ccc;
}

/* Make summary text stand out */
.cv-professional .cv-header p {
    color: #475569;
    font-size: 10.5pt;
    line-height: 1.6;
}

/* =========================================
   TEMPLATE 7: cv-creative (Big Photo Header, Overlapping)
========================================= */
.cv-creative .cv-header {
    height: 250px;
    background: var(--cv-color);
    display: flex;
    align-items: center;
    padding: 0 50px;
    color: white;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%);
}

.cv-creative .cv-header-text {
    max-width: calc(100% - 220px);
}

.cv-creative .cv-header h1 {
    color: white;
    font-size: 45pt;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.1;
}

.cv-creative .cv-header h2 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16pt;
    margin-top: 5px;
}

.cv-creative .cv-photo {
    position: absolute;
    right: 50px;
    bottom: 20px;
    width: 160px;
    height: 160px;
    border-radius: 15px;
    border: 6px solid white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.cv-creative .cv-body {
    padding: 40px 50px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
}

.cv-creative h3 {
    border-bottom: none;
    position: relative;
    margin-left: 15px;
}

.cv-creative h3::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--cv-color);
    border-radius: 5px;
}

/* Make summary text readable on dark header */
.cv-creative .cv-header p {
    color: rgba(255, 255, 255, 0.9);
}

/* =========================================
   TEMPLATE: cv-modern-card (Image 1 Inspired)
========================================= */
/* =========================================
   TEMPLATE: cv-modern-card (Professional Cards)
========================================= */
.cv-modern-card {
    background: #f1f5f9;
    padding: 30px;
}

.cv-modern-card .cv-header {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-left: 8px solid var(--cv-color);
}

.cv-modern-card .cv-photo {
    width: 130px;
    height: 130px;
    border-radius: 12px;
}

.cv-modern-card .cv-header h1 {
    font-size: 32pt;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
}

.cv-modern-card .cv-header h2 {
    font-size: 15pt;
    color: var(--cv-color);
    margin-top: 5px;
    font-weight: 600;
}

.cv-modern-card .cv-body {
    display: grid;
    grid-template-columns: 75mm 1fr;
    gap: 25px;
}

.cv-modern-card .cv-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 25px;
    border-top: 4px solid var(--cv-color);
}

.cv-modern-card .cv-section h3 {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 13pt;
    color: var(--cv-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cv-modern-card .cv-left-col,
.cv-modern-card .cv-main-col {
    padding: 0;
}

.cv-modern-card .cv-item {
    margin-bottom: 20px;
}

.cv-modern-card .cv-item-date {
    font-size: 9pt;
    color: #64748b;
    margin-bottom: 5px;
}

.cv-modern-card .cv-item h4 {
    font-size: 12pt;
    color: #1e293b;
    font-weight: 700;
}

.cv-modern-card .cv-left-col li {
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 9.5pt;
    color: #475569;
}

/* =========================================
   TEMPLATE 9: cv-startup (Soft gradients, badges)
========================================= */
.cv-startup {
    padding: 40px;
    background: #fdfdfd;
}

.cv-startup .cv-header {
    background: linear-gradient(135deg, var(--cv-color) 0%, rgba(0, 0, 0, 0.8) 100%);
    border-radius: 20px;
    padding: 40px;
    color: white;
    display: flex;
    gap: 30px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.cv-startup .cv-photo {
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.cv-startup .cv-header h1 {
    color: white;
    font-size: 32pt;
}

.cv-startup .cv-header h2 {
    color: #eee;
    font-weight: normal;
}

.cv-startup .cv-body {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}

.cv-startup .cv-skills li {
    display: inline-block;
    background: rgba(0, 0, 0, 0.05);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 9pt;
    margin-right: 5px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--cv-color);
}

.cv-startup h3 {
    border: none;
    font-weight: 800;
    font-size: 16pt;
    color: #222;
    margin-bottom: 15pt;
}

/* Make summary text readable on dark gradient header */
.cv-startup .cv-header p {
    color: rgba(255, 255, 255, 0.9);
}


/* =========================================
   TEMPLATE: cv-luxury (Pro Horizon)
   Inspired by Reference Image (Teal/Dark/Clean)
========================================= */
.cv-luxury {
    display: grid;
    grid-template-columns: 1fr 75mm;
    min-height: 297mm;
    background: white;
    padding: 0;
    overflow: hidden;
}

/* Header stays in the first column */
.cv-luxury .cv-header {
    grid-column: 1;
    padding: 60px 50px 0;
}

.cv-luxury .cv-header h1 {
    font-size: 44pt;
    font-weight: 800;
    color: #000;
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -1px;
    margin-bottom: 5px;
}

.cv-luxury .cv-header h2 {
    font-size: 16pt;
    font-weight: 400;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* The Dynamic Summary Banner */
.cv-luxury .cv-header p {
    background: var(--cv-color);
    color: white !important;
    margin: 30px 0 0 -50px;
    padding: 20px 50px;
    font-size: 10pt;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cv-luxury .cv-body {
    display: contents;
}

/* Sidebar on the Right (Color depends on theme but stays darkish for contrast) */
.cv-luxury .cv-left-col {
    grid-column: 2;
    grid-row: 1 / span 3;
    background: #1e293b;
    /* Keeping it dark navy as per image for high-end look */
    padding: 50px 25px;
    color: white;
    border-left: 5px solid var(--cv-color);
}

.cv-luxury .cv-main-col {
    grid-column: 1;
    padding: 40px 50px;
}

.cv-luxury .cv-photo {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    margin: 0 auto 40px;
    display: block;
    border: 10px solid rgba(255, 255, 255, 0.05);
}

.cv-luxury .cv-left-col h3 {
    color: white;
    font-size: 14pt;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cv-luxury .cv-left-col h3::after {
    content: "";
    /* Remove line artifact */
}

.cv-luxury .cv-left-col li,
.cv-luxury .cv-left-col p {
    color: #cbd5e1 !important;
    font-size: 10pt;
    margin-bottom: 15px;
}

.cv-luxury .cv-left-col i {
    color: var(--cv-color);
    margin-right: 12px;
    font-size: 14pt;
}

/* Main Content Headers */
.cv-luxury .cv-main-col h3 {
    font-size: 16pt;
    font-weight: 800;
    color: #111;
    text-transform: uppercase;
    border-bottom: 2px solid var(--cv-color);
    padding-bottom: 5px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
}

/* Timeline Layout */
.cv-luxury .cv-item {
    display: grid;
    grid-template-columns: 20mm 1fr;
    gap: 25px;
    margin-bottom: 35px;
    position: relative;
    padding-left: 0;
}

.cv-luxury .cv-item::before {
    content: "";
    position: absolute;
    left: 20mm;
    top: 8px;
    bottom: -35px;
    width: 1px;
    background: #e2e8f0;
    margin-left: 12px;
}

.cv-luxury .cv-item:last-child::before {
    display: none;
}

.cv-luxury .cv-item::after {
    content: "";
    position: absolute;
    left: 20mm;
    top: 8px;
    width: 10px;
    height: 10px;
    background: white;
    border: 3px solid var(--cv-color);
    border-radius: 50%;
    margin-left: 8px;
    z-index: 1;
}

.cv-luxury .cv-item-date {
    font-size: 9.5pt;
    color: #64748b;
    font-weight: 600;
    line-height: 1.4;
}

.cv-luxury .cv-item h4 {
    font-size: 13pt;
    color: #111;
    font-weight: 800;
    margin-bottom: 5px;
}

.cv-luxury .cv-item p {
    color: #475569;
    font-size: 10pt;
    line-height: 1.6;
}

.cv-luxury .cv-main-col .cv-section {
    margin-bottom: 40px;
}