/* === Загальне оформлення === */
body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
}

/* === A4 обгортка === */
.a4-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  height: 297mm;
  max-height: 297mm;
  box-sizing: border-box;
  gap: 20px;
}

/* === Левая часть — форма === */
.cv-form-wrapper {
  width: 50%;
  height: 100%;
  background-color: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  overflow-y: auto;
}

form {
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
}

.form-left {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.form-left input,
textarea {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-sizing: border-box;
  width: 100%;
}

textarea#about {
  resize: none;
  height: 120px;
}

/* === Превью блок справа === */
.cv-preview-wrapper {
  width: 50%;
  height: 100%;
  background-color: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  overflow-y: auto;
}

/* === Toolbar === */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.editor-toolbar select,
.editor-toolbar input[type="color"],
.editor-toolbar button {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  background: #f5f5f5;
}

.editor-toolbar button:hover {
  background-color: #e0e0e0;
}

/* === Превью контент === */
.cv-live-preview {
  width: 210mm;
  height: 297mm;
  box-sizing: border-box;
  padding: 20mm;
  background-color: #fff;
}

.cv-preview-output {
  background-color: #fafafa;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 20px;
  font-size: 16px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.cv-preview-output p {
  margin: 1px 0;
  line-height: 1.3;
}

.cv-preview-output h2 {
  margin: 0 0 8px 0;
  font-size: 22px;
  line-height: 1.2;
}

/* === Контент для редагування === */
.cv-preview-output [contenteditable="true"] {
  outline: none;
  cursor: text;
  padding: 1px 2px;
  border-radius: 4px;
}

.cv-preview-output [contenteditable="true"]:focus {
  background-color: #fffbe5;
  border-bottom: 1px dashed #999;
}

/* === Фото в правом верхнем углу === */
.cv-header {
  display: flex;
  gap: 20px;
  position: relative;
}

.cv-photo-fixed {
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #ccc;
}

/* === Превью фото в форме === */
#preview {
  width: 150px;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #ccc;
}

/* === Навички === */
#skillsContainer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

#skillInput {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 10px;
}

#suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  max-height: 150px;
  overflow-y: auto;
  background-color: #fff;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
}

#suggestions li {
  padding: 10px;
  cursor: pointer;
}

#suggestions li:hover {
  background-color: #f0f0f0;
}

.hidden {
  display: none;
}

#selectedSkills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background-color: #007bff;
  color: #fff;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.skill-tag button {
  background: none;
  border: none;
  color: #fff;
  font-weight: bold;
  margin-left: 8px;
  cursor: pointer;
}

/* === Кнопки === */
.submit-btn,
#genDesc {
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  background-color: #007bff;
  color: #fff;
  cursor: pointer;
  width: 100%;
}

.download-btn {
  margin-top: 20px;
  padding: 12px 24px;
  background-color: #28a745;
  color: white;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.download-btn:hover {
  background-color: #218838;
}

.cv-download-btn-wrapper {
  text-align: center;
  margin-top: 20px;
}

/* === Адаптив для мобільних === */
@media (max-width: 768px) {
  .a4-wrapper {
    flex-direction: column;
    height: auto;
  }

  .cv-form-wrapper,
  .cv-preview-wrapper {
    width: 100%;
    max-height: none;
  }
}
.language-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.language-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
}
.language-content button {
  margin: 10px;
  padding: 10px 20px;
}
input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
}

