.multi-sort-container {
  width: 280px;
  padding: 0.5rem;
}

.multi-sort-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.header-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-color);
}

.sort-criteria-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 40px;
}

.sort-criterion {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: var(--overlay-background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: move;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;

  &:hover {
    background-color: var(--ground-background);
  }
}

.cdk-drag-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: var(--card-background);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

.cdk-drag-placeholder {
  opacity: 0.3;
}

.cdk-drag-animating {
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

.sort-criteria-list.cdk-drop-list-dragging .sort-criterion:not(.cdk-drag-placeholder) {
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

.criterion-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary-color);
  cursor: grab;

  &:active {
    cursor: grabbing;
  }

  i {
    font-size: 0.85rem;
  }
}

.criterion-rank {
  font-weight: 600;
  color: var(--primary-color);
  min-width: 1.25rem;
}

.criterion-label {
  flex: 1;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-color);
}

.criterion-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.direction-btn,
.remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background-color: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease;

  i {
    font-size: 0.85rem;
  }

  &:hover:not(:disabled) {
    background-color: var(--ground-background);
  }

  &:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
}

.direction-btn {
  color: var(--primary-color);
}

.remove-btn {
  color: var(--p-red-500);
}

.add-sort-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.save-sort-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}
