/* --- 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;
  min-width: 600px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

/* --- 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;
  color: #101010;
}
.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;
}
.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: 85%;
}
.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;
}

/* --- User Modal Specific Fixes --- */
#userModal .modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

#userModal .modal-top-fields {
  align-items: flex-start;
  gap: 20px 30px;
}

/* Checkbox alignment fix */
.field-group input[type="checkbox"] {
  width: auto;
  margin-top: 6px;
}

/* Checkbox label alignment */
.field-group label[for="userRemote"] {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Small text under input */
.field-group small {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

/* Buttons spacing */
.modal-buttons button {
  padding: 8px 16px;
  background-color: #101010;
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.modal-buttons button:hover {
  background-color: #333;
}

h4.fade-to-gray {
    font-weight: normal;
    font-size: 20px;
    color: #ccc;
}

hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 20px 0;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  flex: 1;
  padding-right: 30px;
}

.toggle-password-btn {
  position: absolute;
  right: 1px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #555;
  padding: 6px;
  border-radius: 4px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid #ccc;
}

.toggle-password-btn:hover {
  background-color: #ccc !important;
}

/* --- Advanced block style --- */
#advancedUserFields {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  display: none;
  transition: opacity 0.3s ease;
}
#advancedUserFields[style*="display: none"] {
  opacity: 0;
}
