/* =========================================================
   Resume Customize Modal — customize.css
   ========================================================= */

/* Fix overlay positioning on preview cards */
.resume-preview-card { position: relative; }

/* Stack the two overlay buttons vertically */
.resume-preview-overlay {
  flex-direction: column !important;
  gap: 0.5rem !important;
}

/* Customize button in hover overlay */
.customize-resume-button {
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  color: var(--primary-color, #4338ca);
  border: 2px solid var(--primary-color, #4338ca);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: inherit;
}
.customize-resume-button:hover {
  background: var(--primary-color, #4338ca);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(67,56,202,0.25);
}

/* ---- Full-screen modal overlay ---- */
#customize-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: stretch;
}
#customize-modal.hidden { display: none !important; }

.customize-modal-inner {
  background: var(--bg-primary, #fff);
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ---- Top bar ---- */
.customize-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  flex-shrink: 0;
  background: var(--bg-primary, #fff);
}
.customize-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
}
#customize-modal-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: #f3f4f6; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #6b7280; cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
#customize-modal-close:hover { background: #fee2e2; color: #dc2626; }

/* ---- Split body ---- */
.customize-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left 75% — accordion panel */
.customize-left-panel {
  width: 75%;
  overflow-y: auto;
  padding: 0;
  border-right: 1px solid var(--border-color, #e5e7eb);
  display: flex;
  flex-direction: column;
}

/* Sticky header inside left panel */
.left-panel-header {
  padding: 0.75rem 1.25rem 0.6rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}
.left-panel-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}
.left-panel-resume-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.ats-score-inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ats-label-sm {
  font-size: 0.65rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ats-bar {
  width: 60px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
}
.ats-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease, background 0.3s;
}
.ats-bar-fill.low { background: #f97316; }
.ats-bar-fill.ok  { background: #eab308; }
.ats-bar-fill.good { background: #16a34a; }
.ats-score-value {
  font-size: 0.65rem;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
}
.left-panel-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.35rem;
  margin-top: 0.25rem;
}
.left-panel-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4338ca, #7c3aed);
  border-radius: 99px;
  transition: width 0.5s ease;
  min-width: 0;
}
.left-panel-progress-label {
  font-size: 0.7rem;
  color: #6b7280;
  font-weight: 500;
}

/* Accordion container inside left panel gets the padding */
#accordion-container {
  padding: 1rem 1.25rem 2rem;
  flex: 1;
}

/* Right 25% — live preview */
.customize-right-panel {
  width: 25%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f0f2f5;
}
.preview-panel-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  padding: 0.4rem;
  color: var(--text-secondary, #6b7280);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.preview-iframe-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
}
#preview-iframe {
  width: 940px;
  height: 1329px; /* initial (940 × 297/210 = A4 no-margin); JS overrides after load */
  border: 1px solid #ddd;
  transform-origin: top center;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

/* Accordion loading state */
.accordion-loading {
  padding: 2rem 1rem;
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
  text-align: center;
}

/* ---- Accordion section cards ---- */
.accordion-section-group {
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary, #6b7280);
  margin-top: 1.25rem;
}
.accordion-section-group:first-child { margin-top: 0; }

.accordion-card {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  margin-bottom: 0.6rem;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.accordion-card:hover { box-shadow: 0 2px 12px rgba(67,56,202,0.08); }
.accordion-card.has-data { border-color: #c7d2fe; }
.accordion-card.has-data .accordion-header { border-left: 3px solid #4338ca; }
.accordion-card.is-open .accordion-header { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); }

.accordion-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  background: var(--bg-secondary, #f9fafb);
  transition: background 0.15s;
}
.accordion-header:hover { background: #eef0f7; }

.accordion-section-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: #ede9fe; display: flex; align-items: center;
  justify-content: center; font-size: 0.85rem; flex-shrink: 0;
  transition: background 0.2s;
}
.accordion-card.has-data .accordion-section-icon { background: #4338ca; }

.accordion-filled-dot { display: none; }

.accordion-section-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
}
.accordion-card.has-data .accordion-section-title::after {
  content: ' ✓'; color: #4338ca; font-size: 0.7rem; font-weight: 700;
}

.accordion-chevron {
  font-size: 0.75rem;
  color: var(--text-secondary, #6b7280);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}
.accordion-card.is-open .accordion-chevron { transform: rotate(180deg); }

.accordion-body {
  display: none;
  padding: 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-primary, #fff);
}
.accordion-card.is-open .accordion-body { display: block; }

@keyframes savedFlash {
  0%   { background: #dcfce7; }
  100% { background: var(--bg-secondary, #f9fafb); }
}
.accordion-card.just-saved .accordion-header { animation: savedFlash 1.5s ease forwards; }

/* placement hint badge */
.placement-hint {
  display: inline-block;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  margin-bottom: 0.75rem;
}

/* ---- Section tip ---- */
.section-tip {
  font-size: 0.78rem;
  color: #6b7280;
  font-style: italic;
  line-height: 1.5;
  margin: 0 0 1rem;
  padding: 0.45rem 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #e0e7ff;
}

/* ---- Two-column field rows ---- */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0;
}
.field-row .customize-field,
.field-row .field-float {
  margin-bottom: 0.9rem;
}

/* ---- Form fields — floating labels ---- */
.customize-field { margin-bottom: 0.9rem; }

/* Floating label wrapper */
.field-float {
  position: relative;
  margin-bottom: 0.9rem;
}
.field-float label {
  position: absolute;
  top: 0.65rem;
  left: 0.75rem;
  font-size: 0.82rem;
  color: #9ca3af;
  font-weight: 500;
  pointer-events: none;
  transition: all 0.18s ease;
  background: #fff;
  padding: 0 3px;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  z-index: 1;
}
.field-float input:focus ~ label,
.field-float input:not(:placeholder-shown) ~ label,
.field-float textarea:focus ~ label,
.field-float textarea:not(:placeholder-shown) ~ label {
  top: -0.5rem;
  left: 0.6rem;
  font-size: 0.7rem;
  color: #4338ca;
  font-weight: 600;
}
.field-float input,
.field-float textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--text-primary, #1f2937);
  background: #fff;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: block;
}
.field-float input:focus,
.field-float textarea:focus {
  outline: none;
  border-color: #4338ca;
  box-shadow: 0 0 0 3px rgba(67,56,202,0.1);
}
.field-float input:not(:placeholder-shown):not(:focus) { border-color: #86efac; }
.field-float textarea { resize: vertical; min-height: 80px; line-height: 1.55; }

/* Icon fields */
.field-with-icon { position: relative; }
.field-with-icon .field-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
}
.field-with-icon input { padding-left: 2.2rem; }
.field-with-icon label { left: 2.1rem; }
.field-with-icon input:focus ~ label,
.field-with-icon input:not(:placeholder-shown) ~ label { left: 0.6rem; }

/* Word count */
.field-word-count {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 0.25rem;
  text-align: right;
}
.field-word-count.good { color: #16a34a; }
.field-word-count.warn { color: #f59e0b; }

/* ---- Field visibility toggle ---- */
.field-toggle-btn {
  position: absolute;
  top: 0.4rem; right: 0.4rem;
  width: 22px; height: 22px;
  border-radius: 50%; border: none;
  background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.68rem;
  z-index: 4;
  padding: 0; line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.customize-field:hover .field-toggle-btn,
.field-hidden .field-toggle-btn { opacity: 1; }
.field-toggle-btn:hover { background: #e5e7eb; }
.field-hidden .field-toggle-btn { background: #fee2e2; }

/* Hidden field state */
.field-hidden > input,
.field-hidden > textarea {
  opacity: 0.3;
  pointer-events: none;
}
.field-hidden > label {
  color: #dc2626 !important;
  text-decoration: line-through;
}
.field-hidden .field-icon { opacity: 0.3; }

/* ---- Profile photo upload widget ---- */
.field-image-upload {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1.5px dashed #c7d2fe;
  border-radius: 12px;
  background: #fafbff;
  margin-bottom: 0.9rem;
  position: relative;
}
.img-upload-thumb {
  width: 54px; height: 54px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #e0e7ff;
  display: flex; align-items: center; justify-content: center;
  background: #ede9fe;
  font-size: 1.4rem;
}
.img-upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.img-upload-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, #4338ca, #5b21b6);
  color: #fff; border: none; border-radius: 8px;
  font-size: 0.78rem; font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  width: fit-content;
}
.img-upload-btn:hover { opacity: 0.85; }
.img-remove-btn {
  background: none; border: none;
  color: #ef4444; font-size: 0.72rem;
  cursor: pointer; text-align: left;
  padding: 0; text-decoration: underline;
  width: fit-content;
}
.img-file-input { display: none; }

/* Fallback for non-float fields */
.customize-field:not(.field-float) label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.customize-field:not(.field-float) input[type="text"],
.customize-field:not(.field-float) input[type="email"],
.customize-field:not(.field-float) input[type="url"],
.customize-field:not(.field-float) input[type="tel"],
.customize-field:not(.field-float) textarea {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--text-primary, #1f2937);
  background: #fff;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.customize-field:not(.field-float) input:focus,
.customize-field:not(.field-float) textarea:focus {
  outline: none;
  border-color: #4338ca;
  box-shadow: 0 0 0 3px rgba(67,56,202,0.1);
}
.customize-field:not(.field-float) textarea { resize: vertical; min-height: 72px; line-height: 1.5; }

/* Sub-entry group (Education) */
.sub-entry {
  border: 1px solid #e0e7ff;
  border-radius: 10px;
  padding: 1rem 0.85rem 0.15rem;
  margin-bottom: 0.75rem;
  position: relative;
  background: #fafbff;
}
.sub-entry-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
}
.sub-entry-remove:hover { color: #ef4444; }

/* Dynamic bullet list */
.bullet-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.bullet-item input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
}
.bullet-item input:focus { outline: none; border-color: var(--primary-color, #4338ca); }
.bullet-item-remove {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.2rem;
  flex-shrink: 0;
}
.bullet-item-remove:hover { color: #ef4444; }

/* Tag/chip input */
.tag-input-wrapper {
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 2.5rem;
  cursor: text;
  background: var(--bg-primary, #fff);
  transition: border-color 0.2s;
}
.tag-input-wrapper:focus-within { border-color: var(--primary-color, #4338ca); }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #4338ca;
  border: 1px solid #c4b5fd;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(67,56,202,0.1);
  transition: all 0.15s;
}
.tag-chip:hover { background: linear-gradient(135deg, #ddd6fe, #c4b5fd); }
.tag-chip-remove {
  background: none;
  border: none;
  color: #7c3aed;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
  line-height: 1;
  margin-left: 2px;
}
.tag-chip-remove:hover { color: #dc2626; }
.tag-input-field {
  border: none;
  outline: none;
  font-size: 0.875rem;
  min-width: 80px;
  flex: 1;
  font-family: inherit;
  background: transparent;
  padding: 2px 0;
}

/* Actions row at the bottom of optional section bodies */
.accordion-body-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Remove section button */
.section-remove-btn {
  padding: 0.45rem 1rem;
  background: transparent;
  color: #ef4444;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.section-remove-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

/* Section save / add buttons */
.section-save-btn {
  padding: 0.45rem 1.25rem;
  background: linear-gradient(135deg, #4338ca, #5b21b6);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.18s;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(67,56,202,0.2);
}
.section-save-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.section-save-btn:active { transform: translateY(0); }

.add-item-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border: 1.5px dashed #c7d2fe;
  border-radius: 8px;
  background: transparent;
  color: var(--primary-color, #4338ca);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.4rem;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.add-item-btn:hover { background: #f5f3ff; border-color: #4338ca; }

/* Add Section button */
.add-section-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px dashed #c7d2fe;
  border-radius: 12px;
  background: transparent;
  color: var(--primary-color, #4338ca);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.add-section-btn:hover { background: #f5f3ff; border-color: #4338ca; }

/* Optional section picker popover */
.optional-section-picker {
  position: relative;
  margin-top: 0.5rem;
}
.optional-picker-list {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 10010;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.optional-picker-list.is-open { display: block; }
.optional-picker-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text-primary, #1f2937);
  transition: background 0.12s;
}
.optional-picker-item:hover { background: #f5f3ff; color: var(--primary-color, #4338ca); }
.optional-picker-item.picker-restore { color: #6b7280; font-style: italic; }
.optional-picker-item.picker-restore:hover { background: #f0fdf4; color: #16a34a; }

/* ---- Template picker strip ---- */
.template-picker-strip {
  display: none;
  overflow-x: auto;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-secondary, #f9fafb);
  flex-shrink: 0;
  scrollbar-width: thin;
}
.template-picker-strip.is-visible { display: flex; }

.template-thumb {
  flex-shrink: 0;
  width: 76px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.15s;
}
.template-thumb:hover { transform: translateY(-2px); }
.template-thumb.active { border-color: var(--primary-color, #4338ca); }
.template-thumb-color-bar { height: 38px; }
.template-thumb-label {
  font-size: 0.6rem;
  text-align: center;
  padding: 3px 2px;
  background: #fff;
  color: #374151;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Bottom bar ---- */
.customize-bottom-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--bg-primary, #fff);
  flex-shrink: 0;
}
.bottom-bar-btn {
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.01em;
}
.btn-outline {
  background: var(--bg-secondary, #f9fafb);
  border: 1px solid var(--border-color, #e5e7eb);
  color: var(--text-primary, #1f2937);
}
.btn-outline:hover { background: #eef0f7; }
.btn-primary-action {
  background: linear-gradient(135deg, #4338ca 0%, #5b21b6 100%);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px rgba(67,56,202,0.25);
}
.btn-primary-action:hover {
  background: linear-gradient(135deg, #3730a3 0%, #4c1d95 100%);
  box-shadow: 0 4px 16px rgba(67,56,202,0.35);
  transform: translateY(-1px);
}
.btn-primary-action:active { transform: translateY(0); box-shadow: none; }
.btn-download {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border: none;
  color: #fff;
  margin-left: auto;
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.btn-download:hover {
  background: linear-gradient(135deg, #15803d 0%, #14532d 100%);
  box-shadow: 0 4px 16px rgba(22,163,74,0.4);
  transform: translateY(-1px);
}
.btn-download:active { transform: translateY(0); }

@keyframes downloadPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(22,163,74,0.3), 0 0 0 0 rgba(22,163,74,0.5); }
  50%       { box-shadow: 0 2px 8px rgba(22,163,74,0.3), 0 0 0 8px rgba(22,163,74,0); }
}
.btn-download.pulse { animation: downloadPulse 1.8s infinite; }

/* ---- Large preview modal ---- */
#large-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}
#large-preview-modal.hidden { display: none !important; }

.large-preview-inner {
  position: relative;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.large-preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}
.large-preview-topbar span { font-size: 0.875rem; font-weight: 600; color: #374151; }
#large-preview-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
#large-preview-close:hover { background: #f3f4f6; }

.large-preview-frame-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem;
  background: #e5e7eb;
}
#large-preview-iframe {
  width: 940px;
  height: 1329px; /* initial (940 × 297/210 = A4 no-margin); JS overrides after load */
  border: none;
  transform-origin: top center;
  background: #fff;
  box-shadow: 0 6px 30px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

/* ---- Preview loading spinner ---- */
.preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(240,242,245,0.8);
  z-index: 5;
  pointer-events: none;
}
.preview-loading.hidden { display: none; }
.spinner {
  width: 30px; height: 30px;
  border: 3px solid #d1d5db;
  border-top-color: var(--primary-color, #4338ca);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Rearrange Modal ─────────────────────────────────────────────────────── */
.rearrange-inner {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  width: 640px;
  max-width: 96vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.rearrange-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rearrange-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
}
.rearrange-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.rearrange-close-btn:hover { background: #f3f4f6; color: #111; }

.rearrange-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Resume-shaped card */
#rearrange-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.rearrange-resume-card {
  display: flex;
  min-height: 260px;
}
.rearrange-resume-card.single-col { flex-direction: column; }

/* Columns */
.rearrange-col {
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  gap: 6px;
}
.rearrange-col-left  { flex: 0 0 36%; }
.rearrange-col-right { flex: 1; }
.rearrange-col-single { flex: 1; }

.rearrange-col-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}

/* =========================================================
   Pricing Modal
   ========================================================= */
#pricing-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 2rem 1rem;
}
#pricing-modal.hidden { display: none; }

.pricing-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 30, 0.75);
  backdrop-filter: blur(4px);
}

.pricing-modal-box {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem 3rem 2.5rem;
  width: 100%;
  max-width: 1040px;
  margin: auto;
  flex-shrink: 0;
  box-shadow: 0 24px 64px rgba(67, 56, 202, 0.18), 0 4px 16px rgba(0,0,0,0.12);
  animation: pricingSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pricingSlideUp {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.pricing-modal-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.pricing-modal-left {
  flex: 1;
  min-width: 0;
}

.pricing-modal-right {
  width: 340px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 100%);
  border-radius: 16px;
  border: 1px solid #ddd6fe;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.pricing-right-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #4338ca;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0;
}

#paypal-container-2JDBGGZA5KJPA {
  width: 100%;
  min-height: 340px;
  overflow: hidden;
  text-align: center;
}
#paypal-container-2JDBGGZA5KJPA iframe {
  margin: 0 auto !important;
  display: block !important;
}

.pricing-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 1;
}
.pricing-modal-close:hover { background: #e5e7eb; color: #111; }

.pricing-badge {
  display: inline-block;
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.pricing-modal-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.pricing-modal-sub {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.pricing-amount {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  margin: 0 auto 0.75rem;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  width: fit-content;
}

.pricing-currency {
  font-size: 1.4rem;
  font-weight: 700;
  color: #4338ca;
  margin-top: 5px;
}

.pricing-number {
  font-size: 3.2rem;
  font-weight: 900;
  color: #4338ca;
  line-height: 1;
  letter-spacing: -2px;
}

.pricing-period {
  font-size: 0.78rem;
  color: #7c3aed;
  font-weight: 600;
  align-self: flex-end;
  margin-bottom: 5px;
  margin-left: 4px;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: #374151;
  font-weight: 500;
}

.pricing-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  color: #fff;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 900;
  flex-shrink: 0;
}

.pricing-secure {
  font-size: 0.75rem;
  color: #7c3aed;
  margin: 0;
  font-weight: 500;
}

.pricing-refund {
  font-size: 0.73rem;
  color: #9ca3af;
  margin: 0;
}
.pricing-refund a { color: #6366f1; text-decoration: none; }
.pricing-refund a:hover { text-decoration: underline; }

/* Pricing modal — new elements */
.pricing-left-top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.pricing-preview-thumb {
  width: 120px;
  height: 170px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e0e7ff;
  box-shadow: 0 4px 16px rgba(67,56,202,0.15);
  flex-shrink: 0;
}
.pricing-preview-thumb iframe {
  width: 940px;
  height: 1328px;
  transform: scale(0.1277);
  transform-origin: top left;
  pointer-events: none;
  border: none;
}
.pricing-left-header { flex: 1; min-width: 0; }
.pricing-progress-msg {
  font-size: 0.78rem;
  color: #16a34a;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.pricing-social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4338ca;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.proof-dot { color: #d1d5db; font-weight: 400; }
.pricing-anchor {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-bottom: 0.75rem;
  text-align: center;
}
.pricing-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #dc2626;
  font-weight: 600;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  margin-bottom: 1rem;
}
.pricing-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
  align-items: start;
}

.pricing-testimonials { display: flex; flex-direction: column; gap: 0.5rem; }
.pricing-quote {
  font-size: 0.8rem;
  color: #374151;
  font-style: italic;
  border-left: 3px solid #e0e7ff;
  padding: 0.35rem 0.75rem;
  margin: 0;
}
.pricing-quote cite {
  display: block;
  font-size: 0.72rem;
  color: #9ca3af;
  font-style: normal;
  font-weight: 600;
  margin-top: 0.2rem;
}
.pricing-trust-badges {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: #6b7280;
  font-weight: 500;
  text-align: center;
  width: 100%;
}

@media (max-width: 640px) {
  .pricing-modal-layout { flex-direction: column; }
  .pricing-modal-right { width: 100%; }
  .pricing-modal-box { padding: 2rem 1.25rem; }
  .pricing-bottom-row { grid-template-columns: 1fr; }
  .pricing-left-top { flex-direction: column; align-items: center; }
  .pricing-preview-thumb { width: 100px; height: 141px; }
  .pricing-preview-thumb iframe { transform: scale(0.106); }
}

/* Mobile — customize modal */
@media (max-width: 768px) {
  .customize-modal-body { flex-direction: column; }
  .customize-left-panel { width: 100%; border-right: none; border-bottom: 1px solid #e5e7eb; max-height: 55vh; }
  .customize-right-panel { display: none; }
  .customize-bottom-bar { flex-wrap: wrap; gap: 0.5rem; }
  .btn-download { margin-left: 0; }
  .field-row { grid-template-columns: 1fr; }
}

/* Section boxes */
.rearrange-box {
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}

/* Fixed (non-draggable) section boxes */
.rearrange-box-fixed {
  opacity: 0.45;
  cursor: default;
}

/* Draggable section boxes */
.rearrange-box-drag {
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: box-shadow 0.15s, opacity 0.15s;
}
.rearrange-box-drag:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}
.rearrange-box-drag:active { cursor: grabbing; }

.rearrange-drag-icon {
  font-size: 0.85rem;
  opacity: 0.55;
  flex-shrink: 0;
}

/* Drag state */
.rearrange-box-drag.is-dragging {
  opacity: 0.3;
}
.rearrange-box-drag.drag-over-top {
  border-top: 2px solid #4338ca !important;
}
.rearrange-box-drag.drag-over-bottom {
  border-bottom: 2px solid #4338ca !important;
}

/* Colors for boxes on dark (left) column backgrounds */
.rearrange-col-dark .rearrange-col-label { color: rgba(255,255,255,0.55); }
.rearrange-col-dark .rearrange-box-fixed {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.12);
}
.rearrange-col-dark .rearrange-box-drag {
  background: rgba(255,255,255,0.93);
  color: #1f2937;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Colors for boxes on light (right) column backgrounds */
.rearrange-col-light .rearrange-col-label { color: #9ca3af; }
.rearrange-col-light .rearrange-box-fixed {
  background: rgba(0,0,0,0.05);
  color: #9ca3af;
  border: 1px solid #e5e7eb;
}
.rearrange-col-light .rearrange-box-drag {
  background: #fff;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

.rearrange-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.rearrange-no-sections {
  padding: 2rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
}
