/* style.css */

/* Reset i podstawowe style */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 20px;
  display: flex;
  gap: 20px;
  background-color: #f7f7f5;
  color: #222;
}

/* Kontener formularza */
#formContainer {
  width: 35%;
  overflow-y: auto;
  max-height: 90vh;
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 0 8px rgb(0 0 0 / 0.1);
}

/* Labelki */
label {
  font-weight: bold;
  margin-top: 15px;
  display: block;
}

/* Inputy tekstowe, email, file, color */
input[type="text"],
input[type="email"],
input[type="file"],
input[type="color"] {
  width: 100%;
  padding: 6px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Kontenery edytorów Quill */
.editor-container {
  height: 200px;
  background: white;
  margin-top: 6px;
}

/* Sekcje formularza */
.section-block {
  border: 1px solid #ccc;
  padding: 10px;
  margin-top: 15px;
  background: #fafafa;
  border-radius: 6px;
}

.section-block input.section-title {
  font-weight: bold;
  width: 100%;
  margin-bottom: 6px;
  padding: 4px;
  box-sizing: border-box;
}

/* Przyciski */
.btn {
  margin-top: 10px;
  padding: 8px 12px;
  cursor: pointer;
  width: 100%;
  background-color: #1c2c3b;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #0f1d29;
}

/* Kontener podglądu i eksportu CV */
#previewContainer {
  width: 794px; /* A4 width at 96dpi */
  min-height: 0;
  height: auto !important;
  background: white;
  padding: 0px;
  box-sizing: border-box;
  margin: 0 auto;
  overflow: visible; /* важно */
  border-radius: 6px;
  box-shadow: 0 0 8px rgb(0 0 0 / 0.1);
  border: none;
}

/* Styl czysty tylko na czas eksportu PDF */
body.exporting #previewContainer {
  min-height: 0 !important;
  height: auto !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Scrollbar (opcjonalnie) */
#formContainer::-webkit-scrollbar,
#previewContainer::-webkit-scrollbar {
  width: 6px;
}

#formContainer::-webkit-scrollbar-thumb,
#previewContainer::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

/* Dodatkowe style dla responsywności */
@media (max-width: 900px) {
  body {
    flex-direction: column;
    margin: 0;
  }

  #formContainer {
    width: 100%;
    max-height: none;
    height: auto;
  }
}

/* --- ДОБАВЛЕННО ДЛЯ ПРАВИЛЬНОГО ПЕРЕНОСА В PDF --- */
body.exporting .page-break {
  page-break-before: always;
  break-before: page;
}

.cv-section {
  page-break-inside: avoid;
  break-inside: avoid;
  overflow: visible;
}

/* Список динамических элементов */
.dynamic-list {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

.dynamic-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  margin-bottom: 6px;
  background: #e9ecef;
  border-radius: 4px;
  font-size: 14px;
}

.dynamic-list li button {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.dynamic-list li button:hover {
  background-color: #c82333;
}
