:root {
  --problem-row-max-height: 2.875rem;
}

@media screen and (max-width: 576px) {
  :root {
    --problem-row-max-height: 6rem;
  }
}

.problems--problem-row {
  max-height: var(--problem-row-max-height);
  .menus--more-options-container > button:not([data-active="true"]) {
    display: none;
  }

  &:hover > .menus--more-options-container > button {
    display: flex;
  }

}

.problems--problem-name {
  margin-inline: .75rem .25rem;
}

.problems--problem-code {
  font-size: var(--rem-11);
  font-variation-settings: "wght" var(--text-medium);
  color: var(--text-label);
  background-color: var(--surface-subtle);
  padding-inline: .25rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1rem;
}

.problems--list-container {
  gap: 1rem;
  max-height: calc(var(--problem-row-max-height) * 5 + 5 * 1rem);
}

.problems--item-container {
  display: flex;
  flex: 1;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
}

.problems--item-row {
  display: flex;
  flex-direction: column;
}

.problems--item-text {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

dialog.modals--main-modal:has(.problems--modal) {
  width: 518px;
  min-width: unset;

  .modals--body {
    max-height: unset;
  }
}

.problems--modal {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.problems--modal-header {
  display: flex;
  position: relative;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  color: var(--text-heading);
  font-size: var(--rem-18);
  font-variation-settings: 'wght' var(--text-semibold);
  line-height: 140%;
}

.problems--modal-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;

}

.problems--modal-body {
  display: flex;
  flex-direction: column;
}

.problems--modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--rem-8);

  button {
    width: fit-content;
  }
}

.problems--more-options-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: none;
  background-color: white;
  &:hover {
    background-color: var(--surface-subtle);
  }

  &[data-active="true"] {
    background-color: var(--surface-secondary);
  }
}

.problems--more-options-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.problems--diagnoses-input-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.5rem;
  align-items: flex-start;

  p {
    font-size: var(--rem-14);
    color: var(--text-label);
    font-variation-settings: "wght" var(--text-medium);
  }
}

.problems--diagnoses-input-selected-items {
  display: none;
  flex-direction: column;
  width: 100%;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid;
  border-color: var(--border-secondary);

  &:has(*) {
    display: flex;
  }

  > div:not(:last-child) {
    border-bottom: 1px solid var(--border-secondary);
    padding-bottom: 0.5rem;
  }
}

.problems--diagnoses-input-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.problems--diagnoses-input-item-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-overflow: ellipsis;
  max-width: calc(100% - 2.25rem);
}

.problems--diagnoses-input-add-buttom {
  display: flex;
  gap: 0.25rem;
  width: fit-content;
  padding: 0;
  background-color: transparent;
  color: var(--text-action);
  outline: none;
}

.problems--diagnoses-input-search-container {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

.problems--diagnoses-input {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
  padding: var(--rem-10) var(--rem-12);
  border: 1.5px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  &:has(input:focus) {
    border-color: var(--border-focus);
  }
  input {
    line-height: var(--rem-16);
    padding: 0;
  }
}

.problems--diagnoses-input-results {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: absolute;
  z-index: 10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  top: 100%;
  margin-top: 2px;
  background-color: white;

  li {
    padding: var(--rem-8) var(--rem-12);
  }

  li:hover {
    background-color: var(--surface-subtle);
    cursor: pointer;
  }
}
