/* --- Global Box Sizing --- */
/* *,
*::before,
*::after {
  box-sizing: border-box;
} */

/* --- Task Search --- */
.task-search-wrapper {
  width: 30%;
}
#taskSearchInput {
  width: 100%;
}

/* --- Modal Overlay --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* --- Modal Box --- */
.modal-content {
  background: #fefefe;
  padding: 40px 30px;
  border-radius: 8px;
  width: 80%;
  min-width: 600px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  height: 85%;
}

/* --- Title --- */
.modal-title {
  margin-bottom: 1rem;
}
.modal-title h3 {
  margin: 0;
  font-size: 1.4em;
  font-weight: normal;
  color: #101010;
}

/* --- Top Fields (main + advanced) --- */
.modal-top-fields,
#advancedTaskFields {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 14px;
}
.modal-top-fields {
  align-items: flex-end;
}

/* --- Field group --- */
.field-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 180px;
}
.field-group label {
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 4px;
}
.field-group input,
.field-group select {
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
  color: black;
  margin: 2px 0px;
  width: 100%;
}

/* --- Advanced block style --- */
#advancedTaskFields {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  display: none;
  transition: opacity 0.3s ease;
}
#advancedTaskFields[style*="display: none"] {
  opacity: 0;
}

/* --- Switch --- */
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
  user-select: none;
}
.switch-label input[type="checkbox"] {
  display: none;
}
.switch-slider {
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 10px;
  position: relative;
  transition: background-color 0.3s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
.switch-label input[type="checkbox"]:checked + .switch-slider {
  background-color: #31a46e;
}
.switch-label input[type="checkbox"]:checked + .switch-slider::before {
  transform: translateX(20px);
}
.switch-text {
  font-weight: 500;
}

/* --- Text field (editor) --- */
.modal-text-field {
  flex-grow: 1;
  margin-bottom: 1rem;
  height: 50%;
}
.modal-text-field label {
  margin-bottom: 4px;
}

/* --- File field --- */
.modal-files-field {
  margin-bottom: 1rem;
}

/* --- TinyMCE --- */
.tox.tox-tinymce.tox-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
}
.tox.tox-tinymce {
  min-height: 100px;
  max-height: 90%;
}
.tox-statusbar__branding {
  display: none !important;
}

/* --- Modal Buttons --- */
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.modal-buttons .delete-button {
  margin-right: auto;
  color: white;
}
.modal-buttons .delete-button:hover {
  background-color: #d10000;
}
.modal-buttons button:hover {
  background-color: #666;
  color: white;
}

/* --- Notification Modal --- */
.modal-content-notifications {
  background: #fefefe;
  padding: 40px 30px;
  border-radius: 8px;
  width: auto;
  min-width: 600px;
  height: auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.modal-content-notifications input,
.modal-content-notifications select,
.modal-content-notifications textarea {
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  color: #000;
  padding: 8px;
  font-size: 14px;
}
.modal-content-notifications label {
  margin-top: 14px;
  font-size: 18px;
  color: #000000;
  display: block;
}

/* --- Utility --- */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
label.no-margin {
  margin-top: 0 !important;
}
.left-marg {
  margin-left: 4px;
}
#taskTreeViewer {
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  padding: 14px;
  margin-bottom: 20px;
  font-family: sans-serif;
  font-size: 14px;
}

/* Ensure container holds multiple columns */
.task-tree-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 60px;
  position: relative;
  padding: 20px;
}

/* Each column in the tree layout */
.tree-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

/* Nodes inside the tree */
.task-node {
  z-index: 1;
  position: relative;
  white-space: nowrap;
}

/* SVG path lines */
.task-tree-lines {
  z-index: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Optional: legacy styles, remove if unused */
#taskTreeOutput {
  line-height: 1.6em;
}

.task-node {
  z-index: 1;
  position: relative;
  white-space: nowrap;
  background-color: #eee;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 500;
  font-family: inherit;
}

.task-node.clickable {
  cursor: pointer;
}

.task-node.highlighted-task {
  background-color: #eaaa02;
  color: #000000;
  font-weight: 500;
}

.task-node.clickable:hover {
  background-color: #ccc;
  transition: opacity 0.3s ease;
}

.task-node.highlighted-task:hover {
  background-color: #d39700;
}

.relation-btn {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.relation-btn:hover {
  background-color: #ccc;
  border-radius: 6px;
}