/* ============================================
   vitae — Builder Page Styles
   ============================================ */

/* Builder Header */
.builder-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
}

.builder-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  padding: 0 var(--space-4);
  height: 100%;
}

.builder-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.builder-logo-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: var(--font-medium);
}

.builder-header-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Builder Layout */
.builder-layout {
  display: flex;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* Sidebar */
.builder-sidebar {
  width: 360px;
  min-width: 360px;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  background: var(--color-white);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.sidebar-add-section {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

/* Preview */
.builder-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}

.preview-zoom {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.zoom-level {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  min-width: 40px;
  text-align: center;
}

.preview-canvas-wrapper {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: var(--space-8);
}

.preview-canvas {
  width: 210mm; /* A4 width */
  min-height: 297mm; /* A4 height */
  background: var(--color-white);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transform-origin: top center;
}

.preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
}

.placeholder-content {
  text-align: center;
  max-width: 300px;
}

.placeholder-content svg {
  margin: 0 auto var(--space-4);
}

.placeholder-content h2 {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

/* Template modal grid */
.template-modal-search {
  max-width: 400px;
  margin: 0 auto;
}

.template-modal-grid {
  max-height: 60vh;
  overflow-y: auto;
}

/* Section form in sidebar */
.section-form {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
}

.section-form:last-child {
  border-bottom: none;
}

.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.section-header-bar h3 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
}

.section-actions {
  display: flex;
  gap: var(--space-1);
}

/* Field array (experience, education items) */
.field-array-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  position: relative;
  background: var(--color-surface);
}

.field-array-item .remove-item {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
}

.field-array-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}