/* style.css - CV Builder Web App Stylesheet */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300&family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

/* --- Custom Variables & Design System --- */
:root {
  /* UI Colors (Dark Modern Dashboard) */
  --bg-primary: #0b0f19;
  --bg-secondary: #161e31;
  --bg-glass: rgba(22, 30, 49, 0.7);
  --bg-glass-hover: rgba(29, 39, 64, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-focus: rgba(99, 102, 241, 0.5);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Accent Colors (Dynamic in Practice, Default Indigo) */
  --color-accent: #6366f1;
  --color-accent-hover: #4f46e5;
  --color-accent-rgb: 99, 102, 241;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;

  /* Font Families */
  --font-ui: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-cv-sans: 'Inter', system-ui, sans-serif;
  --font-cv-serif: 'Merriweather', Georgia, serif;
  --font-cv-mono: 'JetBrains Mono', monospace;

  /* General Settings */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(255, 255, 255, 0.05);
  
  /* CV Preview Constants (A4 dimensions at 96 DPI) */
  --cv-width: 210mm;
  --cv-height: 297mm;
  --cv-scale: 1; /* Set dynamically via JS */
}

/* --- Base Resets & Layout --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-glass) transparent;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition-smooth);
}
a:hover {
  color: var(--color-accent-hover);
}

/* --- Layout Grid --- */
.app-container {
  display: grid;
  grid-template-columns: 480px 1fr;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    overflow: visible;
  }
}

/* --- Editor Sidebar Panel --- */
.editor-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

@media (max-width: 1024px) {
  .editor-panel {
    height: auto;
    max-height: 80vh;
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
  }
}

.editor-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--color-accent), #a855f7);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.logo-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: #fff;
}

.logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  background: linear-gradient(to right, #fff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem;
  margin: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.tab-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Form Sections Viewports */
.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

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

/* Accordion sections */
.form-section {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  margin-bottom: 1.25rem;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.form-section:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.section-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  user-select: none;
  transition: var(--transition-smooth);
}

.section-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.section-title svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: var(--color-accent);
}

.section-arrow {
  width: 1rem;
  height: 1rem;
  fill: var(--text-secondary);
  transition: transform 0.3s ease;
}

.form-section.expanded .section-arrow {
  transform: rotate(180deg);
}

.section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 1.25rem;
}

.form-section.expanded .section-content {
  max-height: 2000px;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-glass);
}

/* --- Form Fields & Inputs --- */
.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
textarea,
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Dynamic Item lists */
.dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
  transition: var(--transition-smooth);
}

.list-item-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.card-remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  border: none;
  color: var(--color-danger);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.card-remove-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ff6b6b;
}

.card-remove-btn svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
}

.btn-add-item {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-accent);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: 8px;
  padding: 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  width: 100%;
  transition: var(--transition-smooth);
  margin-top: 0.5rem;
}

.btn-add-item:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--color-accent);
}

.btn-add-item svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* Image Upload Container */
.image-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

.avatar-preview {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-glass);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.upload-btn-label {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.upload-btn-label:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

/* Theme / Customizer Grid */
.style-control-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.picker-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.color-dot-picker {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition-smooth);
  position: relative;
}

.color-dot.active {
  border-color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.color-picker-input-wrapper {
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-glass);
}

.color-picker-input-wrapper input[type="color"] {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 40px;
  height: 40px;
  border: none;
  cursor: pointer;
}

.range-slider-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.range-slider-group input[type="range"] {
  flex: 1;
  accent-color: var(--color-accent);
}

.range-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  min-width: 2rem;
  text-align: right;
}

/* Layout selection cards */
.layout-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.layout-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
}

.layout-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.layout-card.active {
  border-color: var(--color-accent);
  background: rgba(99, 102, 241, 0.08);
}

.layout-card-preview {
  height: 60px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  display: flex;
  padding: 4px;
  gap: 4px;
}

.layout-card-name {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Miniature layout visual representations */
.layout-card-preview.minimalist {
  flex-direction: column;
}
.layout-card-preview.minimalist .line {
  background: #4b5563; height: 3px; border-radius: 1px; width: 80%;
}
.layout-card-preview.minimalist .line:nth-child(1) { width: 40%; height: 6px; background: var(--color-accent); margin-bottom: 4px; }
.layout-card-preview.minimalist .line:nth-child(2) { width: 90%; }

.layout-card-preview.executive {
  flex-direction: column;
  align-items: center;
}
.layout-card-preview.executive .line {
  background: #4b5563; height: 3px; border-radius: 1px; width: 70%;
}
.layout-card-preview.executive .line:nth-child(1) { width: 30%; height: 5px; background: var(--color-accent); margin-bottom: 4px; }
.layout-card-preview.executive .grid-mini {
  display: grid; grid-template-columns: 2fr 1fr; gap: 4px; width: 100%; margin-top: 4px;
}
.layout-card-preview.executive .col-l, .layout-card-preview.executive .col-r {
  display: flex; flex-direction: column; gap: 2px;
}
.layout-card-preview.executive .col-l .block-mini { background: #4b5563; height: 3px; }
.layout-card-preview.executive .col-r .block-mini { background: #374151; height: 3px; }

.layout-card-preview.creative {
  display: grid;
  grid-template-columns: 1fr 2fr;
  padding: 0;
}
.layout-card-preview.creative .side {
  background: var(--color-accent); height: 100%; border-radius: 4px 0 0 4px;
}
.layout-card-preview.creative .body {
  padding: 4px; display: flex; flex-direction: column; gap: 3px;
}
.layout-card-preview.creative .body .line { background: #4b5563; height: 3px; border-radius: 1px; width: 85%; }

.layout-card-preview.serif {
  flex-direction: column;
  padding: 6px;
}
.layout-card-preview.serif .line { background: #4b5563; height: 2px; width: 100%; }
.layout-card-preview.serif .line:nth-child(1) { height: 4px; background: #9ca3af; width: 50%; align-self: center; margin-bottom: 4px;}

/* Panel Actions/Footer */
.editor-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-glass);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
}

.editor-footer-full {
  grid-column: span 2;
}

.btn-primary, .btn-secondary, .btn-danger {
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  font-family: var(--font-ui);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(var(--color-accent-rgb), 0.25);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 6px 16px rgba(var(--color-accent-rgb), 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--color-danger);
}

.btn-primary svg, .btn-secondary svg, .btn-danger svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* --- Preview Area Panel --- */
.preview-panel {
  background: #111827;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 3rem 1.5rem;
  position: relative;
  height: 100vh;
}

@media (max-width: 1024px) {
  .preview-panel {
    height: auto;
    min-height: 80vh;
    padding: 1.5rem;
  }
}

/* Live CV Container sizing */
.cv-page-wrapper {
  transform-origin: top center;
  transition: transform 0.2s ease-out;
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

/* Raw CV A4 Paper Styles */
.cv-page {
  width: var(--cv-width);
  min-height: var(--cv-height);
  background-color: #ffffff;
  color: #1f2937;
  padding: 20mm;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
  font-size: 10.5pt;
  line-height: 1.5;
  position: relative;
  text-align: left;
}

/* --- CV Templates & Layouts --- */

/* Template Common Parts */
.cv-section-title {
  font-size: 11pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--cv-accent, #111827);
  margin-bottom: 0.6rem;
  border-bottom: 1.5px solid var(--cv-accent, #e5e7eb);
  padding-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cv-section {
  margin-bottom: 1.25rem;
}

.cv-header-title {
  font-weight: 800;
  font-size: 24pt;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: #111827;
}

.cv-header-subtitle {
  font-size: 12pt;
  font-weight: 500;
  color: var(--cv-accent, #4b5563);
  margin-top: 0.2rem;
  letter-spacing: 0.5px;
}

.cv-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-size: 8.5pt;
  color: #4b5563;
}

.cv-contact-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cv-contact-item svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: currentColor;
}

.cv-summary {
  font-size: 9.5pt;
  color: #374151;
  margin-bottom: 1rem;
}

/* Dynamic Cards inside CV */
.cv-timeline-item {
  margin-bottom: 0.75rem;
}

.cv-timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.2rem;
}

.cv-timeline-role {
  font-weight: 700;
  font-size: 10pt;
  color: #111827;
}

.cv-timeline-company {
  font-weight: 500;
  font-size: 9.5pt;
  color: var(--cv-accent, #4b5563);
}

.cv-timeline-date {
  font-size: 8.5pt;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}

.cv-timeline-desc {
  font-size: 9pt;
  color: #4b5563;
  margin-top: 0.25rem;
  white-space: pre-line;
}

/* Skills Layout tags/list */
.cv-skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cv-skill-tag {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 8.5pt;
  color: #374151;
  border: 1px solid #e5e7eb;
  font-weight: 500;
}

/* Language lists */
.cv-langs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cv-lang-item {
  font-size: 9pt;
  color: #374151;
}

.cv-lang-item span {
  color: #6b7280;
  font-size: 8.5pt;
  margin-left: 0.25rem;
}

/* --- Specific Templates Customizations --- */

/* Template 1: Minimalist */
.cv-page.tmpl-minimalist {
  font-family: var(--font-cv-sans);
}
.cv-page.tmpl-minimalist .cv-header-standard {
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #111827;
  padding-bottom: 1rem;
}
.cv-page.tmpl-minimalist .cv-header-title {
  font-size: 26pt;
}

/* Template 2: Executive (Centered Header, Double column sections) */
.cv-page.tmpl-executive {
  font-family: var(--font-cv-sans);
}

.cv-page.tmpl-executive .cv-header-standard {
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px double var(--cv-accent, #9ca3af);
  padding-bottom: 1rem;
}
.cv-page.tmpl-executive .cv-header-standard > div {
  flex-direction: column;
  align-items: center !important;
  text-align: center;
}
.cv-page.tmpl-executive .cv-header-standard .cv-contacts {
  justify-content: center;
}

.cv-page.tmpl-executive .cv-body-grid {
  display: grid;
  grid-template-columns: 2.3fr 1fr;
  gap: 1.5rem;
}

.cv-page.tmpl-executive .cv-section-title {
  border-bottom: 1.5px solid #111827;
}

/* --- Global Avatar & Header Display Toggles --- */
.cv-header-standard {
  display: block;
}
.cv-header-creative {
  display: none;
}

.cv-avatar-holder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2.5px solid var(--cv-accent, #e5e7eb);
  overflow: hidden;
  display: block;
  flex-shrink: 0;
  background-color: #f3f4f6;
}

.cv-avatar-holder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Template 3: Creative Slate (Sidebar Layout via Flexbox Order) */
.cv-page.tmpl-creative {
  font-family: var(--font-cv-sans);
  padding: 0 !important;
  display: flex !important;
}

.cv-page.tmpl-creative .cv-header-standard {
  display: none !important;
}

.cv-page.tmpl-creative .cv-header-creative {
  display: block;
  margin-bottom: 1.5rem;
}

.cv-page.tmpl-creative .cv-body-grid {
  display: flex !important;
  width: 100%;
  min-height: inherit;
}

.cv-page.tmpl-creative .cv-col-side {
  order: 1;
  background-color: #1f2937;
  color: #f3f4f6;
  width: 33%;
  padding: 20mm 6mm 20mm 8mm;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
}

.cv-page.tmpl-creative .cv-col-side .cv-section-title {
  color: #fff;
  border-bottom: 1px solid #4b5563;
}

.cv-page.tmpl-creative .cv-col-side .cv-contacts {
  flex-direction: column;
  color: #d1d5db;
}

.cv-page.tmpl-creative .cv-col-side .cv-contact-item svg {
  fill: var(--cv-accent, #6366f1);
}

.cv-page.tmpl-creative .cv-col-main {
  order: 2;
  width: 67%;
  padding: 20mm 8mm 20mm 6mm;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-sizing: border-box;
}

.cv-page.tmpl-creative .cv-col-side .cv-avatar-holder {
  border: 3px solid var(--cv-accent, #6366f1);
  margin-bottom: 0.5rem;
}

.cv-page.tmpl-creative .cv-header-creative .cv-header-title {
  color: #ffffff;
  font-size: 18pt;
}

.cv-page.tmpl-creative .cv-header-creative .cv-header-subtitle {
  color: var(--cv-accent, #a5b4fc);
  font-size: 10pt;
}

.cv-page.tmpl-creative .cv-skill-tag {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f3f4f6;
}

.cv-page.tmpl-creative .cv-col-side .cv-lang-item {
  color: #e5e7eb;
}

/* Template 4: Elegant Serif (Classic styled layout) */
.cv-page.tmpl-serif {
  font-family: var(--font-cv-serif);
  line-height: 1.6;
}

.cv-page.tmpl-serif .cv-header-standard {
  border-bottom: 1px solid #111827;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.cv-page.tmpl-serif .cv-header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26pt;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.cv-page.tmpl-serif .cv-header-subtitle {
  font-style: italic;
  font-size: 11pt;
}

.cv-page.tmpl-serif .cv-section-title {
  font-family: 'Playfair Display', Georgia, serif;
  border-bottom: 1px solid #4b5563;
  text-transform: none;
  font-size: 13pt;
  font-weight: 600;
}

.cv-page.tmpl-serif .cv-skill-tag {
  background: transparent;
  border: none;
  padding: 0;
  font-style: italic;
}

.cv-page.tmpl-serif .cv-skill-tag::after {
  content: " \2022";
  margin-left: 0.4rem;
  color: var(--cv-accent, #6b7280);
}

.cv-page.tmpl-serif .cv-skill-tag:last-child::after {
  content: "";
}

/* --- Font Family Selectors --- */
.font-sans { font-family: var(--font-cv-sans) !important; }
.font-serif { font-family: var(--font-cv-serif) !important; }
.font-mono { font-family: var(--font-cv-mono) !important; }

/* Font Size Modifiers */
.font-sz-sm { font-size: 9.5pt !important; }
.font-sz-md { font-size: 10.5pt !important; }
.font-sz-lg { font-size: 11.5pt !important; }

/* --- Notification System --- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9999;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast svg {
  width: 1.25rem;
  height: 1.25rem;
}

.toast.success svg { fill: var(--color-success); }
.toast.error svg { fill: var(--color-danger); }
.toast.info svg { fill: var(--color-accent); }

.toast-msg {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}


/* --- CSS PRINT RULES (@media print) --- */
@media print {
  @page {
    size: A4;
    margin: 0; 
  }

  body {
    background: #ffffff !important;
    background-image: none !important;
    color: #1f2937 !important;
    overflow: visible !important;
    height: auto !important;
  }

  .editor-panel,
  .toast,
  .preview-panel::before,
  .preview-panel::after {
    display: none !important;
  }

  .app-container {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .preview-panel {
    display: block !important;
    padding: 0 !important;
    background: #ffffff !important;
    height: auto !important;
    overflow: visible !important;
  }

  .cv-page-wrapper {
    transform: none !important;
    display: block !important;
    margin: 0 !important;
  }

  .cv-page {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 20mm !important;
    width: 210mm !important;
    min-height: 297mm !important;
    page-break-after: always;
    page-break-inside: avoid;
    background: #ffffff !important;
    color: #1f2937 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cv-page.tmpl-creative .cv-col-side {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html, body {
    width: 210mm;
    height: 297mm;
  }
}
