:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   TOP NAVBAR
   ========================================= */
.top-navbar {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}
.nav-brand i { color: var(--primary); }
.nav-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-auth {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-nav {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}
.btn-nav:hover { background: #f1f5f9; }

.btn-nav-primary {
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}
.btn-nav-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.header-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.header-user-info {
    display: flex;
    flex-direction: column;
}
.header-user-info .user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}
.header-user-info .logout-link {
    font-size: 0.8rem;
    color: var(--danger);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.15rem;
}
.header-user-info .logout-link i {
    width: 14px;
    height: 14px;
}

/* =========================================
   AUTHENTICATION PAGE
   ========================================= */
.auth-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    padding: 100px 2rem 2rem 2rem;
    overflow-x: hidden;
}

.auth-container {
    display: flex;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    overflow: hidden;
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, #312e81 100%);
    color: white;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.logo-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.auth-left h2 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.auth-left p {
    color: #c7d2fe;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.auth-features .feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    font-weight: 500;
}

.feature i {
    color: #34d399;
}

.auth-right {
    flex: 1;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
}

.auth-form {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.auth-form.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-form h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    background: var(--bg);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: var(--surface);
}

.input-group i {
    position: absolute;
    left: 0.75rem;
    top: 2.1rem;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.auth-message.success { background: #d1fae5; color: #065f46; }
.auth-message.error { background: #fee2e2; color: #991b1b; }

/* =========================================
   DASHBOARD LAYOUT
   ========================================= */
.app-layout {
    display: flex;
    height: calc(100vh - 70px);
    margin-top: 70px;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    color: var(--primary);
}

.sidebar-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; font-size: 0.95rem; }
.logout-link { font-size: 0.8rem; color: var(--danger); text-decoration: none; display: flex; align-items: center; gap: 0.25rem; margin-top: 0.25rem; }
.logout-link i { width: 14px; height: 14px; }

.mt-4 { margin-top: 1rem; }
.w-100 { width: 100%; }

.cv-list-container { margin-top: 2rem; flex: 1; overflow-y: auto; }
.cv-list-container h3 { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.cv-list-container h3 i { width: 16px; height: 16px; }

.cv-list { list-style: none; }
.cv-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-muted);
}
.cv-list li:hover { background: var(--bg); color: var(--text-main); }
.cv-list li.active { background: #e0e7ff; color: var(--primary); font-weight: 500; }
.cv-list-item-content { display: flex; align-items: center; gap: 0.75rem; flex: 1; overflow: hidden; }
.cv-list-item-content i { width: 18px; height: 18px; flex-shrink: 0;}
.cv-list-item-content span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Workspace */
.workspace { flex: 1; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }

.cv-title-input {
    font-size: 1.25rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-main);
    outline: none;
    border-bottom: 2px solid transparent;
    padding: 0.25rem 0;
    transition: border-color 0.2s;
    width: 300px;
}
.cv-title-input:focus { border-bottom-color: var(--primary); }

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.btn-secondary:hover { background: var(--bg); border-color: var(--secondary); }

/* Editor & Preview */
.editor-preview-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-panel {
    width: 45%;
    max-width: 500px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 2rem;
}

.preview-panel {
    flex: 1;
    background: #e2e8f0;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-header-inline {
    width: 794px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.preview-header-inline h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.preview-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.preview-actions .cv-title-input {
    font-size: 1rem;
    width: 200px;
    border-bottom: 1px solid var(--border);
    padding: 0.25rem 0.5rem;
    background: white;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.preview-actions .cv-title-input:focus {
    border-bottom-color: var(--primary);
    background: white;
}

/* Accordion */
.accordion { display: flex; flex-direction: column; gap: 1rem; }
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.accordion-header {
    background: var(--bg);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.accordion-header h4 { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; font-weight: 600; }
.accordion-header h4 i { width: 18px; height: 18px; color: var(--primary); }
.accordion-header .chevron { width: 20px; height: 20px; transition: transform 0.3s; color: var(--text-muted); }
.accordion-content { padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background: white; }

.accordion-item.active .accordion-header .chevron { transform: rotate(180deg); }
.accordion-item.active .accordion-content { padding: 1.25rem; max-height: 2000px; }

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-group.full-width { grid-column: 1 / -1; }

.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: white;
    font-size: 14px;
    color: var(--text-main);
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }

.dynamic-form-item {
    position: relative;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    margin-right: 2.5rem;
}
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { color: var(--text-main); }
.dynamic-form-item > .text-danger { 
    position: absolute; 
    top: 50%; 
    right: -2.5rem; 
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
}
.text-danger { 
    color: var(--danger); 
}
.text-danger:hover { color: #b91c1c; }

.btn-outline {
    background: transparent;
    border: 1px dashed var(--primary);
    color: var(--primary);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.btn-outline:hover { background: #e0e7ff; }

/* =========================================
   A4 CV PREVIEW STYLING
   ========================================= */
.cv-template-wrapper {
    background: white;
    width: 794px;
    min-height: 1118px;
    box-shadow: var(--shadow-lg);
    border-radius: 2px;
}

.cv-template {
    width: 794px;
    height: 1118px;
    box-sizing: border-box;
    position: relative;
    background: #ffffff;
    padding: 40px;
    color: #333;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    word-break: break-word;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.cv-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.cv-header h1 {
    font-size: 28px;
    font-weight: 700;
    /* text-transform: uppercase; commented out to let JS toLocaleUpperCase('tr-TR') render flawlessly in PDF */
    letter-spacing: 2px;
    margin-bottom: 5px;
    color: #111;
}

.cv-header h2 {
    font-size: 16px;
    font-weight: 400;
    color: #555;
    margin-bottom: 15px;
}

.cv-contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-size: 13px;
    color: #444;
}

.cv-contact-info span { display: inline-flex; align-items: center; gap: 5px; }
.cv-contact-info i, .cv-contact-info svg { width: 14px; height: 14px; color: #666; }

.cv-two-col {
    display: flex;
    gap: 30px;
}
.cv-col-main { flex: 2; }
.cv-col-side { flex: 1; }

.cv-section { margin-bottom: 25px; }
.cv-section h3 {
    font-size: 16px;
    /* text-transform: uppercase; commented out to let static/dynamic Turkish uppercase headers render flawlessly in PDF */
    color: #111;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.cv-section p { font-size: 13px; color: #444; }

.cv-item { margin-bottom: 15px; }
.cv-item-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.cv-item-header strong { font-size: 14px; color: #111; }
.cv-item-header span { font-size: 12px; color: #666; font-style: italic; }
.cv-item-sub { font-size: 13.5px; font-weight: 500; font-style: italic; color: #334155; margin-bottom: 5px; }
.cv-item-desc { font-size: 13px; color: #555; margin-top: 5px;}

.cv-skills-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cv-skills-list li {
    font-size: 13px;
    background: #f1f5f9;
    padding: 5px 11px;
    border-radius: 4px;
    display: inline-block;
    width: auto;
    white-space: nowrap;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    background: var(--text-main);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* =========================================
   LANDING PAGE SECTIONS
   ========================================= */
.landing-section {
    width: 100%;
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.landing-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.landing-section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.landing-section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2rem auto;
    line-height: 1.6;
}

.landing-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #d1fae5;
    color: #065f46;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.landing-stats i {
    width: 20px;
    height: 20px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.template-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.template-preview {
    width: 100%;
    height: 340px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 1.5rem;
}

/* Creating CSS-based dummy CV previews */
.dummy-cv {
    width: 210px;
    height: 297px;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border-radius: 2px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform-origin: top center;
    transition: transform 0.3s ease;
}

.template-card:hover .dummy-cv {
    transform: scale(1.05);
}

.dummy-header { height: 30px; background: #e2e8f0; border-radius: 2px; width: 60%; margin: 0 auto; }
.dummy-line { height: 8px; background: #cbd5e1; border-radius: 2px; width: 100%; }
.dummy-line.short { width: 70%; }
.dummy-line.shorter { width: 40%; }
.dummy-section { display: flex; flex-direction: column; gap: 6px; }

/* Different styles for different dummy CVs */
.dummy-cv.style-1 .dummy-header { background: #4f46e5; width: 100%; height: 40px; margin: 0; }
.dummy-cv.style-1 .dummy-line { background: #e2e8f0; }

.dummy-cv.style-2 { flex-direction: row; gap: 10px; padding: 0; }
.dummy-cv.style-2 .dummy-sidebar { width: 35%; height: 100%; background: #334155; padding: 15px 10px; display:flex; flex-direction: column; gap: 8px;}
.dummy-cv.style-2 .dummy-sidebar .dummy-line { background: #64748b; }
.dummy-cv.style-2 .dummy-main { padding: 15px 10px; flex: 1; display:flex; flex-direction: column; gap: 10px;}

.dummy-cv.style-3 .dummy-header { background: #0f172a; width: 80%; height: 35px; border-radius: 0; align-self: flex-start; margin: 0; }

.dummy-cv.style-4 .dummy-header { border-bottom: 2px solid #cbd5e1; background: transparent; width: 100%; height: 40px; margin: 0; }

.dummy-cv.style-5 { flex-direction: row; gap: 0; padding: 0; }
.dummy-cv.style-5 .dummy-sidebar { width: 30%; height: 100%; background: #0ea5e9; padding: 15px 10px; display:flex; flex-direction: column; gap: 8px;}
.dummy-cv.style-5 .dummy-sidebar .dummy-line { background: #bae6fd; }
.dummy-cv.style-5 .dummy-main { padding: 15px; flex: 1; display:flex; flex-direction: column; gap: 10px;}

.dummy-cv.style-6 .dummy-header { background: #db2777; width: 40px; height: 40px; border-radius: 50%; align-self: center; margin-bottom: 10px; }

.template-info {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
}

.template-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
}

.template-badge {
    background: #e0e7ff;
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-large {
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    display: inline-flex;
    text-decoration: none;
    margin-top: 1rem;
}

/* =========================================
   TEMPLATE SELECTOR WIDGET
   ========================================= */
.template-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.template-option {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background: var(--bg);
}
.template-option:hover {
    border-color: var(--primary);
    background: white;
}
.template-option.active {
    border-color: var(--primary);
    background: #e0e7ff;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}
.template-option span {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    color: var(--text-main);
}
.tmpl-preview {
    width: 100%;
    height: 60px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    padding: 4px;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.tmpl-header { height: 10px; background: #e2e8f0; border-radius: 1px; }
.tmpl-line { height: 4px; background: #cbd5e1; border-radius: 1px; width: 80%; }
.tmpl-side { width: 30%; height: 100%; background: #334155; }
.tmpl-main { flex: 1; height: 100%; background: #f8fafc; }

.tmpl-photo {
    width: 12px;
    height: 12px;
    background: #cbd5e1;
    border-radius: 50%;
    align-self: center;
    flex-shrink: 0;
}

.tmpl-preview.style-1 { position: relative; }
.tmpl-preview.style-1 .tmpl-photo { position: absolute; top: 6px; left: 6px; background: rgba(255,255,255,0.5); width: 10px; height: 10px; }
.tmpl-preview.style-1 .tmpl-header { background: var(--tmpl-color, #4f46e5); margin: 0; width: 100%; height: 22px; }

.tmpl-preview.style-2 { flex-direction: row; padding: 0; gap: 0; }
.tmpl-preview.style-2 .tmpl-side { background: var(--tmpl-color, #334155); display: flex; justify-content: center; padding-top: 6px; }
.tmpl-preview.style-2 .tmpl-side .tmpl-photo { background: rgba(255,255,255,0.4); }

.tmpl-preview.style-3 { position: relative; }
.tmpl-preview.style-3 .tmpl-photo { position: absolute; top: 6px; left: 6px; background: rgba(255,255,255,0.5); width: 8px; height: 8px; }
.tmpl-preview.style-3 .tmpl-header { background: var(--tmpl-color, #0f172a); width: 60%; align-self: flex-start; margin: 0; height: 20px; }

.tmpl-preview.style-4 .tmpl-header { background: transparent; border-bottom: 2px solid #cbd5e1; height: 4px; margin-top: 2px; }
.tmpl-preview.style-4 .tmpl-photo { width: 14px; height: 14px; margin-bottom: 2px; }

.tmpl-preview.style-5 { flex-direction: row; padding: 0; gap: 0; }
.tmpl-preview.style-5 .tmpl-side { background: var(--tmpl-color, #0ea5e9); display: flex; justify-content: center; padding-top: 6px; }
.tmpl-preview.style-5 .tmpl-side .tmpl-photo { background: rgba(255,255,255,0.4); }

.tmpl-preview.style-6 .tmpl-header { display: none; }
.tmpl-preview.style-6 .tmpl-photo { border: 2px solid var(--tmpl-color, #db2777); background: white; margin-bottom: 2px; }

/* =========================================
   DYNAMIC CV TEMPLATE STYLES
   ========================================= */

/* Default / Otago (Style 4) */
.cv-template[data-template="otago"] .cv-header { text-align: center; border-bottom: 2px solid #333; }
.cv-template[data-template="otago"] .cv-two-col { flex-direction: row; }

/* Auckland (Style 1) */
.cv-template[data-template="auckland"] { padding: 0; }
.cv-template[data-template="auckland"] .cv-header { text-align: left; background: #4f46e5; color: white; padding: 30px 40px; margin: 0; border: none; }
.cv-template[data-template="auckland"] .cv-header h1, .cv-template[data-template="auckland"] .cv-header h2 { color: white; }
.cv-template[data-template="auckland"] .cv-contact-info { color: #e0e7ff; justify-content: flex-start; }
.cv-template[data-template="auckland"] .cv-contact-info i { color: #e0e7ff; }
.cv-template[data-template="auckland"] .cv-section h3 { color: #4f46e5; border-bottom: 2px solid #e0e7ff; }
.cv-template[data-template="auckland"] .cv-two-col { flex-direction: row; padding: 0 40px 40px 40px; box-sizing: border-box; }

/* Edinburgh (Style 2) */
.cv-template[data-template="edinburgh"] { position: relative; padding: 0; display: flex; flex-direction: column; height: 1118px; }
.cv-template[data-template="edinburgh"] .cv-header { display: none; }
.cv-template[data-template="edinburgh"] .cv-two-col { display: flex; flex-direction: row-reverse; width: 100%; flex: 1; gap: 0; }
.cv-template[data-template="edinburgh"] .cv-col-side { width: 35%; background: #334155; color: white; padding: 40px 30px; box-sizing: border-box; }
.cv-template[data-template="edinburgh"] .cv-col-main { width: 65%; padding: 40px; box-sizing: border-box; }
.cv-template[data-template="edinburgh"] .cv-col-side h3 { color: white; border-bottom-color: #475569; }
.cv-template[data-template="edinburgh"] .cv-skills-list li { background: #475569; color: white; }

/* Princeton (Style 3) */
.cv-template[data-template="princeton"] .cv-header { text-align: left; background: #0f172a; color: white; padding: 30px; border-radius: 4px; border: none; }
.cv-template[data-template="princeton"] .cv-header h1, .cv-template[data-template="princeton"] .cv-header h2 { color: white; }
.cv-template[data-template="princeton"] .cv-contact-info { color: #cbd5e1; justify-content: flex-start; }
.cv-template[data-template="princeton"] .cv-contact-info i { color: #cbd5e1; }
.cv-template[data-template="princeton"] .cv-section h3 { color: #0f172a; border-bottom: 2px solid #0f172a; }

/* Berkeley (Style 5) */
.cv-template[data-template="berkeley"] { position: relative; padding: 0; display: flex; flex-direction: column; height: 1118px; }
.cv-template[data-template="berkeley"] .cv-header { display: none; }
.cv-template[data-template="berkeley"] .cv-two-col { display: flex; flex-direction: row-reverse; width: 100%; flex: 1; gap: 0; }
.cv-template[data-template="berkeley"] .cv-col-side { width: 35%; background: #0ea5e9; color: white; padding: 40px 30px; box-sizing: border-box; }
.cv-template[data-template="berkeley"] .cv-col-main { width: 65%; padding: 40px; box-sizing: border-box; }
.cv-template[data-template="berkeley"] .cv-col-side h3 { color: white; border-bottom-color: #38bdf8; }
.cv-template[data-template="berkeley"] .cv-skills-list li { background: #0284c7; color: white; }

/* Harvard (Style 6) */
.cv-template[data-template="harvard"] .cv-header { text-align: center; border: none; padding-top: 20px; }
.cv-template[data-template="harvard"] .cv-header h1 { color: #db2777; font-family: Georgia, serif; }
.cv-template[data-template="harvard"] .cv-section h3 { color: #db2777; text-align: center; border-bottom: 1px solid #db2777; }
.cv-template[data-template="harvard"] .cv-item-header strong { color: #db2777; }

/* Standford (Style 2 variant) */
.cv-template[data-template="standford"] { position: relative; padding: 0; display: flex; flex-direction: column; height: 1118px; }
.cv-template[data-template="standford"] .cv-header { display: none; }
.cv-template[data-template="standford"] .cv-two-col { display: flex; flex-direction: row-reverse; width: 100%; flex: 1; gap: 0; }
.cv-template[data-template="standford"] .cv-col-side { width: 35%; background: #0f766e; color: white; padding: 40px 30px; box-sizing: border-box; }
.cv-template[data-template="standford"] .cv-col-main { width: 65%; padding: 40px; box-sizing: border-box; }
.cv-template[data-template="standford"] .cv-col-side h3 { color: white; border-bottom-color: #14b8a6; }
.cv-template[data-template="standford"] .cv-skills-list li { background: #0f766e; border: 1px solid #5eead4; color: white; }

/* Cambridge (Style 1 variant) */
.cv-template[data-template="cambridge"] { padding: 0; }
.cv-template[data-template="cambridge"] .cv-header { text-align: left; background: #b91c1c; color: white; padding: 30px 40px; margin: 0; border: none; }
.cv-template[data-template="cambridge"] .cv-header h1, .cv-template[data-template="cambridge"] .cv-header h2 { color: white; }
.cv-template[data-template="cambridge"] .cv-contact-info { color: #fecaca; justify-content: flex-start; }
.cv-template[data-template="cambridge"] .cv-contact-info i { color: #fecaca; }
.cv-template[data-template="cambridge"] .cv-section h3 { color: #b91c1c; border-bottom: 2px solid #b91c1c; }
.cv-template[data-template="cambridge"] .cv-two-col { padding: 0 40px 40px 40px; box-sizing: border-box; }

/* Oxford (Style 3 variant) */
.cv-template[data-template="oxford"] { padding: 0; }
.cv-template[data-template="oxford"] .cv-header { text-align: center; background: #4338ca; color: white; padding: 30px 40px; border-radius: 0 0 20px 20px; margin: 0; border: none; }
.cv-template[data-template="oxford"] .cv-header h1, .cv-template[data-template="oxford"] .cv-header h2 { color: white; }
.cv-template[data-template="oxford"] .cv-contact-info { color: #c7d2fe; justify-content: center; }
.cv-template[data-template="oxford"] .cv-contact-info i { color: #c7d2fe; }
.cv-template[data-template="oxford"] .cv-section h3 { color: #4338ca; border-bottom: 2px solid #c7d2fe; }
.cv-template[data-template="oxford"] .cv-two-col { padding: 0 40px 40px 40px; box-sizing: border-box; }

/* Contact and Personal info in side column visibility */
.cv-template[data-template="edinburgh"] .cv-contact-side,
.cv-template[data-template="berkeley"] .cv-contact-side,
.cv-template[data-template="standford"] .cv-contact-side,
.cv-template[data-template="edinburgh"] .cv-personal-side,
.cv-template[data-template="berkeley"] .cv-personal-side,
.cv-template[data-template="standford"] .cv-personal-side {
    display: block !important;
}
.cv-template[data-template="edinburgh"] .cv-personal-main,
.cv-template[data-template="berkeley"] .cv-personal-main,
.cv-template[data-template="standford"] .cv-personal-main {
    display: none !important;
}
.cv-template[data-template="edinburgh"] .cv-contact-info-side span,
.cv-template[data-template="berkeley"] .cv-contact-info-side span,
.cv-template[data-template="standford"] .cv-contact-info-side span {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
}
.cv-template[data-template="edinburgh"] .cv-contact-info-side i,
.cv-template[data-template="berkeley"] .cv-contact-info-side i,
.cv-template[data-template="standford"] .cv-contact-info-side i,
.cv-template[data-template="edinburgh"] .cv-contact-info-side svg,
.cv-template[data-template="berkeley"] .cv-contact-info-side svg,
.cv-template[data-template="standford"] .cv-contact-info-side svg {
    width: 14px; height: 14px; opacity: 0.8;
}

/* =========================================
   PROFILE PHOTO STYLES
   ========================================= */
.cv-profile-img-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px auto;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    flex-shrink: 0; /* Prevents circular avatar from squishing in flex headers */
}
.cv-profile-img-wrapper img {
    display: block !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background-color: #ffffff; /* Prevents template background colors from bleeding through transparent images */
}

.cv-template:not(.has-photo) .cv-profile-img-wrapper {
    display: none !important;
}

/* Default: Photo is shown in header, hidden in side column */
.cv-col-side .cv-profile-img-wrapper {
    display: none !important;
}

/* Sidebar layouts (Edinburgh, Berkeley, Standford) */
.cv-template[data-template="edinburgh"] .cv-header .cv-profile-img-wrapper,
.cv-template[data-template="berkeley"] .cv-header .cv-profile-img-wrapper,
.cv-template[data-template="standford"] .cv-header .cv-profile-img-wrapper {
    display: none !important;
}
.cv-template[data-template="edinburgh"] .cv-col-side .cv-profile-img-wrapper,
.cv-template[data-template="berkeley"] .cv-col-side .cv-profile-img-wrapper,
.cv-template[data-template="standford"] .cv-col-side .cv-profile-img-wrapper {
    display: block !important;
    margin: 0 auto 20px auto;
    width: 140px;
    height: 140px;
}

/* Left-aligned Header Templates (Auckland, Cambridge, Princeton) */
.cv-template[data-template="auckland"] .cv-header,
.cv-template[data-template="cambridge"] .cv-header,
.cv-template[data-template="princeton"] .cv-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
}
.cv-template[data-template="auckland"] .cv-profile-img-wrapper,
.cv-template[data-template="cambridge"] .cv-profile-img-wrapper,
.cv-template[data-template="princeton"] .cv-profile-img-wrapper {
    margin: 0;
    width: 100px;
    height: 100px;
}
.cv-template[data-template="auckland"] .cv-header-text,
.cv-template[data-template="cambridge"] .cv-header-text,
.cv-template[data-template="princeton"] .cv-header-text {
    flex: 1;
}
.cv-template[data-template="auckland"] .cv-contact-info,
.cv-template[data-template="cambridge"] .cv-contact-info,
.cv-template[data-template="princeton"] .cv-contact-info {
    width: 100%;
    margin-top: -15px;
}

/* London (Style 1 variant) */
.cv-template[data-template="london"] { padding: 0; }
.cv-template[data-template="london"] .cv-header { text-align: left; background: #16a34a; color: white; padding: 30px 40px; margin: 0; border: none; }
.cv-template[data-template="london"] .cv-header h1, .cv-template[data-template="london"] .cv-header h2 { color: white; }
.cv-template[data-template="london"] .cv-contact-info { color: #bbf7d0; justify-content: flex-start; }
.cv-template[data-template="london"] .cv-contact-info i { color: #bbf7d0; }
.cv-template[data-template="london"] .cv-section h3 { color: #16a34a; border-bottom: 2px solid #16a34a; }
.cv-template[data-template="london"] .cv-two-col { padding: 0 40px 40px 40px; box-sizing: border-box; }

/* Tokyo (Style 3 variant) */
.cv-template[data-template="tokyo"] .cv-header { text-align: center; background: #ea580c; color: white; padding: 30px; border-radius: 4px; border: none; }
.cv-template[data-template="tokyo"] .cv-header h1, .cv-template[data-template="tokyo"] .cv-header h2 { color: white; }
.cv-template[data-template="tokyo"] .cv-contact-info { color: #ffedd5; justify-content: center; }
.cv-template[data-template="tokyo"] .cv-contact-info i { color: #ffedd5; }
.cv-template[data-template="tokyo"] .cv-section h3 { color: #ea580c; border-bottom: 2px solid #fdba74; }

/* Berlin (Style 2 variant) */
.cv-template[data-template="berlin"] { position: relative; padding: 0; display: flex; flex-direction: column; height: 1118px; }
.cv-template[data-template="berlin"] .cv-header { display: none; }
.cv-template[data-template="berlin"] .cv-two-col { display: flex; flex-direction: row-reverse; width: 100%; flex: 1; gap: 0; }
.cv-template[data-template="berlin"] .cv-col-side { width: 35%; background: #4338ca; color: white; padding: 40px 30px; box-sizing: border-box; }
.cv-template[data-template="berlin"] .cv-col-main { width: 65%; padding: 40px; box-sizing: border-box; }
.cv-template[data-template="berlin"] .cv-col-side h3 { color: white; border-bottom-color: #6366f1; }
.cv-template[data-template="berlin"] .cv-skills-list li { background: #4f46e5; border: 1px solid #818cf8; color: white; }

/* Paris (Style 5 variant) */
.cv-template[data-template="paris"] { position: relative; padding: 0; display: flex; flex-direction: column; height: 1118px; }
.cv-template[data-template="paris"] .cv-header { display: none; }
.cv-template[data-template="paris"] .cv-two-col { display: flex; flex-direction: row-reverse; width: 100%; flex: 1; gap: 0; }
.cv-template[data-template="paris"] .cv-col-side { width: 35%; background: #ec4899; color: white; padding: 40px 30px; box-sizing: border-box; }
.cv-template[data-template="paris"] .cv-col-main { width: 65%; padding: 40px; box-sizing: border-box; }
.cv-template[data-template="paris"] .cv-col-side h3 { color: white; border-bottom-color: #f472b6; }
.cv-template[data-template="paris"] .cv-skills-list li { background: #db2777; color: white; }

/* Rome (Style 4 variant) */
.cv-template[data-template="rome"] .cv-header { text-align: center; border-bottom: 3px solid #f59e0b; }
.cv-template[data-template="rome"] .cv-two-col { flex-direction: row; }
.cv-template[data-template="rome"] .cv-section h3 { border-bottom: 1px dashed #f59e0b; color: #b45309; }

/* Sydney (Style 6 variant) */
.cv-template[data-template="sydney"] .cv-header { text-align: center; border: none; padding-top: 20px; }
.cv-template[data-template="sydney"] .cv-header h1 { color: #8b5cf6; font-family: 'Inter', sans-serif; letter-spacing: 3px; }
.cv-template[data-template="sydney"] .cv-section h3 { color: #8b5cf6; text-align: center; border-bottom: 1px solid #8b5cf6; }
.cv-template[data-template="sydney"] .cv-item-header strong { color: #8b5cf6; }

/* Visibility for new sidebar templates */
.cv-template[data-template="berlin"] .cv-contact-side,
.cv-template[data-template="paris"] .cv-contact-side,
.cv-template[data-template="berlin"] .cv-personal-side,
.cv-template[data-template="paris"] .cv-personal-side { display: block !important; }
.cv-template[data-template="berlin"] .cv-personal-main,
.cv-template[data-template="paris"] .cv-personal-main { display: none !important; }
.cv-template[data-template="berlin"] .cv-contact-info-side span,
.cv-template[data-template="paris"] .cv-contact-info-side span { display: inline-flex !important; align-items: center; gap: 5px; }
.cv-template[data-template="berlin"] .cv-contact-info-side i,
.cv-template[data-template="paris"] .cv-contact-info-side i,
.cv-template[data-template="berlin"] .cv-contact-info-side svg,
.cv-template[data-template="paris"] .cv-contact-info-side svg { width: 14px; height: 14px; opacity: 0.8; }

/* Photo visibility for new templates */
.cv-template[data-template="berlin"] .cv-header .cv-profile-img-wrapper,
.cv-template[data-template="paris"] .cv-header .cv-profile-img-wrapper { display: none !important; }
.cv-template[data-template="berlin"] .cv-col-side .cv-profile-img-wrapper,
.cv-template[data-template="paris"] .cv-col-side .cv-profile-img-wrapper { display: block !important; margin: 0 auto 20px auto; width: 140px; height: 140px; }
.cv-template[data-template="london"] .cv-header,
.cv-template[data-template="tokyo"] .cv-header { display: flex; flex-wrap: wrap; align-items: center; gap: 30px; }
.cv-template[data-template="london"] .cv-profile-img-wrapper,
.cv-template[data-template="tokyo"] .cv-profile-img-wrapper { margin: 0; width: 100px; height: 100px; }
.cv-template[data-template="london"] .cv-header-text,
.cv-template[data-template="tokyo"] .cv-header-text { flex: 1; }
.cv-template[data-template="london"] .cv-contact-info,
.cv-template[data-template="tokyo"] .cv-contact-info { width: 100%; margin-top: -15px; }

/* =========================================================================
   NEW STRUCTURALLY DISTINCT LAYOUTS (Milano, Tokyo Tech, Geneva)
   ========================================================================= */

/* 1. Milano Layout (Style Creative - Right Sidebar, Dark/Indigo Theme) */
.cv-template[data-template="milano"] { position: relative; padding: 0; display: flex; flex-direction: column; height: 1118px; }
.cv-template[data-template="milano"] .cv-header { display: none; }
.cv-template[data-template="milano"] .cv-two-col { display: flex; flex-direction: row; width: 100%; flex: 1; gap: 0; }
.cv-template[data-template="milano"] .cv-col-side { width: 33%; background: #1e1b4b; color: white; padding: 40px 25px; box-sizing: border-box; }
.cv-template[data-template="milano"] .cv-col-main { width: 67%; padding: 40px; box-sizing: border-box; }
.cv-template[data-template="milano"] .cv-col-side h3 { color: #c7d2fe; border-bottom: 2px solid #4338ca; padding-bottom: 8px; margin-bottom: 15px; }
.cv-template[data-template="milano"] .cv-skills-list li { background: #312e81; color: #c7d2fe; border: 1px solid #4338ca; }
.cv-template[data-template="milano"] .cv-contact-side,
.cv-template[data-template="milano"] .cv-personal-side { display: block !important; }
.cv-template[data-template="milano"] .cv-personal-main { display: none !important; }
.cv-template[data-template="milano"] .cv-contact-info-side span { display: inline-flex !important; align-items: center; gap: 8px; color: #cbd5e1; font-size: 12px; }
.cv-template[data-template="milano"] .cv-contact-info-side i,
.cv-template[data-template="milano"] .cv-contact-info-side svg { color: #818cf8; width: 14px; height: 14px; }
.cv-template[data-template="milano"] .cv-col-side .cv-profile-img-wrapper { display: block !important; margin: 0 auto 20px auto; width: 120px; height: 120px; }

/* 2. Tokyo Tech Layout (Style Tech Grid - Monospace Accents, Left Accent Blocks, Single Column Stacking) */
.cv-template[data-template="tokyotech"] { padding: 40px; background: #fafafa; }
.cv-template[data-template="tokyotech"] .cv-header { text-align: left; border-bottom: 4px solid #0f172a; padding-bottom: 15px; margin-bottom: 25px; display: flex; align-items: center; gap: 20px; }
.cv-template[data-template="tokyotech"] .cv-header h1 { font-family: monospace; font-weight: 800; font-size: 32px; letter-spacing: -1px; color: #0f172a; }
.cv-template[data-template="tokyotech"] .cv-header h2 { font-family: monospace; font-weight: 600; color: #4f46e5; /* text-transform: uppercase; commented out for PDF rendering safety */ font-size: 15px; }
.cv-template[data-template="tokyotech"] .cv-contact-info { justify-content: flex-start; gap: 20px; border: 1px solid #e2e8f0; background: white; padding: 10px 15px; border-radius: 4px; }
.cv-template[data-template="tokyotech"] .cv-two-col { display: flex; flex-direction: column; gap: 25px; }
.cv-template[data-template="tokyotech"] .cv-col-main { width: 100%; }
.cv-template[data-template="tokyotech"] .cv-col-side { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; border-top: 1px solid #e2e8f0; padding-top: 20px; }
.cv-template[data-template="tokyotech"] .cv-col-side .cv-section { margin-bottom: 0; }
.cv-template[data-template="tokyotech"] .cv-section h3 { font-family: monospace; font-size: 14px; font-weight: 700; background: #0f172a; color: white; padding: 6px 12px; border-left: 4px solid #4f46e5; border-bottom: none; display: inline-block; width: auto; margin-bottom: 15px; border-radius: 0 4px 4px 0; }
.cv-template[data-template="tokyotech"] .cv-skills-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.cv-template[data-template="tokyotech"] .cv-skills-list li { background: white; border: 1px solid #e2e8f0; margin-bottom: 0; font-family: monospace; font-size: 12px; }
.cv-template[data-template="tokyotech"] .cv-item { border-left: 2px solid #e2e8f0; padding-left: 15px; margin-left: 5px; }
.cv-template[data-template="tokyotech"] .cv-item-header strong { font-family: monospace; font-size: 14px; }
.cv-template[data-template="tokyotech"] .cv-profile-img-wrapper { margin: 0; width: 90px; height: 90px; border-radius: 4px; border: 2px solid #0f172a; }

/* 3. Geneva Layout (Style Executive - Classic Centered Elegant Serif, Thin Column Split) */
.cv-template[data-template="geneva"] { padding: 45px; font-family: 'Georgia', serif; }
.cv-template[data-template="geneva"] .cv-header { text-align: center; border-bottom: 1px solid #475569; padding-bottom: 15px; margin-bottom: 25px; }
.cv-template[data-template="geneva"] .cv-header h1 { font-family: 'Georgia', serif; font-weight: 400; font-size: 32px; color: #1e293b; /* text-transform: capitalize; commented out for PDF rendering safety */ }
.cv-template[data-template="geneva"] .cv-header h2 { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 14px; color: #475569; /* text-transform: uppercase; commented out for PDF rendering safety */ letter-spacing: 2px; margin-top: 5px; }
.cv-template[data-template="geneva"] .cv-contact-info { justify-content: center; font-family: 'Inter', sans-serif; gap: 15px; font-size: 12px; color: #64748b; }
.cv-template[data-template="geneva"] .cv-two-col { display: block; width: 100%; }
.cv-template[data-template="geneva"] .cv-two-col::after { content: ""; display: table; clear: both; }
.cv-template[data-template="geneva"] .cv-col-side { float: left; width: 30%; border-right: 1px solid #cbd5e1; padding-right: 25px; box-sizing: border-box; }
.cv-template[data-template="geneva"] .cv-col-main { float: right; width: 70%; padding-left: 30px; box-sizing: border-box; }
.cv-template[data-template="geneva"] .cv-section h3 { font-family: 'Georgia', serif; font-size: 14px; font-weight: bold; /* text-transform: uppercase; commented out for PDF rendering safety */ border-bottom: 1px solid #475569; padding-bottom: 4px; color: #1e293b; letter-spacing: 0.5px; }
.cv-template[data-template="geneva"] .cv-item-header strong { font-family: 'Georgia', serif; font-size: 14px; color: #0f172a; }
.cv-template[data-template="geneva"] .cv-item-header span { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; }
.cv-template[data-template="geneva"] .cv-skills-list li { background: none; border-bottom: 1px solid #e2e8f0; border-radius: 0; padding: 4px 0; font-family: 'Inter', sans-serif; font-size: 12px; color: #475569; }
.cv-template[data-template="geneva"] .cv-contact-side,
.cv-template[data-template="geneva"] .cv-personal-side { display: block !important; }
.cv-template[data-template="geneva"] .cv-personal-main { display: none !important; }
.cv-template[data-template="geneva"] .cv-contact-info-side span { display: inline-flex !important; align-items: center; gap: 8px; font-family: 'Inter', sans-serif; font-size: 12px; color: #475569; }
.cv-template[data-template="geneva"] .cv-contact-info-side i,
.cv-template[data-template="geneva"] .cv-contact-info-side svg { color: #475569; width: 13px; height: 13px; }
.cv-template[data-template="geneva"] .cv-header .cv-profile-img-wrapper { display: block !important; margin: 0 auto 20px auto; width: 110px; height: 110px; border-radius: 50%; }
.cv-template[data-template="geneva"] .cv-col-side .cv-profile-img-wrapper { display: none !important; }

/* Sidebar Header styling for real HTML nodes */
.cv-side-header {
    display: none;
    margin-bottom: 25px;
    width: 100%;
}

.cv-template[data-template="edinburgh"] .cv-side-header,
.cv-template[data-template="berkeley"] .cv-side-header,
.cv-template[data-template="standford"] .cv-side-header,
.cv-template[data-template="berlin"] .cv-side-header,
.cv-template[data-template="paris"] .cv-side-header,
.cv-template[data-template="milano"] .cv-side-header {
    display: block !important;
}

.outFullNameSide {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1.2;
}

.outTitleSide {
    font-size: 14px;
    margin-bottom: 0;
    font-weight: normal;
}

/* Colors for specific sidebar headers */
.cv-template[data-template="edinburgh"] .outFullNameSide,
.cv-template[data-template="berkeley"] .outFullNameSide,
.cv-template[data-template="standford"] .outFullNameSide,
.cv-template[data-template="berlin"] .outFullNameSide,
.cv-template[data-template="paris"] .outFullNameSide {
    color: white;
}

.cv-template[data-template="milano"] .outFullNameSide {
    color: white;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.cv-template[data-template="edinburgh"] .outTitleSide { color: #94a3b8; }
.cv-template[data-template="berkeley"] .outTitleSide { color: #bae6fd; }
.cv-template[data-template="standford"] .outTitleSide { color: #99f6e4; }
.cv-template[data-template="berlin"] .outTitleSide { color: #c7d2fe; }
.cv-template[data-template="paris"] .outTitleSide { color: #fbcfe8; }
.cv-template[data-template="milano"] .outTitleSide { color: #a5b4fc; font-weight: 500; /* text-transform: uppercase; commented out for PDF rendering safety */ font-size: 13px; }

/* =========================================
   PROFILE PHOTO EDITOR
   ========================================= */
.profile-photo-editor {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.5rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.profile-photo-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #e2e8f0;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border);
    flex-shrink: 0;
}

.profile-photo-preview .placeholder-icon {
    width: 28px;
    height: 28px;
}

.profile-photo-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-upload {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    margin: 0;
}

.btn-upload:hover {
    background: var(--bg);
    border-color: var(--secondary);
}

.btn-remove-photo {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: var(--danger);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-remove-photo:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.cv-item-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.cv-item-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* =========================================
   PROFESSIONAL VECTOR PDF PRINT STYLING
   ========================================= */
@media print {
    /* Reset margins and hide scrollbars */
    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 100% !important;
        overflow: hidden !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide all workspace panels, sidebars, editor controls, actions, and toast notifications */
    .top-navbar,
    .sidebar,
    .editor-panel,
    .preview-header-inline,
    #toast,
    .preview-panel > *:not(.cv-template-wrapper) {
        display: none !important;
    }

    /* Unroll preview panel container to act as a transparent wrapper */
    .app-layout,
    .workspace,
    .editor-preview-container,
    .preview-panel {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Target the A4 wrapper container */
    .cv-template-wrapper {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        overflow: hidden !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        page-break-inside: avoid !important;
    }

    /* Format the template container to exactly fit standard A4 paper size */
    .cv-template {
        width: 210mm !important;
        height: 297mm !important;
        box-shadow: none !important;
        margin: 0 !important;
        border: none !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Define page properties for A4 sheet with 0 margin to hide default browser headers/footers */
    @page {
        size: A4 portrait;
        margin: 0;
    }
}
