/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #f0f2f5;
  color: #222;
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .app-container { display: block; height: auto; }
  .cv-panel { overflow: visible; height: auto; background: #fff; padding: 0; }
  .cv-preview-wrapper { padding: 0; }
  .cv-preview { box-shadow: none; padding: 0; max-width: 100%; }
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 50px;
  background: #1a1a1a;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 200;
  gap: 12px;
}

.toolbar-brand {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  flex-shrink: 0;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  padding: 6px 13px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.82; }

.btn-secondary { background: #3a3a3a; color: #ddd; border: 1px solid #555; }
.btn-lang      { background: #3a3a3a; color: #fff; border: 1px solid #555; border-radius: 50px; }
.btn-pdf       { background: #444;    color: #fff; }
.btn-word      { background: #2b579a; color: #fff; }
.btn-reset     { background: transparent; color: #aaa; border: 1px solid #444; }

/* ── App Layout ───────────────────────────────────────────────────────────── */
.app-container {
  display: flex;
  height: calc(100vh - 50px);
}

/* ── Editor Panel ─────────────────────────────────────────────────────────── */
.editor-panel {
  width: 340px;
  min-width: 300px;
  max-width: 340px;
  flex-shrink: 0;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid #ddd;
  transition: width 0.2s, min-width 0.2s, border 0.2s;
}

.editor-panel.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
  overflow: hidden;
}

/* Form title */
.form-title {
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #eee;
}

/* Form sections */
.form-section {
  padding: 10px 14px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.form-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}

.form-section label {
  display: block;
  font-size: 10px;
  color: #888;
  margin-top: 7px;
  margin-bottom: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-section label:first-of-type { margin-top: 0; }

.form-section input[type="text"],
.form-section input[type="email"],
.form-section input[type="url"],
.form-section textarea {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-size: 12px;
  font-family: inherit;
  color: #333;
  background: #fafafa;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
}

.form-section input:focus,
.form-section textarea:focus {
  outline: none;
  border-color: #2b579a;
  background: #fff;
}

.form-section textarea {
  resize: vertical;
  min-height: 52px;
}

/* Array items */
.array-item {
  background: #f8f9fb;
  border: 1px solid #e8eaed;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 6px;
}

.array-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
  gap: 6px;
}

.array-item-label {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.array-item input,
.array-item textarea {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  padding: 4px 7px;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #333;
  line-height: 1.5;
}

.array-item input:focus,
.array-item textarea:focus {
  outline: none;
  border-color: #2b579a;
}

.array-item textarea { resize: vertical; }

.array-item label {
  display: block;
  font-size: 10px;
  color: #999;
  margin-top: 5px;
  margin-bottom: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.array-item label:first-of-type { margin-top: 0; }

.link-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.link-row input { flex: 1; margin-bottom: 0; }

.skill-row {
  display: flex;
  gap: 4px;
  align-items: center;
}
.skill-row input { flex: 1; margin-bottom: 0; }

.btn-remove {
  background: none;
  border: none;
  color: #cc4444;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}
.btn-remove:hover { color: #992222; }

.btn-add {
  display: block;
  width: 100%;
  padding: 6px 0;
  margin-top: 4px;
  background: none;
  border: 1px dashed #ccc;
  border-radius: 3px;
  color: #999;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-add:hover {
  border-color: #2b579a;
  color: #2b579a;
  background: #f0f5ff;
}

/* ── CV Panel ─────────────────────────────────────────────────────────────── */
.cv-panel {
  flex: 1;
  overflow-y: auto;
  background: #f0f2f5;
  padding: 28px 24px;
}

.cv-preview-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

/* ── CV Preview ───────────────────────────────────────────────────────────── */
.cv-preview {
  background: #fff;
  padding: 36px 40px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #222;
  line-height: 1.6;
}

/* Header */
.cv-name {
  font-size: 38px;
  letter-spacing: 2px;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.15;
}

.cv-profession {
  font-size: 17px;
  margin-top: 0;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cv-divider {
  border: 0;
  border-top: 1px solid #eaeaea;
  margin: 22px 0;
}

/* Two-column table */
.cv-table {
  width: 100%;
  border: none;
  border-collapse: collapse;
  font-size: 14px;
}

.cv-left {
  width: 30%;
  vertical-align: top;
  padding-right: 24px;
  border-right: 1px solid #eaeaea;
}

.cv-right {
  width: 70%;
  vertical-align: top;
  padding-left: 28px;
}

/* Section headings inside CV */
.cv-sec-title {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 14px;
}

.cv-sec-title + * { /* reset top margin after heading */ }

.cv-underline {
  width: 28px;
  border-bottom: 2px solid #222;
  margin-top: 4px;
}

/* Left column details */
.cv-detail {
  font-size: 12px;
  margin-bottom: 4px;
  margin-top: 14px;
}
.cv-detail:first-of-type { margin-top: 0; }
.cv-detail strong { color: #222; }
.cv-detail-val { color: #555; }

/* Links */
.cv-link-wrap { margin-bottom: 8px; font-size: 13px; }
.cv-link-wrap:last-child { margin-bottom: 28px; }
.cv-link { color: #222; text-decoration: underline; }
.cv-link:hover { color: #2b579a; }

/* Skills */
.cv-skill { margin-bottom: 13px; }
.cv-skill p { font-size: 13px; color: #444; margin-bottom: 4px; }
.cv-skill-bar { height: 4px; background: #222; width: 100%; }

/* Right column */
.cv-profile {
  color: #444;
  margin-bottom: 36px;
  text-align: justify;
}

.cv-exp { margin-bottom: 22px; }
.cv-exp:last-child { margin-bottom: 36px; }

.cv-job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}
.cv-job-title-text { font-size: 15px; font-weight: 700; }
.cv-job-loc { font-size: 13px; color: #666; font-weight: 400; }
.cv-job-date { margin-top: 0; font-size: 12px; color: #666; font-style: italic; margin-bottom: 8px; }
.cv-job-desc { color: #444; margin-bottom: 6px; }

.cv-bullets { margin: 0; padding-left: 18px; color: #444; font-size: 13px; }
.cv-bullets li { margin-bottom: 3px; }

.cv-edu { margin-bottom: 13px; }
.cv-edu-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.cv-edu-inst { font-size: 13px; color: #666; margin-top: 0; }

.cv-certs { margin: 0; padding-left: 18px; color: #444; font-size: 14px; line-height: 1.8; }

/* section spacing inside right col */
.cv-right .cv-sec-title { margin-top: 28px; }
.cv-right .cv-sec-title:first-child { margin-top: 0; }
