* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  color: #333;
}

#app {
  display: flex;
  min-height: 100vh;
}

/* ==================== EDITOR ==================== */
#editor {
  width: 400px;
  background: #fff;
  border-right: 2px solid #ddd;
  overflow-y: auto;
  flex-shrink: 0;
}

.editor-header {
  position: sticky;
  top: 0;
  background: #2c3e50;
  color: white;
  padding: 20px;
  z-index: 100;
}

.editor-header h1 {
  font-size: 24px;
  margin-bottom: 15px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  padding: 8px 12px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.btn:hover {
  background: #2980b9;
}

.editor-content {
  padding: 20px;
}

.editor-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.editor-section h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #2c3e50;
}

.editor-section input,
.editor-section textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}

.editor-section textarea {
  resize: vertical;
}

/* ==================== REPEATABLE ITEMS ==================== */
.repeatable-list,
.repeatable-cards {
  margin-bottom: 10px;
}

.repeatable-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.repeatable-item input,
.repeatable-item textarea {
  flex: 1;
  margin: 0;
}

.repeatable-card {
  margin-bottom: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.repeatable-card input,
.repeatable-card textarea {
  margin-bottom: 8px;
}

.bullets-list {
  margin: 10px 0;
  padding: 8px;
  background: white;
  border-radius: 4px;
}

.bullet-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.bullet-item input {
  flex: 1;
  margin: 0;
  padding: 6px;
  font-size: 13px;
}

.drag-handle,
.section-drag-handle {
  cursor: grab;
  user-select: none;
  color: #999;
  font-size: 16px;
  padding: 4px;
  line-height: 1;
}

.drag-handle:active,
.section-drag-handle:active {
  cursor: grabbing;
}

.drag-handle-small {
  cursor: grab;
  user-select: none;
  color: #999;
  font-size: 14px;
}

.drag-handle-small:active {
  cursor: grabbing;
}

.btn-delete,
.btn-delete-small {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.btn-delete:hover,
.btn-delete-small:hover {
  background: #c0392b;
}

.btn-add,
.btn-add-small {
  width: 100%;
  padding: 10px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-add:hover,
.btn-add-small:hover {
  background: #229954;
}

.btn-add-small {
  padding: 6px;
  font-size: 12px;
  margin-top: 8px;
}

/* ==================== DRAG STATES ==================== */
.drag-ghost {
  opacity: 0.8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: rotate(2deg);
}

.drag-placeholder {
  background: #e3f2fd;
  border: 2px dashed #2196f3;
  border-radius: 4px;
  margin-bottom: 8px;
}

/* ==================== PREVIEW ==================== */
#preview {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  background: #e0e0e0;
}

.cv-container {
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  display: flex;
  padding: 0;
}

.cv-left {
  width: 32%;
  background: #34495e;
  color: white;
  padding: 30px 20px;
}

.cv-right {
  width: 68%;
  padding: 30px 25px;
  background: white;
}

.cv-section {
  margin-bottom: 25px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.cv-section h2 {
  font-size: 18px;
  border-bottom: 2px solid currentColor;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.cv-left .cv-section h2 {
  border-color: #ecf0f1;
  color: #ecf0f1;
}

.cv-right .cv-section h2 {
  border-color: #34495e;
  color: #34495e;
}

.section-content {
  font-size: 14px;
  line-height: 1.6;
}

.contact-info h1 {
  font-size: 26px;
  margin-bottom: 8px;
  word-wrap: break-word;
}

.contact-info .title {
  font-size: 16px;
  margin-bottom: 12px;
  color: #ecf0f1;
  font-weight: 500;
}

.contact-info p {
  margin-bottom: 6px;
  font-size: 13px;
}

.cv-section ul {
  list-style: none;
  padding: 0;
}

.cv-section ul li {
  margin-bottom: 6px;
  padding-left: 16px;
  position: relative;
}

.cv-section ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  font-weight: bold;
}

.cv-left ul li::before {
  color: #ecf0f1;
}

.cv-right ul li::before {
  color: #34495e;
}

.job-item,
.edu-item,
.ref-item {
  margin-bottom: 18px;
}

.job-item h3,
.edu-item h3 {
  font-size: 16px;
  margin-bottom: 4px;
  color: #2c3e50;
}

.company {
  font-size: 13px;
  color: #7f8c8d;
  margin-bottom: 8px;
}

.job-item ul,
.edu-item ul {
  margin-top: 8px;
}

.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-block;
  padding: 6px 12px;
  background: #ecf0f1;
  border-radius: 16px;
  font-size: 12px;
  color: #34495e;
}

.ref-item p {
  margin-bottom: 4px;
  font-size: 13px;
}

/* ==================== PRINT ==================== */
@media print {
  body {
    background: white;
  }

  #editor {
    display: none !important;
  }

  #preview {
    padding: 0;
    background: white;
  }

  .cv-container {
    box-shadow: none;
    margin: 0;
    max-width: 100%;
    width: 210mm;
    min-height: 297mm;
  }

  .drag-handle,
  .section-drag-handle,
  .drag-handle-small {
    display: none !important;
  }

  .cv-section {
    page-break-inside: avoid;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@page {
  size: A4;
  margin: 0;
}
