/* Base, Header, Form, Button, Tabs, etc. Styles */
:root { --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; --primary-color: #3b82f6; --primary-color-dark: #2563eb; --light-bg: #f7faff; --card-bg: #ffffff; --border-color: #e5e7eb; --text-primary: #111827; --text-secondary: #6b7280; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-sans); }
body { background-color: var(--light-bg); color: var(--text-primary); line-height: 1.6; }
header { background-color: var(--card-bg); border-bottom: 1px solid var(--border-color); padding: 1.5rem 0; text-align: center; }
.gradient-text { background: linear-gradient(to right, #8b5cf6, #3b82f6); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: bold; font-size: 2rem; }
.subtitle { color: var(--text-secondary); margin-top: 0.5rem; }
.container { max-width: 1400px; margin: 0 auto; padding: 2rem 1rem; }
.tabs { display: flex; justify-content: center; margin-bottom: 2rem; }
.tab-list { display: flex; padding: 0.3rem; background-color: #e2e8f0; border-radius: 0.75rem; box-shadow: inset 0 2px 4px rgba(0,0,0,0.06); }
.tab-trigger { flex: 1; padding: 0.75rem 1.5rem; text-align: center; border-radius: 0.5rem; cursor: pointer; font-weight: 600; color: #475569; background: transparent; border: none; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.tab-trigger:hover:not(.active) { color: var(--primary-color); background-color: #eef2ff; }
.tab-trigger.active { background-color: var(--card-bg); color: var(--primary-color); box-shadow: 0 4px 14px 0 rgba(0,0,0,0.1), 0 2px 4px 0 rgba(0,0,0,0.06); transform: translateY(-2px); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.card { background-color: var(--card-bg); border-radius: 0.75rem; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); border: 1px solid var(--border-color); margin-bottom: 1.5rem; padding: 1.5rem; }
.card-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--text-primary); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.full-width-card { grid-column: 1 / -1; }
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.875rem; color: #374151; }
.form-input, .form-textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 0.375rem; font-size: 0.875rem; background-color: #f9fafb; transition: all 0.2s ease; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--primary-color); background-color: white; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.form-textarea { resize: vertical; }
.btn-outline { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); padding: 0.5rem 1rem; border-radius: 0.375rem; cursor: pointer; font-weight: 500; transition: all 0.2s ease; }
.btn-outline:hover { background-color: var(--light-bg); border-color: #bfdbfe; color: var(--primary-color); }
.btn-danger { color: #ef4444; background-color: transparent; border: none; cursor: pointer; padding: 0.25rem; border-radius: 50%; }
.btn-danger:hover { background-color: #fee2e2; }
.dynamic-entry { position: relative; padding: 1rem; border: 1px solid #e2e8f0; border-radius: 0.25rem; background-color: #f8fafc; margin-bottom: 1rem; }
.remove-btn { position: absolute; top: 0.5rem; right: 0.5rem; }
.preview-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.preview-sidebar { flex: 0 0 280px; }
.preview-main { flex: 1; }
#resume-wrapper { background-color: #dbeafe; border-radius: 0.5rem; padding: 2rem; overflow-x: auto; }
.export-buttons { display: flex; justify-content: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.template-selector-vertical { display: flex; flex-direction: column; gap: 0.5rem; }
.template-selector-vertical .template-option { padding: 0.75rem; border: 1px solid transparent; border-radius: 0.375rem; cursor: pointer; transition: all 0.2s; text-align: left; font-weight: 500; }
.template-selector-vertical .template-option:hover { background-color: #eff6ff; }
.template-selector-vertical .template-option input[type="radio"] { display: none; }
.template-selector-vertical .template-option.active { border-color: #bfdbfe; background-color: #dbeafe; color: var(--primary-color-dark); font-weight: 600; }
footer { background-color: transparent; border-top: 1px solid var(--border-color); padding: 2rem 0; margin-top: 2rem; text-align: center; color: var(--text-secondary); font-size: 0.875rem; }
.icon { width: 1.25em; height: 1.25em; vertical-align: middle; margin-right: 0.5em; }

/* --- NEW Export Button Styles --- */
.btn-export {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: linear-gradient(to right, #8b5cf6, #3b82f6);
    color: white;
    box-shadow: 0 4px 15px -3px rgba(59, 130, 246, 0.4);
}
.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px -3px rgba(59, 130, 246, 0.5);
}

/* --- A4 Paper Base Styling --- */
.resume { width: 210mm; min-height: 297mm; margin: 0 auto; background-color: white; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); border: none; font-family: var(--font-sans); color: #333; }
.photo-placeholder { display: flex; align-items: center; justify-content: center; background-color: #e2e8f0; border: 2px dashed #94a3b8; color: #64748b; text-align: center; font-size: 3.5mm; }

/* --- TEMPLATE 1: Modern Sidebar --- */
.template-modern-sidebar { display: flex; }
.template-modern-sidebar .ms-left { width: 70mm; background-color: #192a56; color: white; padding: 15mm 10mm; }
.template-modern-sidebar .ms-right { width: 140mm; padding: 15mm; }
.template-modern-sidebar .ms-photo { width: 40mm; height: 40mm; border-radius: 50%; object-fit: cover; margin: 0 auto 5mm; display: block; }
.template-modern-sidebar .ms-photo-placeholder { width: 40mm; height: 40mm; border-radius: 50%; margin: 0 auto 5mm; }
.template-modern-sidebar .ms-name { font-size: 6mm; text-align: center; margin-bottom: 8mm; }
.template-modern-sidebar .ms-section-title { font-size: 4.5mm; font-weight: 600; border-bottom: 0.5mm solid rgba(255,255,255,0.3); padding-bottom: 1mm; margin-bottom: 3mm; }
.template-modern-sidebar .ms-right .ms-section-title { color: #192a56; border-bottom-color: #e2e8f0; }
.template-modern-sidebar .ms-entry-title { font-weight: 600; font-size: 4mm; }

/* --- TEMPLATE 2: Blue Minimalist --- */
.template-blue-minimalist { padding: 15mm; font-size: 11pt; }
.template-blue-minimalist .bm-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #003366; padding-bottom: 5mm; }
.template-blue-minimalist .bm-name-title h1 { font-size: 28pt; color: #003366; }
.template-blue-minimalist .bm-section-title { font-size: 14pt; color: #003366; border-bottom: 1px solid #a8b2c1; padding-bottom: 2mm; margin-bottom: 3mm; text-transform: uppercase; letter-spacing: 1px;}

/* --- TEMPLATE 3: Graphic Designer --- */
.template-graphic-designer { display: flex; font-family: 'Montserrat', sans-serif; }
.template-graphic-designer .gd-left { width: 75mm; background-color: #f3f4f6; padding: 15mm; }
.template-graphic-designer .gd-right { width: 135mm; padding: 15mm; }
.template-graphic-designer .gd-photo { width: 40mm; height: 40mm; border-radius: 50%; object-fit: cover; margin: 0 auto 8mm; display: block; }
.template-graphic-designer .gd-photo-placeholder { width: 40mm; height: 40mm; border-radius: 50%; margin: 0 auto 8mm;}
.template-graphic-designer .gd-name { font-size: 9mm; font-weight: 800; }
.template-graphic-designer .gd-title { color: #3b82f6; }