/* ===== RESET & ZÁKLAD ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  margin: 0;
  padding: 0;
  color: #333;
}

h1 {
  text-align: center;
  margin-top: 30px;
}

body > h2 {
  text-align: center;
  margin-top: 25px;
}




p {
  max-width: 800px;
  margin: 10px auto;
  text-align: left;
  color: #555;
}

/* ===== FORM ===== */
form {
  max-width: 900px;
  margin: 30px auto;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* kroky */
.step {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px);}
  to { opacity: 1; transform: translateY(0);}
}

/* ===== FORM GROUP ===== */
.form-group {
  margin-bottom: 25px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 15px;

}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

/* ===== INPUT ===== */
input[type="text"], select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border 0.2s;
}

input:focus, select:focus {
  border-color: #007bff;
  outline: none;
}

/* ===== BUTTONS ===== */
button {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #0056b3;
}

button:disabled {
  background: #ccc;
}

/* ===== SUGGESTIONS (autocomplete) ===== */
#suggestions {
  position: absolute;
  border: 1px solid #ccc;
  background: white;
  z-index: 9999;
  width: 250px;
  border-radius: 6px;
  overflow: hidden;
}

.suggestion-item {
  padding: 8px;
  cursor: pointer;
}

.suggestion-item:hover {
  background: #f0f0f0;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: white;
  padding: 20px;
  margin: 5% auto;
  width: 500px;
  border-radius: 10px;
  max-height: 80vh;
  overflow-y: auto;
}

/* ===== NACE LIST ===== */
#naceList {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 5px;
  border-radius: 6px;
}

.item {
  padding: 8px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
}

.item:hover {
  background: #f5f5f5;
}

.item.selected {
  background: #007bff;
  color: white;
}

/* ===== SELECTED TAGS ===== */
#selectedList span {
  display: inline-block;
  background: #e0e0e0;
  padding: 6px 10px;
  margin: 4px;
  border-radius: 6px;
  font-size: 13px;
}

/* ===== OPTION BLOCK ===== */
.option {
  border: 1px solid #e0e0e0;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  background: #fafafa;
}

.option:hover {
  border-color: #007bff;
}

/* aktivní varianta */
.option.active {
  border-color: #007bff;
  background: #eef6ff;
}

.option-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap; /* aby se to na mobilu zalomilo */
}

.option-header input[type="checkbox"] {
  margin: 0;
}

.option-header label {
  margin: 0;
  cursor: pointer;
}

/* ikona hned za textem */
.info-icon {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.option-header label {
  flex: 1; /* text zabere místo mezi checkboxem a ikonou */
}

.option-header {
  cursor: pointer;
}

.option-header,
.sub-option,
.sub-sub-option {
  align-items: center;
}


/* ===== INFO ICON ===== */
.info-icon {
  width: 16px;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;

  min-width: 16px;
  min-height: 16px;

   flex-shrink: 0;
   align-self: center;
}

/* ===== INFO TEXT ===== */
.info-text {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;

  background: #f0f8f0;
  border-left: 3px solid green;
  padding: 0 8px;
  margin-top: 5px;
  font-size: 14px;
  
}

.info-text.active {
  padding: 10px;
  max-height: 250px;
  overflow-y: auto;
}

/* ===== SUB OPTIONS ===== */
.sub-option {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap; 

  flex-basis: 100%;

  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;

  margin-left: 20px;
  padding-left: 10px;
  border-left: 2px dashed #ccc;
}

.sub-option label {
  margin: 0;
  cursor: pointer;
  flex: 1;
}

.option.active .sub-option {
  max-height: 600px;
  margin-top: 8px;
}

/* checkbox spacing */
.sub-option input {
  margin-right: 6px;
}

.sub-option-header {
  display: block;           /* zajistí vlastní řádek */
  width: 100%;              /* roztáhne se přes celou šířku */
  flex-basis: 100%;  

  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;

  margin-bottom: 8px;
  margin-top: 5px;

  padding-bottom: 4px;
  border-bottom: 1px solid #e0e0e0;

  background: #f5f7fa;
  padding: 6px 8px;
  border-radius: 4px;
}

/* ===== "NESPLŇUJI" VARIANTA ===== */
#variantaNo:checked + label {
  color: #c0392b;
  font-weight: bold;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  form {
    padding: 20px;
  }

  .modal-content {
    width: 90%;
  }
}


/* ===== Tlačítko Předchozí a Další ===== */
.form-navigation {
  display: flex;
  justify-content: space-between; /* 👈 rozdělí na kraj */
  margin-top: 20px;
}

.btn-back {
  background: #6c757d; /* šedá */
}

.btn-back:hover {
  background: #5a6268;
}

.btn-next {
  background: #007bff; /* modrá (ponecháš styl) */
  margin-left: auto;
}

.btn-next:hover {
  background: #0056b3;
}

.btn-right {
  display: flex;
  margin-left: flex-end;   /* 👈 tohle ho pošle doprava */
}

/* ===== SUB SUB OPTIONS ===== */
.sub-sub-option {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;

  flex-basis: 100%;

  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;

  margin-left: 35px;
  padding-left: 12px;
  border-left: 2px dotted #999;
}

.sub-sub-option label {
  margin: 0;
  cursor: pointer;
  flex: 1;
}

/* rozbalení */
.sub-option.active-sub .sub-sub-option {
  max-height: 400px;
  margin-top: 8px;
}


.radio-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* schovat klasický radio */
.radio-buttons input[type="radio"] {
  display: none;
}

/* základ tlačítka */
.radio-buttons label {
  padding: 10px 18px;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  background: #f5f5f5;
  font-weight: normal;
  transition: all 0.2s ease;
  user-select: none;
}

/* hover */
.radio-buttons label:hover {
  border-color: #007bff;
}

/* aktivní (checked) stav */
.radio-buttons input[type="radio"]:checked + label {
  background: #007bff;
  color: white;
  border-color: #007bff;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,123,255,0.25);
}


.required {
  color: #e74c3c;
  font-weight: bold;
  margin-left: 4px;
}

.invalid {
  border: 2px solid #e74c3c !important;
  background: #fff5f5;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.invalid-group {
  border: 2px solid #e74c3c !important;
  background: #fff5f5;
}

.error-message {
  color: #e74c3c;
  font-weight: bold;
  margin-top: 10px;
}

.suggestion-item.active {
    background: #dbeafe;
    cursor: pointer;
}

/* ===== USER STATISTICS BOX ===== */
#user-info {
  margin-top: 15px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  overflow: hidden;

  max-height: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.25s ease;
}

/* aktivní stav */
#user-info.active {
  padding: 16px;
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
  overflow-y: auto;   /* 👈 DŮLEŽITÉ */
}

#user-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#user-info li {
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #f8fafc;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

/* poslední řádek bez marginu */
#user-info li:last-child {
  margin-bottom: 0;
}

#user-info li strong {
  color: #111827;
}

#user-info li span {
  font-weight: 600;
  color: #2563eb;
}

/* graf */
.chart-wrapper {
  width: 90%;

  max-width: 800px;   /* tady si nastav velikost */
  margin: 20px auto;
}

#cropChart {
  width: 100% !important;
  height: auto !important;
}