/* ─── CV Builder Styles ─────────────────────────────────────────── */
.builder-wrap {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  min-height: calc(100vh - 64px);
}

.builder-form {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 28px 24px;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
}

.builder-preview-pane {
  padding: 32px;
  background: #e9edf2;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.builder-form h2 {
  font-size: 18px;
  margin-bottom: 4px;
}
.builder-form .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.form-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; }
.form-section h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-form .form-group { margin-bottom: 14px; }
.builder-form label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.builder-form input,
.builder-form textarea,
.builder-form select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.builder-form input:focus,
.builder-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.repeat-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
}
.repeat-item .remove-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  width: 24px; height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.add-btn {
  width: 100%;
  padding: 10px;
  background: #fff;
  border: 1px dashed var(--primary);
  color: var(--primary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.add-btn:hover { background: var(--primary); color: #fff; }

.template-picker { display: flex; gap: 8px; margin-bottom: 14px; }
.template-opt {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
}
.template-opt.active { border-color: var(--primary); color: var(--primary); background: rgba(37,99,235,0.05); }

.builder-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 780px;
}
.builder-actions .btn { flex: 1; text-align: center; cursor: pointer; border: none; font-size: 15px; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border) !important; }
.btn-secondary:hover { background: var(--bg-soft); color: var(--text); }

/* ─── CV Preview Document ─────────────────────────────────────────── */
#cv-preview {
  width: 100%;
  max-width: 780px;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 48px 52px;
  min-height: 1000px;
  font-size: 14px;
  line-height: 1.55;
  color: #1a1a1a;
}

/* Template: Modern (default) */
#cv-preview.tpl-modern .cv-header { border-bottom: 3px solid var(--primary); padding-bottom: 16px; margin-bottom: 20px; }
#cv-preview.tpl-modern .cv-name { font-size: 30px; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
#cv-preview.tpl-modern .cv-section-title { color: var(--primary); }

/* Template: Classic */
#cv-preview.tpl-classic .cv-header { text-align: center; border-bottom: 2px solid #1a1a1a; padding-bottom: 16px; margin-bottom: 20px; }
#cv-preview.tpl-classic .cv-name { font-size: 28px; font-weight: 700; letter-spacing: 0.02em; }
#cv-preview.tpl-classic .cv-section-title { color: #1a1a1a; border-bottom: 1px solid #ccc; }

/* Template: Minimal */
#cv-preview.tpl-minimal .cv-header { margin-bottom: 24px; }
#cv-preview.tpl-minimal .cv-name { font-size: 26px; font-weight: 600; }
#cv-preview.tpl-minimal .cv-section-title { color: #555; font-size: 13px; }

.cv-name { margin-bottom: 4px; }
.cv-title-role { font-size: 16px; color: #555; margin-bottom: 10px; }
.cv-contact { font-size: 13px; color: #444; display: flex; flex-wrap: wrap; gap: 14px; }
.cv-contact span { display: inline-flex; align-items: center; gap: 4px; }

.cv-section { margin-bottom: 22px; }
.cv-section-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  padding-bottom: 4px;
}
.cv-summary { font-size: 14px; color: #333; }

.cv-entry { margin-bottom: 16px; }
.cv-entry-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.cv-entry-title { font-weight: 700; font-size: 15px; }
.cv-entry-date { font-size: 13px; color: #777; white-space: nowrap; }
.cv-entry-sub { font-size: 14px; color: #555; font-style: italic; margin-bottom: 6px; }
.cv-entry-desc { font-size: 13.5px; color: #333; }
.cv-entry-desc ul { margin: 4px 0 0 18px; }
.cv-entry-desc li { margin-bottom: 3px; }

.cv-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-skill-tag {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
}
#cv-preview.tpl-classic .cv-skill-tag { border-radius: 4px; }
#cv-preview.tpl-minimal .cv-skill-tag { background: none; border: none; padding: 0; }
#cv-preview.tpl-minimal .cv-skill-tag::after { content: '·'; margin-left: 8px; color: #aaa; }

.cv-empty-hint { color: #bbb; font-style: italic; }

/* Print */
@media print {
  .site-header, .site-footer, .builder-form, .builder-actions, .menu-toggle { display: none !important; }
  .builder-wrap { display: block; }
  .builder-preview-pane { padding: 0; background: #fff; max-height: none; overflow: visible; }
  #cv-preview { box-shadow: none; max-width: 100%; padding: 0; min-height: auto; }
  @page { margin: 1.5cm; }
}

@media (max-width: 968px) {
  .builder-wrap { grid-template-columns: 1fr; }
  .builder-form { max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .builder-preview-pane { max-height: none; }
}

/* ─── ATS Checker Styles ─────────────────────────────────────────── */
.ats-wrap { max-width: 1100px; margin: 0 auto; padding: 48px 20px; }
.ats-intro { text-align: center; margin-bottom: 40px; }
.ats-intro h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; margin-bottom: 12px; }
.ats-intro p { color: var(--text-muted); font-size: 17px; max-width: 640px; margin: 0 auto; }

.ats-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.ats-input-col label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 15px; }
.ats-input-col textarea {
  width: 100%; min-height: 280px; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; line-height: 1.6; resize: vertical;
}
.ats-input-col textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.ats-analyze-row { text-align: center; margin-bottom: 40px; }
.ats-analyze-row .btn { font-size: 16px; padding: 14px 48px; cursor: pointer; border: none; }

#ats-result { display: none; }

.ats-score-card { text-align: center; margin-bottom: 40px; }
.ats-gauge {
  width: 180px; height: 180px; border-radius: 50%; margin: 0 auto 16px;
  background: conic-gradient(var(--color) calc(var(--score) * 1%), var(--border) 0);
  display: flex; align-items: center; justify-content: center;
}
.ats-gauge-inner {
  width: 144px; height: 144px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ats-score-num { font-size: 48px; font-weight: 800; line-height: 1; }
.ats-score-num small { font-size: 24px; }
.ats-score-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.ats-verdict { font-size: 18px; font-weight: 700; }

.ats-section { margin-bottom: 28px; padding: 20px 24px; background: var(--bg-soft); border-radius: var(--radius); }
.ats-section h3 { font-size: 16px; margin-bottom: 14px; }
.ats-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ats-tag { padding: 5px 12px; border-radius: 16px; font-size: 13px; font-weight: 500; }
.ats-tag-ok { background: #dcfce7; color: #166534; }
.ats-tag-miss { background: #fee2e2; color: #991b1b; }
.ats-empty { color: var(--text-muted); font-style: italic; }
.ats-suggestions { margin: 0; padding-left: 20px; }
.ats-suggestions li { margin-bottom: 10px; line-height: 1.6; }
.ats-cta { text-align: center; margin-top: 32px; }
.ats-cta .btn { cursor: pointer; }

@media (max-width: 768px) {
  .ats-inputs { grid-template-columns: 1fr; }
  .ats-input-col textarea { min-height: 200px; }
}
