/* Toolbar commun à tous les modèles de CV */
body { padding-bottom: 34mm; }

[contenteditable="true"] { outline: none; cursor: text; }

.cv-toolbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #14213d; padding: 3.5mm 0; text-align: center;
  box-shadow: 0 -3px 12px rgba(0,0,0,0.25); z-index: 100;
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.cv-toolbar-inner {
  max-width: 210mm; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  gap: 4mm; flex-wrap: wrap; row-gap: 2.5mm;
}
.cv-toolbar a.cv-home-link { color: #b9c4dd; font-size: 8.1pt; text-decoration: underline; }

.cv-toolbar button {
  background: #3d5a99; color: #fff; border: none; border-radius: 5px;
  padding: 2.6mm 6mm; font-size: 9.6pt; font-weight: 700; cursor: pointer;
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.cv-toolbar button:hover { background: #4d6cae; }
.cv-toolbar button:disabled { opacity: 0.6; cursor: default; }
.cv-toolbar button:disabled:hover { background: #3d5a99; }
.cv-toolbar button.cv-secondary {
  background: transparent; border: 1px solid #4d5c82; color: #cdd7ee;
  font-size: 8.4pt; padding: 2mm 4mm; font-weight: 600;
}
.cv-toolbar button.cv-secondary:hover { background: #223056; }
.cv-toolbar button.cv-secondary:disabled { opacity: 0.35; cursor: default; }
.cv-toolbar button.cv-secondary:disabled:hover { background: transparent; }

.cv-toolbar .hint { color: #8792ac; font-size: 7.4pt; max-width: 60mm; text-align: left; }

.cv-toolbar a.cv-reset-link { color: #b9c4dd; font-size: 8.1pt; text-decoration: underline; cursor: pointer; }
.cv-toolbar a.cv-reset-link:hover { color: #fff; }

.cv-palette-row { display: flex; align-items: center; gap: 1.6mm; }
.cv-swatch {
  width: 5.5mm; height: 5.5mm; border-radius: 50%; padding: 0;
  border: 2px solid rgba(255,255,255,0.25); cursor: pointer;
}
.cv-swatch.active { border-color: #fff; box-shadow: 0 0 0 1.5px #3d5a99; }

/* ---------- Blocs répétables (expérience, etc.) ---------- */
.cv-remove-btn {
  position: absolute; top: -2mm; right: -2mm; width: 5.5mm; height: 5.5mm;
  border-radius: 50%; background: #c0392b; color: #fff; border: 2px solid #fff;
  font-size: 11px; line-height: 1; cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  opacity: 0; transition: opacity 0.15s ease;
}
.cv-repeat-item:hover .cv-remove-btn { opacity: 1; }
.cv-block:hover > .cv-remove-btn { opacity: 1; }

.cv-add-btn {
  display: block; width: 100%; flex: 1 0 100%; margin-top: 2mm; padding: 2.2mm 4mm;
  background: #f4f6fa; border: 1.5px dashed #b7c2d9; border-radius: 6px;
  color: #4d5c82; font-size: 8.4pt; font-weight: 600; cursor: pointer;
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.cv-add-btn:hover { background: #eaeefb; border-color: #8ba0d1; }

/* ---------- Ronds de niveau cliquables (langues, etc.) ---------- */
.cv-dot-clickable { cursor: pointer; }
.cv-dot-clickable:hover { transform: scale(1.3); }

/* ---------- Photo (avatar) ---------- */
.cv-avatar { position: relative; cursor: pointer; }
.cv-avatar.has-photo { font-size: 0 !important; color: transparent !important; }
.cv-avatar:hover { filter: brightness(0.93); }
.cv-avatar-remove {
  position: absolute; top: -1.5mm; right: -1.5mm; width: 5mm; height: 5mm;
  border-radius: 50%; background: #c0392b; color: #fff; border: 2px solid #fff;
  font-size: 10px; line-height: 1; cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  opacity: 0; transition: opacity 0.15s ease;
}
.cv-avatar:hover .cv-avatar-remove { opacity: 1; }
.cv-avatar-placeholder {
  display: none; align-items: center; justify-content: center; cursor: pointer;
  border: 1.5px dashed #b7c2d9; background: #f4f6fa; color: #4d5c82;
  font-size: 7pt; font-weight: 600; text-align: center; line-height: 1.3; padding: 2mm;
}
.cv-avatar-placeholder:hover { background: #eaeefb; border-color: #8ba0d1; }

/* ---------- Zones de dépôt (glisser-déposer un bloc n'importe où) ---------- */
[data-flow-zone] { min-height: 3mm; }
[data-flow-zone].drag-over { outline: 1.5px dashed #8ba0d1; outline-offset: 2px; }
.cv-insert-indicator {
  height: 1.6mm; margin: 1mm 0; border-radius: 1mm;
  background: #3d5a99; box-shadow: 0 0 0 2px rgba(61,90,153,0.25);
}
.cv-flow-sub:empty {
  min-height: 10mm; border: 1.5px dashed #c3ccdb; border-radius: 2mm;
  display: flex; align-items: center; justify-content: center;
}
.cv-flow-sub:empty::after {
  content: "Glissez un bloc ici"; color: #9aa5b8; font-size: 7.6pt;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Palette de blocs (glisser-déposer), grande et toujours ouverte ---------- */
.cv-palette-panel {
  position: fixed; top: 50%; right: 5mm; transform: translateY(-50%); z-index: 150;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #fff; border-radius: 3mm; padding: 4mm;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28); border: 1px solid #e2e6ee;
  width: 58mm; max-height: 85vh; overflow-y: auto;
}
.cv-palette-title { font-size: 9.2pt; font-weight: 800; color: #14213d; margin-bottom: 3mm; }
.cv-palette-cards { display: flex; flex-direction: column; gap: 2.5mm; }
.cv-block-card {
  display: flex; align-items: center; gap: 3mm; padding: 3mm 3.5mm;
  border: 1.5px solid #dde3ee; border-radius: 2.5mm; background: #f8f9fc;
  font-size: 8.2pt; color: #222; line-height: 1.4; cursor: grab; user-select: none;
}
.cv-block-card b { color: #14213d; }
.cv-block-card:hover { background: #eef1f8; border-color: #8ba0d1; }
.cv-block-card:active { cursor: grabbing; }
.cv-block-icon { font-size: 13pt; color: #3d5a99; flex-shrink: 0; width: 8mm; text-align: center; }
.cv-palette-hint { margin-top: 3mm; font-size: 7.2pt; color: #8895ab; line-height: 1.4; }

.cv-size-box { border-top: 1px solid #e2e6ee; margin-top: 3mm; padding-top: 1mm; }
.cv-size-row { margin-bottom: 2.5mm; }
.cv-size-row label { display: block; font-size: 7.6pt; color: #556; margin-bottom: 0.8mm; }
.cv-size-row input[type="range"] { width: 100%; accent-color: #3d5a99; cursor: pointer; }
.cv-size-reset {
  display: block; width: 100%; margin-top: 1mm; padding: 1.8mm 3mm;
  background: #f4f6fa; border: 1.5px dashed #b7c2d9; border-radius: 2mm;
  color: #4d5c82; font-size: 7.6pt; font-weight: 600; cursor: pointer;
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.cv-size-reset:hover { background: #eaeefb; border-color: #8ba0d1; }

/* Espacement supplémentaire entre sections, réglable, commun à tous les modèles */
.cv-block + .cv-block { margin-top: var(--sz-gap, 0mm); }

/* ---------- Inversion de colonnes (astuce du double miroir, marche en flex ou grid) ---------- */
.cv-swapped { transform: scaleX(-1); }
.cv-swapped > * { transform: scaleX(-1); }
.cv-swap-row {
  display: flex; align-items: center; gap: 2mm; font-size: 7.8pt; color: #333;
  margin-bottom: 1.5mm; cursor: pointer; font-family: "Helvetica Neue", Arial, sans-serif;
}
.cv-swap-row input { cursor: pointer; }

/* ---------- Liste à puces générique (bloc "À puces") ---------- */
.cv-generic-bullets { list-style: none; margin: 0; padding: 0; }
.cv-generic-bullets li { position: relative; padding-left: 4mm; margin-bottom: 0.6mm; }
.cv-generic-bullets li::before { content: "•"; position: absolute; left: 0; opacity: 0.7; }

.cv-color-wheel {
  width: 6.5mm; height: 6.5mm; padding: 0; border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%; background: none; cursor: pointer; overflow: hidden;
}
.cv-color-wheel::-webkit-color-swatch-wrapper { padding: 0; }
.cv-color-wheel::-webkit-color-swatch { border: none; border-radius: 50%; }
.cv-color-wheel::-moz-color-swatch { border: none; border-radius: 50%; }

/* ---------- Fenêtre d'aide ---------- */
.cv-help-overlay {
  position: fixed; inset: 0; background: rgba(20, 25, 40, 0.55);
  display: none; align-items: center; justify-content: center; z-index: 200;
  padding: 20px;
}
.cv-help-overlay.visible { display: flex; }
.cv-help-box {
  background: #fff; border-radius: 12px; max-width: 560px; width: 100%;
  max-height: 85vh; overflow-y: auto; padding: 28px 30px 24px;
  position: relative; font-family: "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.cv-help-box h2 { font-size: 18px; color: #14213d; margin-bottom: 14px; }
.cv-help-box h3 { font-size: 13px; color: #3d5a99; margin: 14px 0 4px; }
.cv-help-box h3:first-of-type { margin-top: 0; }
.cv-help-box p { font-size: 12.5px; color: #444; line-height: 1.55; }
.cv-help-box code { background: #f0f2f7; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.cv-help-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 22px; color: #888; cursor: pointer; line-height: 1;
}
.cv-help-close:hover { color: #222; }
.cv-help-ok {
  display: block; margin: 20px auto 0; background: #3d5a99; color: #fff;
  border: none; border-radius: 6px; padding: 9px 22px; font-size: 13px;
  font-weight: 700; cursor: pointer; font-family: "Helvetica Neue", Arial, sans-serif;
}
.cv-help-ok:hover { background: #4d6cae; }

/* ---------- Barre de mise en forme du texte sélectionné ---------- */
.cv-sel-toolbar {
  position: absolute; top: -999px; left: -999px; z-index: 300;
  display: none; align-items: center; gap: 2px; background: #1e2530;
  border-radius: 6px; padding: 4px; box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.cv-sel-toolbar.visible { display: flex; }
.cv-sel-toolbar button {
  background: transparent; border: none; color: #fff; width: 26px; height: 24px;
  border-radius: 4px; cursor: pointer; font-size: 12px; line-height: 1;
}
.cv-sel-toolbar button:hover { background: #3a4356; }
.cv-sel-sep { width: 1px; height: 16px; background: #444d5e; margin: 0 2px; }

@media print {
  body { padding-bottom: 0; }
  .page { margin: 0 auto !important; box-shadow: none !important; }
  .cv-toolbar, .no-print { display: none !important; }
  [contenteditable="true"]:hover, [contenteditable="true"]:focus { background: transparent; }
  .cv-repeat-item { break-inside: avoid; page-break-inside: avoid; }
}
